From 57146e1b357877c027d5e7efb94ec67603a71c4d Mon Sep 17 00:00:00 2001 From: Johanna England Date: Thu, 22 Feb 2024 15:02:22 +0100 Subject: [PATCH] Use readthedocs sphinx theme instead of bootstrap --- doc/_static/custom.css | 8 +++-- doc/conf.py | 73 +++++++++++++----------------------------- doc/requirements.txt | 2 +- 3 files changed, 28 insertions(+), 55 deletions(-) diff --git a/doc/_static/custom.css b/doc/_static/custom.css index 715290c0d7..5fe1d2ba57 100644 --- a/doc/_static/custom.css +++ b/doc/_static/custom.css @@ -1,9 +1,11 @@ /* Custom css for the Sphinx theme in NAV */ -a { color: #1f74ad; } -a:hover, a:focus { color: #1f74ad; } -.alert a, .alert .alert-link { color: #1f74ad; } +a, a:hover, a:focus, .alert a, .alert .alert-link { color: #ecf0f1; } +a:visited {color: initial;} +blockquote { + background: #ecf0f1; +} img { margin-bottom: 1em; diff --git a/doc/conf.py b/doc/conf.py index 539233f2b8..7781f8fa9b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -10,7 +10,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. -import sphinx_bootstrap_theme +import sphinx_rtd_theme import sys, os # If extensions (or modules to document with autodoc) are in another directory, @@ -52,7 +52,7 @@ # General information about the project. project = u'NAV' -copyright = u'2012-2021 Uninett AS, 2022-2023 Sikt' +copyright = u'2012-2021 Uninett AS, 2022-2024 Sikt' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -106,7 +106,7 @@ # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'bootstrap' +html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom themes here, relative to this directory. html_theme_path = [ @@ -119,53 +119,18 @@ # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - # Navigation bar title. (Default: ``project`` value) - 'navbar_title': " ", - # Tab name for entire site. (Default: "Site") - 'navbar_site_name': "Contents", - # A list of tuples containing pages or urls to link to. - # Valid tuples should be in the following forms: - # (name, page) # a link to a page - # (name, "/aa/bb", 1) # a link to an arbitrary relative url - # (name, "http://example.com", True) # arbitrary absolute url - # Note the "1" or "True" value above as the third argument to indicate - # an arbitrary url. - #'navbar_links': [ - # ("Examples", "examples"), - # ("Link", "http://example.com", True), - # ], - # Render the next and previous page links in navbar. (Default: true) - 'navbar_sidebarrel': True, - # Render the current pages TOC in the navbar. (Default: true) - 'navbar_pagenav': True, - # Global TOC depth for "site" navbar tab. (Default: 1) - # Switching to -1 shows all levels. - 'globaltoc_depth': 2, - # Include hidden TOCs in Site navbar? - # - # Note: If this is "false", you cannot have mixed ``:hidden:`` and - # non-hidden ``toctree`` directives in the same page, or else the build - # will break. - # - # Values: "true" (default) or "false" - 'globaltoc_includehidden': "true", - # HTML navbar class (Default: "navbar") to attach to
element. - # For black navbar, do "navbar navbar-inverse" - 'navbar_class': "navbar", - # Fix navigation bar to top of page? - # Values: "true" (default) or "false" - 'navbar_fixed_top': "true", - # Location of link to source. - # Options are "nav" (default), "footer" or anything else to exclude. - 'source_link_position': "navbar-brand", - # Bootswatch (http://bootswatch.com/) theme. - # - # Options are nothing with "" (default) or the name of a valid theme - # such as "amelia" or "cosmo". - 'bootswatch_theme': "flatly", - # Choose Bootstrap version. - # Values: "3" (default) or "2" (in quotes) - 'bootstrap_version': "3", + # The maximum depth of the table of contents tree. Set this to -1 to allow + # unlimited depth. + 'navigation_depth': 4, + # Only display the logo image, do not display the project name at the top of the + # sidebar + 'logo_only': True, + # Location to display Next and Previous buttons. This can be either bottom, top, + # both, or None. + 'prev_next_buttons_location': 'both', + # Changes the background of the search area in the navigation bar. The value can be + # anything valid in a CSS background property. + 'style_nav_header_background': '#2c3e50', } @@ -190,6 +155,12 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# These paths are either relative to html_static_path +# or fully qualified paths (eg. https://...) +html_css_files = [ + 'custom.css', +] + # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' @@ -215,7 +186,7 @@ # html_split_index = False # If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True +html_show_sourcelink = False # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the diff --git a/doc/requirements.txt b/doc/requirements.txt index 0ada17a9cc..f4c69f36dc 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,4 @@ -r ../requirements/django32.txt -r ../requirements/base.txt -c ../constraints.txt -sphinx-bootstrap-theme==0.8.1 +sphinx_rtd_theme>=2.0.0 \ No newline at end of file