From de42dd4a93a9f8c42007fced7ee9853ba1db5c3c Mon Sep 17 00:00:00 2001 From: EstherLerouzic Date: Tue, 11 Feb 2025 11:27:25 +0100 Subject: [PATCH] fix: restore rtd theme and fix the table with the custom css Signed-off-by: EstherLerouzic Change-Id: Ib16c08451aa3faaa06ea85c2b9359fc4e7a015da --- docs/_static/custom.css | 4 ++++ docs/conf.py | 21 +++++++++++++++++++-- setup.cfg | 5 +++-- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 docs/_static/custom.css diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 00000000..359310f2 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,4 @@ + +.wy-table-responsive table td, .wy-table-responsive table th { + white-space: normal; +} diff --git a/docs/conf.py b/docs/conf.py index b20001c6..56dfc9b8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,7 @@ # import os import sys + sys.path.insert(0, os.path.abspath('../')) # -- General configuration ------------------------------------------------ @@ -36,6 +37,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.bibtex', 'sphinx.ext.graphviz', 'myst_parser', + 'sphinx_rtd_theme', ] myst_enable_extensions = [ @@ -84,11 +86,22 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = "sphinx_rtd_theme" html_theme_options = { 'logo': 'images/GNPy-logo.png', 'logo_name': False, + 'prev_next_buttons_location': 'bottom', + # Toc options + 'collapse_navigation': True, + 'sticky_navigation': True, + 'navigation_depth': 4, + 'includehidden': True, + 'titles_only': False } +html_theme_options = { + 'navigation_depth': 4, +} +html_favicon = 'images/GNPy-logo.png' html_logo = 'images/GNPy-logo.png' @@ -101,7 +114,10 @@ html_logo = 'images/GNPy-logo.png' # 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 = [] +html_static_path = ['_static'] +html_css_files = [ + 'custom.css', # Inclure votre fichier CSS personnalisé +] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -118,6 +134,7 @@ html_sidebars = { ] } +html_secnum_depth = 4 # -- Options for HTMLHelp output ------------------------------------------ diff --git a/setup.cfg b/setup.cfg index 8069c3bb..9ded0ee6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -76,8 +76,9 @@ tests = docs = alabaster>=0.7.12,<1 docutils>=0.17.1,<1 - myst-parser>=0.16.1,<1 + myst-parser>=4.0.1,<5 Pygments>=2.11.2,<3 rstcheck - Sphinx>=5.3.0,<6 + Sphinx>=8.1.3,<9 sphinxcontrib-bibtex>=2.4.1,<3 + sphinx_rtd_theme>=3.0.2,<4