diff --git a/docs/api_doc_builder.py b/docs/api_doc_builder.py index a2c3eb80f7..9fca5b3089 100644 --- a/docs/api_doc_builder.py +++ b/docs/api_doc_builder.py @@ -587,7 +587,7 @@ def _create_rst_files_for_dir(src_root_dir_len: int, f.write(subdir_stem + '\n') f.write(section_line) f.write('\n') - f.write('.. toctree::\n :maxdepth: 1\n\n') + f.write('.. toctree::\n :maxdepth: 1\n :class: toctree-1-deep\n\n') # One entry per `.rst` file for h_file in elig_h_files: diff --git a/docs/src/_static/css/custom.css b/docs/src/_static/css/custom.css index 6ed1f364b0..f351801c06 100644 --- a/docs/src/_static/css/custom.css +++ b/docs/src/_static/css/custom.css @@ -441,6 +441,10 @@ code.literal { padding-top: 4rem; } +/*------------------------------------------------------------------------- + * TOC Level 1 + *-------------------------------------------------------------------------*/ + #furo-main-content ul:has(.toctree-l1) { max-width: 50%; list-style-type: none; @@ -461,6 +465,35 @@ code.literal { margin-top: 2rem; } +/* Special Case: 1-level-deep TOCs. + * Note: `...:not(:has(.toctree-l2))` won't do it because it ALSO selects + * .toctree-l1 elements in more complex TOCs, some of which simply don't have + * .toctree-l2 children! Instead, we want the special case where the TOC + * is limited by design to 1 level. Example: Widgets overview TOC. + */ + +#furo-main-content .toctree-1-deep .toctree-l1 + .toctree-l1 { + margin-top: 0.65rem; +} + +/* + * Welcome to LVGL Docs (home page) table of contents + *------------------------------------------------------------------------- + */ + +#furo-main-content .toctree-landing-page .toctree-l1 > a { + font-size: 1rem; + font-weight: 600; +} + +#furo-main-content .toctree-landing-page .toctree-l1 + .toctree-l1 { + margin-top: 0.125rem; +} + +/*------------------------------------------------------------------------- + * TOC Level 2 + *-------------------------------------------------------------------------*/ + #furo-main-content ul:has(.toctree-l2) { list-style-type: none; padding: 0; @@ -479,6 +512,10 @@ code.literal { text-decoration: underline; } +/*------------------------------------------------------------------------- + * TOC Level 3 + *-------------------------------------------------------------------------*/ + #furo-main-content .toctree-l3 > a { color: var(--color-text-base); } @@ -622,20 +659,6 @@ table.docutils th p { background-color: rgba(var(--color-background-base-rgb), 0.04); } -/* - * Welcome to LVGL Docs (home page) table of contents - *------------------------------------------------------------------------- - */ - -#welcome-to-lvgl-docs .toctree-l1 > a { - font-size: 1rem; - font-weight: 600; -} - -#welcome-to-lvgl-docs .toctree-l1 + .toctree-l1 { - margin-top: 0.125rem; -} - /* * Language selector (home page) *------------------------------------------------------------------------- diff --git a/docs/src/contributing/index.rst b/docs/src/contributing/index.rst index 64aaa29046..34c2c63a9b 100644 --- a/docs/src/contributing/index.rst +++ b/docs/src/contributing/index.rst @@ -5,6 +5,7 @@ Contributing ============ .. toctree:: + :class: toctree-1-deep :maxdepth: 1 introduction diff --git a/docs/src/details/auxiliary-modules/xml/index.rst b/docs/src/details/auxiliary-modules/xml/index.rst index 5a54e914da..91234c253e 100644 --- a/docs/src/details/auxiliary-modules/xml/index.rst +++ b/docs/src/details/auxiliary-modules/xml/index.rst @@ -5,6 +5,7 @@ XML - Declarative UI ==================== .. toctree:: + :class: toctree-1-deep :maxdepth: 1 intro diff --git a/docs/src/details/index.rst b/docs/src/details/index.rst deleted file mode 100644 index 90e833d6e6..0000000000 --- a/docs/src/details/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. _reference: - -======= -Details -======= - -.. toctree:: - :maxdepth: 2 - - ../examples - integration/index - common-widget-features/index - widgets/index - main-modules/index - auxiliary-modules/index - libs/index - debugging/index - ../contributing/index - ../CHANGELOG - ../API/index diff --git a/docs/src/details/integration/os/buildroot/index.rst b/docs/src/details/integration/os/buildroot/index.rst index 32b60e0f84..f38071e5c8 100644 --- a/docs/src/details/integration/os/buildroot/index.rst +++ b/docs/src/details/integration/os/buildroot/index.rst @@ -11,6 +11,7 @@ platforms on a single Linux-based development system. .. toctree:: + :class: toctree-1-deep :titlesonly: :maxdepth: 1 diff --git a/docs/src/details/integration/os/yocto/index.rst b/docs/src/details/integration/os/yocto/index.rst index f8cdf51e77..52dde202c7 100644 --- a/docs/src/details/integration/os/yocto/index.rst +++ b/docs/src/details/integration/os/yocto/index.rst @@ -18,6 +18,7 @@ concepts of Yocto and to help beginners to start with Yocto. .. toctree:: + :class: toctree-1-deep :titlesonly: :maxdepth: 1 diff --git a/docs/src/details/libs/index.rst b/docs/src/details/libs/index.rst index fb1a9dc0ae..5c482c5114 100644 --- a/docs/src/details/libs/index.rst +++ b/docs/src/details/libs/index.rst @@ -6,6 +6,7 @@ .. toctree:: + :class: toctree-1-deep :maxdepth: 1 arduino_esp_littlefs diff --git a/docs/src/details/widgets/index.rst b/docs/src/details/widgets/index.rst index 3162853245..317be86b1c 100644 --- a/docs/src/details/widgets/index.rst +++ b/docs/src/details/widgets/index.rst @@ -5,6 +5,7 @@ All Widgets =========== .. toctree:: + :class: toctree-1-deep :maxdepth: 1 base_widget @@ -12,6 +13,7 @@ All Widgets |hr_left_250| .. toctree:: + :class: toctree-1-deep :maxdepth: 1 3dtexture diff --git a/docs/src/index.rst b/docs/src/index.rst index 6331b119d8..37a4fe57cc 100644 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -58,6 +58,7 @@ Introduction ------------ .. toctree:: + :class: toctree-1-deep toctree-landing-page :maxdepth: 1 intro/introduction @@ -68,6 +69,7 @@ Details ------- .. toctree:: + :class: toctree-1-deep toctree-landing-page :maxdepth: 1 examples @@ -84,6 +86,7 @@ Appendix -------- .. toctree:: + :class: toctree-1-deep toctree-landing-page :maxdepth: 1 contributing/index diff --git a/docs/src/intro/index.rst b/docs/src/intro/index.rst deleted file mode 100644 index 300fba433f..0000000000 --- a/docs/src/intro/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. _intro-page: - -============ -Introduction -============ - -.. toctree:: - :maxdepth: 1 - - introduction - getting_started