add build step to download bootswatch themes, and clean up .gitignore

avi/defaulttheme
Shuhei Kadowaki 2020-06-02 19:30:05 +09:00 committed by Shuhei Kadowaki
parent 35aeb15b62
commit 657ec582df
2 changed files with 28 additions and 4 deletions

8
.gitignore vendored
View File

@ -1,11 +1,15 @@
Manifest.toml
/doc/build/
/stylesheets/bootswatch/
examples/figures/
examples/*.md
examples/*.pdf
examples/*.html
examples/*.rst
examples/*.tex
test/**/cache
test/**/figures
test/documents/output/gadfly_formats_test.txt
@ -19,10 +23,6 @@ test/**/chunk_options.jl
test/**/*.ipynb
!test/**/*ref.*
doc/build
doc/site
.idea
*.*~
*.aux
*.log

24
deps/build.jl vendored Normal file
View File

@ -0,0 +1,24 @@
# # to update `themes`
# let
# using HTTP, JSON
# r = HTTP.request("GET", "https://bootswatch.com/api/4.json") |> HTTP.payload |> String |> JSON.parse
# lowercase.(get.(values(r["themes"]), "name", "")) |> repr |> clipboard
# end
bootswatch_version = "4"
themes = ["cerulean", "cosmo", "cyborg", "darkly", "flatly", "journal", "litera", "lumen", "lux", "materia", "minty", "pulse", "sandstone", "simplex", "sketchy", "slate", "solar", "spacelab", "superhero", "united", "yeti"]
targets = ["bootstrap.min.css", "_bootswatch.scss", "_variables.scss"]
BOOTSWATCH_DIR = normpath(@__DIR__, "..", "stylesheets", "bootswatch")
isdir(BOOTSWATCH_DIR) || mkdir(BOOTSWATCH_DIR)
function download_theme(theme)
theme_dir = normpath(BOOTSWATCH_DIR, theme)
isdir(theme_dir) || mkdir(theme_dir)
for target in targets
file = normpath(theme_dir, target)
isfile(file) || download("https://bootswatch.com/$(bootswatch_version)/$(theme)/$(target)", file)
end
end
download_theme.(themes)