From 642db04187a646ed6b70d6c29645d1d064f274cc Mon Sep 17 00:00:00 2001 From: t-bltg Date: Sat, 26 Nov 2022 22:39:01 +0100 Subject: [PATCH] propagate `src` to `cardtheme` --- src/Themes/Themes.jl | 4 +++- src/generate.jl | 2 +- src/preview.jl | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Themes/Themes.jl b/src/Themes/Themes.jl index 4502a53a..4f38c5d6 100644 --- a/src/Themes/Themes.jl +++ b/src/Themes/Themes.jl @@ -40,6 +40,7 @@ include("bokehlist/bokehlist.jl") """ cardtheme(theme = "grid"; root = "", + src = "src", destination = "democards") -> templates, stylesheet_path For given theme, return the templates and path to stylesheet. @@ -51,11 +52,12 @@ Available themes are: """ function cardtheme(theme::AbstractString="grid"; root::AbstractString = Base.source_dir(), + src::AbstractString = "src", destination::String = "democards") templates, src_stylesheet_path = cardtheme(Val(Symbol(theme))) # a copy is needed because Documenter only support relative path inside root - absolute_root = joinpath(root, "src", destination) + absolute_root = joinpath(root, src, destination) filename = "$(theme)theme.css" out_stylesheet_path = joinpath(absolute_root, filename) isdir(absolute_root) || mkpath(absolute_root) diff --git a/src/generate.jl b/src/generate.jl index 05e1350d..5847a9cc 100644 --- a/src/generate.jl +++ b/src/generate.jl @@ -130,7 +130,7 @@ function makedemos(source::String, templates::Union{Dict, Nothing} = nothing; end if !isnothing(page.theme) - page_templates, theme_assets = cardtheme(page.theme, root = root) + page_templates, theme_assets = cardtheme(page.theme; root = root, src = src) theme_assets = something(page.stylesheet, theme_assets) if templates != page_templates && templates != nothing diff --git a/src/preview.jl b/src/preview.jl index 224cd67d..0a3a369d 100644 --- a/src/preview.jl +++ b/src/preview.jl @@ -70,7 +70,7 @@ function preview_demos(demo_path::String; if isnothing(theme) card_templates = nothing else - card_templates, card_theme = cardtheme(theme; root = build_dir) + card_templates, card_theme = cardtheme(theme; root = build_dir, src = src) push!(assets, something(page.stylesheet, card_theme)) end