From 4aef8eecea9502a45571ab7563d3727bc334df61 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 28 Apr 2019 00:03:19 +1000 Subject: [PATCH] Force TOC to appear in sidebar for each page - https://stackoverflow.com/questions/18969093/how-to-include-the-toctree-in-the-sidebar-of-each-page#19007358 --- .gitignore | 2 -- docs/conf.py | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b4aa808107..6229f979df 100644 --- a/.gitignore +++ b/.gitignore @@ -29,8 +29,6 @@ local_settings.py # Sphinx files docs/_build -docs/_static -docs/_templates # Local media storage (only when running in development mode) InvenTree/media diff --git a/docs/conf.py b/docs/conf.py index 295dee688f..127f6abe22 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,6 +28,7 @@ copyright = '2019, InvenTree' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'autoapi.extension', ] @@ -37,6 +38,12 @@ napoleon_numpy_docstring = False autoapi_dirs = [ '../InvenTree', + '../Inventree/build', + '../InvenTree/company', + '../InvenTree/InvenTree', + '../InvenTree/part', + '../InvenTree/stock', + '../InvenTree/users', ] autoapi_options = [ @@ -60,7 +67,8 @@ autoapi_ignore = [ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +autoapi_template_dir = 'templates' + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -85,3 +93,11 @@ html_theme = 'sphinx_rtd_theme' # 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'] + +# Table of contents in sidebar +html_sidebars = {'**': [ + 'globaltoc.html', + 'relations.html', + 'sourcelink.html', + 'searchbox.html' +]} \ No newline at end of file