From 9c2183f299bac2bb2e8f345ac9f56d7e36771712 Mon Sep 17 00:00:00 2001 From: mmckerns Date: Wed, 5 Jul 2023 02:13:14 -0400 Subject: [PATCH] non-rtf docs use globaltoc and css --- docs/source/_static/css/custom.css | 4 ++++ docs/source/conf.py | 12 ++++++++---- docs/source/index.rst | 9 +++++---- 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 docs/source/_static/css/custom.css diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css new file mode 100644 index 00000000..eff0b8e0 --- /dev/null +++ b/docs/source/_static/css/custom.css @@ -0,0 +1,4 @@ +div.sphinxsidebar { + height: 100%; /* 100vh */ + overflow: auto; /* overflow-y */ +} diff --git a/docs/source/conf.py b/docs/source/conf.py index 6b1fc067..d625cfdc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -133,6 +133,7 @@ # if not on_rtd: html_theme = 'alabaster' #'bizstyle' + html_css_files = ['css/custom.css',] #import sphinx_rtd_theme #html_theme = 'sphinx_rtd_theme' #html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] @@ -152,6 +153,8 @@ 'gratipay_user': False, # username 'extra_nav_links': {'Module Index': 'py-modindex.html'}, # 'show_related': True, +# 'globaltoc_collapse': True, + 'globaltoc_maxdepth': 4, 'show_powered_by': False } @@ -165,19 +168,20 @@ # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -#if html_theme == 'alabaster': +if on_rtd: + toc_style = 'localtoc.html', # display the toctree +else: + toc_style = 'globaltoc.html', # collapse the toctree html_sidebars = { '**': [ 'about.html', 'donate.html', 'searchbox.html', # 'navigation.html', - 'localtoc.html', # display the toctree + toc_style, # defined above 'relations.html', # needs 'show_related':True option to display ] } -#FIXME: donate / UQFoundation (home/github) - # -- Options for HTMLHelp output ------------------------------------------ diff --git a/docs/source/index.rst b/docs/source/index.rst index b4f534a8..5e975998 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,16 +3,17 @@ dill package documentation ========================== -.. automodule:: dill -.. :exclude-members: + - .. toctree:: + :hidden: :maxdepth: 2 - :caption: Contents: + self dill scripts +.. automodule:: dill +.. :exclude-members: + + Indices and tables ==================