From 0859b0dfdfe39e6e6479c8991f81336c13471255 Mon Sep 17 00:00:00 2001 From: DavHau Date: Thu, 11 Jul 2024 22:53:53 +0700 Subject: [PATCH] docs: improve table of contents for options - increase width of toc - show full option path in toc - no nesting This simplifies navigation on option pages a lot. --- docs/src/style.css | 11 +++++ docs/theme/partials/toc-item.html | 68 +++++++------------------------ 2 files changed, 25 insertions(+), 54 deletions(-) diff --git a/docs/src/style.css b/docs/src/style.css index d95edd65b6..dc228995bd 100644 --- a/docs/src/style.css +++ b/docs/src/style.css @@ -10,3 +10,14 @@ .md-typeset td pre { margin: 0; } + +/* increase the width of the while site */ +.md-grid { + max-width: 80rem; +} + +/* increase the width of the right hand side bar to display long option names better*/ +.md-sidebar--secondary { + width: 25rem !important; + left: -25rem !important; +} diff --git a/docs/theme/partials/toc-item.html b/docs/theme/partials/toc-item.html index 5af8905ab4..09dc92be30 100644 --- a/docs/theme/partials/toc-item.html +++ b/docs/theme/partials/toc-item.html @@ -1,56 +1,16 @@ - - -
  • - {%- set should_collapse = toc_item.level > 2 and toc_item.children -%} - {% if should_collapse -%} -
    - - {%- endif %} - - - {%- if page.url.split("/")[-3] == "reference" -%} - {{ toc_item.title.split(".")[-1] }} - {%- else -%} - {{ toc_item.title }} - {%- endif -%} - - - {% if should_collapse -%} - - {%- endif %} - - - {% if toc_item.children %} - - {% endif %} - {% if should_collapse -%} -
    - {%- endif %} + + + {{ toc_item.title | replace(".", ".")}} + + + {% if toc_item.children %} + + {% endif %}