From f647f448b06a5e3182f2c9ac7a8da663ee4d6ef9 Mon Sep 17 00:00:00 2001 From: Frankie Robertson Date: Tue, 22 Aug 2023 14:43:53 +0300 Subject: [PATCH] Add nocoverlist theme --- .../basics/configure_sec_and_page.md | 1 + src/Themes/Themes.jl | 3 +- src/Themes/nocoverlist/nocoverlist.jl | 42 +++++++++++++++++++ src/Themes/nocoverlist/style.css | 24 +++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/Themes/nocoverlist/nocoverlist.jl create mode 100644 src/Themes/nocoverlist/style.css diff --git a/docs/quickstart/usage_example/basics/configure_sec_and_page.md b/docs/quickstart/usage_example/basics/configure_sec_and_page.md index 7e65bac9..ddc2be1a 100644 --- a/docs/quickstart/usage_example/basics/configure_sec_and_page.md +++ b/docs/quickstart/usage_example/basics/configure_sec_and_page.md @@ -42,6 +42,7 @@ There are three possible options for `theme`: Documenter for navigation purpose. `template` option doesn't affect, neither. * `"grid"`: a grid like index page. * `"list"`: a list like index page. +* `"nocover"`: a list like index page without cover images. You can check the "Theme Gallery" to see how different themes look like. diff --git a/src/Themes/Themes.jl b/src/Themes/Themes.jl index 4f38c5d6..9af33b2d 100644 --- a/src/Themes/Themes.jl +++ b/src/Themes/Themes.jl @@ -25,7 +25,7 @@ using Mustache """ A list of DemoCards theme presets """ -const themelists = ["bulmagrid", "bokehlist", "grid", "list"] +const themelists = ["bulmagrid", "bokehlist", "grid", "list", "nocoverlist"] # TODO: don't hardcode this const max_coversize = (220, 200) @@ -34,6 +34,7 @@ const max_coversize = (220, 200) include("bulmagrid/bulmagrid.jl") include("grid/grid.jl") include("list/list.jl") +include("nocoverlist/nocoverlist.jl") include("bokehlist/bokehlist.jl") diff --git a/src/Themes/nocoverlist/nocoverlist.jl b/src/Themes/nocoverlist/nocoverlist.jl new file mode 100644 index 00000000..1f70de22 --- /dev/null +++ b/src/Themes/nocoverlist/nocoverlist.jl @@ -0,0 +1,42 @@ +const nocoverlist_section_template = mt""" +{{{description}}} + +```@raw html +
+``` + +{{{cards}}} + +```@raw html +
+``` +""" + +const nocoverlist_card_template = mt""" +```@raw html +
+ + +
+``` +[{{{title}}}](@ref {{id}}) +```@raw html +
+
+``` +{{{description}}} +```@raw html +
+
+
+``` + +""" + +function cardtheme(::Val{:nocoverlist}) + templates = Dict( + "card" => nocoverlist_card_template, + "section" => nocoverlist_section_template + ) + return templates, abspath(@__DIR__, "style.css") +end diff --git a/src/Themes/nocoverlist/style.css b/src/Themes/nocoverlist/style.css new file mode 100644 index 00000000..82c452d5 --- /dev/null +++ b/src/Themes/nocoverlist/style.css @@ -0,0 +1,24 @@ +.list-card:hover{ + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.1); +} + +.list-card { + width: 800px; + max-height: 250px; + margin: 25px 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); + transition: 0.3s; + border-radius: 5px; +} + +.list-card-text { + padding: 10px 5px; + font-style: oblique 40deg; + font-size: large; +} + +.list-card-description { + width: 550px; + max-height: 250px; + line-height: 1.5; +}