Skip to content

Commit

Permalink
add build step to download bootswatch themes, and clean up .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored and r-aviatesk committed Sep 8, 2020
1 parent 35aeb15 commit 657ec58
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,10 +23,6 @@ test/**/chunk_options.jl
test/**/*.ipynb
!test/**/*ref.*

doc/build
doc/site

.idea
*.*~
*.aux
*.log
Expand Down
24 changes: 24 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 657ec58

Please sign in to comment.