From 266b8d90d69b0217e551fb62a7c094c1d3fb6945 Mon Sep 17 00:00:00 2001 From: Li Yin Date: Sun, 19 May 2024 14:04:35 -0700 Subject: [PATCH] made the sidebar stable while clicking around --- docs/Makefile | 4 ++-- docs/source/conf.py | 14 +++++++++++++- docs/source/index.rst | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 1478681e..4ace77c5 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -23,9 +23,9 @@ help: apidoc: @echo "Running sphinx-apidoc for core" - @sphinx-apidoc -o $(APIDOCOUTDIR)/core ../core --separate + @sphinx-apidoc -o $(APIDOCOUTDIR)/core ../core --separate --force --module-first @echo "Running sphinx-apidoc for components" - @sphinx-apidoc -o $(APIDOCOUTDIR)/components ../components --separate + @sphinx-apidoc -o $(APIDOCOUTDIR)/components ../components --separate --force --module-first diff --git a/docs/source/conf.py b/docs/source/conf.py index 2ad5b33e..acbcd177 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -68,12 +68,24 @@ # html_theme = 'alabaster' html_theme = "sphinx_rtd_theme" - +# These options are for the sphinx_rtd_theme +html_theme_options = { + "collapse_navigation": False, + "sticky_navigation": True, # Ensures the sidebar stays at the top of the page + "navigation_depth": 4, # Controls how many headers are shown in the sidebar + "includehidden": True, + "titles_only": False, +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] + +def setup(app): + app.add_css_file("custom.css") # Add custom CSS file to the Sphinx configuration + + # In Sphinx documentation, the configuration option add_module_names in the conf.py file controls # whether module names are prefixed before object names in the documentation. This setting is particularly # relevant when documenting Python modules and their contents, such as classes, functions, and methods. diff --git a/docs/source/index.rst b/docs/source/index.rst index 9f198db4..634e658e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -50,8 +50,8 @@ LightRAG comes from the best of the AI research and engineering. Fundamentally, :maxdepth: 1 :caption: API Reference - apis/core/modules - apis/components/modules + apis/core/core + apis/components/components .. toctree::