Skip to content

Commit

Permalink
Style progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark2000 committed Dec 28, 2023
1 parent 7390f30 commit abdb9da
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 9 deletions.
8 changes: 8 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs:
# rm -rf source/apidoc docs/_build
sphinx-apidoc -fMeT -o source/apidoc ../src/bsk_rl
for f in source/apidoc/*.rst; do\
./apidoc_format.sh $$f ;\
done
$(MAKE) html
21 changes: 21 additions & 0 deletions docs/apidoc_format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
for file in "$@"; do
# Check if file exists
if [ -f "$file" ]; then
# Get the first line of the file
body=$(tail -n +3 "$file")
first_line=$(head -n 1 "$file")
package_loc=$(echo "$first_line" | sed -E 's/( module| package)$//')
page_title="${package_loc##*.}"
echo "TITLE" "$page_title"

# Update the file with the modified first line
echo $page_title > $file
echo $(printf '=%.0s' $(seq 1 ${#page_title})) >> $file
echo "\`$package_loc\`" >> $file
echo "$body" >> $file

echo "Processed $file"
else
echo "File '$file' does not exist."
fi
done
34 changes: 30 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import datetime

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys

#sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "src")))
# sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "src")))
now = datetime.datetime.now()

project = "bsk_rl"
copyright = "2023, Mark Stephenson"
copyright = str(now.year) + ", Autonomous Vehicle Systems (AVS) Laboratory"
author = "Mark Stephenson"
release = "0.0.0"

Expand All @@ -25,17 +28,40 @@
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
]

templates_path = ["_templates"]
exclude_patterns = []

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_theme_options = {
"style_nav_header_background": "#CFB87C",
"navigation_depth": -1,
}
html_static_path = ["_static"]
html_css_files = ["custom.css"]
# html_css_files = ["custom.css"]
html_logo = "./_images/static/Basilisk-Logo.png"

add_module_names = False


def skip(app, what, name, obj, would_skip, options):
if name == "__init__":
return False
return would_skip


add_module_names = False
def setup(app):
app.connect("autodoc-skip-member", skip)
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ Check out the :doc:`usage` section for further information.
.. toctree::
:maxdepth: 2
:caption: Contents:
:titlesonly:

documentation/modules
apidoc/bsk_rl


Indices and tables
Expand Down
5 changes: 1 addition & 4 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Usage
=====

Installation
------------
============

.. note::
To use Lumache, bsk_rl, Basilisk must be installed first. You can find instructions on how to do so
Expand Down

0 comments on commit abdb9da

Please sign in to comment.