From ef041fcb5f655d22422929b263578ad0efa7e754 Mon Sep 17 00:00:00 2001 From: ef3d0c3e Date: Sun, 3 Nov 2024 10:42:47 +0100 Subject: [PATCH] Better section styleing & Fix toc numbering issue --- src/elements/toc.rs | 7 ++++++- style.css | 13 +++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/elements/toc.rs b/src/elements/toc.rs index 4ff7f32..a8a4109 100644 --- a/src/elements/toc.rs +++ b/src/elements/toc.rs @@ -66,6 +66,11 @@ impl Element for Toc { } } + if sections.is_empty() + { + return Ok("".into()) + } + match compiler.target() { Target::HTML => { let match_depth = |current: usize, target: usize| -> String { @@ -92,7 +97,7 @@ impl Element for Toc { result += match_depth(current_depth, section.depth).as_str(); if section.kind & section_kind::NO_NUMBER != 0 { result += format!( - "
  • {}
  • ", + "
  • {}
  • ", Compiler::refname(compiler.target(), section.title.as_str()), Compiler::sanitize(compiler.target(), section.title.as_str()) ) diff --git a/style.css b/style.css index 57acd6f..8acbc66 100644 --- a/style.css +++ b/style.css @@ -205,7 +205,12 @@ li.navbar-entry-current a { margin-top: 1.8em; width: 85%; padding: 0.5em; - background-color: #1f1f1f; + font-size: 1.15em; + + background-color: #242526; + + border-radius: 3px; + box-shadow: 0px 0px 3px 1px #242526 inset; } .toc a { @@ -221,6 +226,7 @@ li.navbar-entry-current a { .toc span { display: flex; justify-content: center; + font-weight: 600; } /* Sections */ @@ -229,6 +235,10 @@ a.section-link { text-decoration: none; } +h1, h2, h3, h4, h5, h6 { + color: #BA54Cc +} + h1:hover a.section-link { display: inline; } @@ -391,4 +401,3 @@ blockquote p::after { .blockquote-author { margin-left: 0.2em; } -