From afd6aaa5cf7fb4dd7a6474dd0d2ee481949dc9e3 Mon Sep 17 00:00:00 2001 From: Bagaev Dmitry Date: Mon, 13 Jan 2025 19:11:48 +0100 Subject: [PATCH] fix dark theme --- docs/make.jl | 59 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index cd4c23e..3b90967 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -84,8 +84,9 @@ end function style_tag(tag) """ + border-radius: 3px; font-size: 0.9em; + background: var(--tag-bg-color, #f3f6f9); + color: var(--tag-text-color, #476582);"> $(tag) """ @@ -94,7 +95,7 @@ end function style_category_header(category) """ ```@raw html -

+

$(titlecase(replace(category, "_" => " ")))

``` @@ -106,13 +107,15 @@ function style_example_card(meta) """ ```@raw html -
+

``` [$(meta.title)]($(joinpath("..", meta.path))) ```@raw html

-

+

$(meta.description)

$(tags_html) @@ -121,6 +124,37 @@ function style_example_card(meta) """ end +# Add CSS variables for theme support +const THEME_STYLES = """ +```@raw html + +``` +""" + # Function to generate the list of examples page function generate_examples_list() # Ensure autogenerated directory exists @@ -138,6 +172,9 @@ function generate_examples_list() # Generate markdown content output_path = joinpath(AUTOGEN_DIR, "list_of_examples.md") open(output_path, "w") do io + # Add theme styles at the top + write(io, THEME_STYLES) + write(io, """ # List of Examples @@ -154,18 +191,20 @@ function generate_examples_list() ## External Resources ```@raw html -
-

Community Tutorials & Guides

+
+

Community Tutorials & Guides

  • Active Inference with RxInfer.jl
    - An in-depth exploration of Active Inference principles guided by + An in-depth exploration of Active Inference principles guided by Kobus Esterhuysen at Learnable Loop.
  • Video Tutorial Series
    - Comprehensive video tutorials covering RxInfer.jl's core concepts and applications by + Comprehensive video tutorials covering RxInfer.jl's core concepts and applications by @doggotodjl.
@@ -184,7 +223,7 @@ function generate_examples_list() # Add category description write(io, """ ```@raw html -
+
$(cat.description)
```