From c93e2f03890c5342ba48b9d19516b6648c9fe0d4 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Tue, 15 Oct 2024 12:36:29 -0700 Subject: [PATCH] ci(docs): Clean up and improve the docs --- docs/_static/custom.css | 67 +++++++++++++++++++++++-------------- docs/_templates/layout.html | 1 + docs/cli/index.rst | 42 +++++++++++++++++++++++ docs/conf.py | 22 ++++-------- docs/index.rst | 2 ++ docs/modules.rst | 4 +-- 6 files changed, 95 insertions(+), 43 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 8f859dd5..960ce736 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -5,44 +5,61 @@ * Sphinx stylesheet -- Bootstrap theme. */ +/* Overwrite colors */ +div.navbar-inverse { + background-color: #04A54F; + border-color: #04A54F; +} +a { + color: #04A54F; +} +a:visited { + color: #04A54F; +} +code { + color: #04A54F; +} +div.bs-sidenav a { + color: #333333; +} -/* The code below is based on the bootstrap website sidebar */ +/* Prevent top nav from blocking docs */ +div.navbar-fixed-top { + position: absolute; +} +/* Indent the side nav when in mobile mode */ +@media screen and (min-width: 0px) { + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } +} -/* Show and affix the side nav when space allows it */ +/* Widen and de-indent the side nav when space is restricted */ @media screen and (min-width: 992px) { .bs-sidenav .nav > .active > ul { display: block; } div.bs-sidenav ul { margin-bottom: 0; - padding-left: 5px; + padding-left: 0px; list-style: none; } - div.bs-sidenav a { - color: #333333; - } - /* Widen the fixed sidenav */ - .bs-sidenav.affix, - .bs-sidenav.affix-bottom { - width: 292px; - } - .bs-sidenav.affix { - position: fixed; /* Undo the static from mobile first approach */ - } - .bs-sidenav.affix-bottom { - position: absolute; /* Undo the static from mobile first approach */ - } - .bs-sidenav.affix-bottom .bs-sidenav, - .bs-sidenav.affix .bs-sidenav { - margin-top: 0; - margin-bottom: 0; + .bs-sidenav { + width: 300px; } } + +/* Slightly indent the side nav when space allows it */ @media screen and (min-width: 1200px) { - /* Widen the fixed sidenav again */ - .bs-sidenav.affix-bottom, - .bs-sidenav.affix { - width: 360px; + div.bs-sidenav ul { + margin-bottom: 0; + padding-left: 5px; + list-style: none; + } + .bs-sidenav { + width: 370px; } } diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index 8d6389d4..24fec4e9 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -48,6 +48,7 @@ {% endif %} {%- block extrahead %} + diff --git a/docs/cli/index.rst b/docs/cli/index.rst index 601f06d9..3893709d 100644 --- a/docs/cli/index.rst +++ b/docs/cli/index.rst @@ -6,3 +6,45 @@ Installation To check if the Dragonfly command line interface is installed correctly use ``dragonfly viz`` and you should get a ``viiiiiiiiiiiiizzzzzzzzz!`` back in response! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Commands +-------- +.. toctree:: + :maxdepth: 1 + + create + edit + translate + validate diff --git a/docs/conf.py b/docs/conf.py index 6cd8201b..4a4948ca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,10 @@ import os import sys import datetime + +# The theme to use for HTML and HTML Help pages +import sphinx_bootstrap_theme + now = datetime.datetime.now() sys.path.insert(0, os.path.abspath('..')) @@ -70,7 +74,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -83,11 +87,6 @@ # -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -import sphinx_bootstrap_theme - # html_theme = 'alabaster' html_theme = 'bootstrap' html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() @@ -124,6 +123,7 @@ # 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'] +html_css_files = ['custom.css'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -466,13 +466,3 @@ def update_cli_index(index_path, group_filenames): create_cli_files() # ----------------------------------------------------------------------------- - - -def setup(app): - """Run custom code with access to the Sphinx application object - Args: - app: the Sphinx application object - """ - - # Add bootstrap theme custom stylesheet - app.add_stylesheet("custom.css") diff --git a/docs/index.rst b/docs/index.rst index ca8fc687..8311b971 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,6 +29,8 @@ extension's documentation page. Here are a number of popular Dragonfly extensions: - `dragonfly-energy `_ +- `dragonfly-radiance `_ +- `dragonfly-uwg `_ CLI Docs diff --git a/docs/modules.rst b/docs/modules.rst index 4d66a94c..c025c661 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -1,5 +1,5 @@ -dragonfly-core -================= +dragonfly +========= .. toctree:: :maxdepth: 4