Skip to content

Commit

Permalink
ci(docs): Clean up and improve the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Oct 15, 2024
1 parent 1867f5c commit c93e2f0
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 43 deletions.
67 changes: 42 additions & 25 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
1 change: 1 addition & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{% endif %}

{%- block extrahead %}
<link rel="icon" type="image/x-icon" href="https://github.com/ladybug-tools/artwork/raw/refs/heads/master/icons_bugs/ico/dragonfly.ico">
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
Expand Down
42 changes: 42 additions & 0 deletions docs/cli/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 6 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('..'))

Expand Down Expand Up @@ -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.
Expand All @@ -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()
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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")
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extension's documentation page.
Here are a number of popular Dragonfly extensions:

- `dragonfly-energy <https://ladybug.tools/dragonfly-energy/docs>`_
- `dragonfly-radiance <https://ladybug.tools/dragonfly-radiance/docs>`_
- `dragonfly-uwg <https://ladybug.tools/dragonfly-uwg/docs>`_


CLI Docs
Expand Down
4 changes: 2 additions & 2 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dragonfly-core
=================
dragonfly
=========

.. toctree::
:maxdepth: 4
Expand Down

0 comments on commit c93e2f0

Please sign in to comment.