Skip to content

Commit

Permalink
chore: reformat conf.py and add monkeypatch css to fix properties to …
Browse files Browse the repository at this point in the history
…appear on individual line as per readthedocs/sphinx_rtd_theme#1301
  • Loading branch information
abhilash-kumar-nair committed Apr 25, 2024
1 parent fb0518e commit 0eeba40
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
7 changes: 7 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Fix for horizontal stacking weirdness in the RTD theme with Python properties:
https://github.com/readthedocs/sphinx_rtd_theme/issues/1301
*/
.py.property {
display: block !important;
}
41 changes: 21 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@

import sphinx_rtd_theme

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath("../.."))

# -- Project information -----------------------------------------------------

project = 'Modelon-impact-client'
copyright = '2020, Modelon'
author = 'Modelon'
project = "Modelon-impact-client"
copyright = "2020, Modelon"
author = "Modelon"

# The full version, including alpha/beta/rc tags
# TODO : Need to ensure version number is set correctly with the release bot.
release = '1.0.0'
master_doc = 'index'
release = "1.0.0"
master_doc = "index"

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx_rtd_theme",
'sphinx_copybutton',
'sphinx.ext.autosectionlabel',
'sphinx.ext.napoleon',
'sphinxcontrib.spelling',
'sphinx_search.extension',
'sphinx_autodoc_typehints',
"sphinx_copybutton",
"sphinx.ext.autosectionlabel",
"sphinx.ext.napoleon",
"sphinxcontrib.spelling",
"sphinx_search.extension",
"sphinx_autodoc_typehints",
]

add_module_names = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -61,17 +61,17 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

html_theme_options = {
'style_nav_header_background': '#fb8c00',
"style_nav_header_background": "#fb8c00",
}

# The wordlist with known words, like Jupyterlab
spelling_word_list_filename = "spelling_wordlist.txt"
spelling_show_suggestions = True
spelling_ignore_acronyms = True
spelling_exclude_patterns = ['modelon.*']
spelling_exclude_patterns = ["modelon.*"]

# Enable google style docstrings
napoleon_google_docstring = True
Expand All @@ -80,8 +80,9 @@
# 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"]

suppress_warnings = [
'autosectionlabel.*'
"autosectionlabel.*"
] # See https://github.com/sphinx-doc/sphinx/issues/7697

0 comments on commit 0eeba40

Please sign in to comment.