Skip to content

Commit

Permalink
ci: update documentation build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhart committed Nov 20, 2024
1 parent 98d57cc commit ab9dbe8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,15 @@ jobs:
run: |
python -m pip install -e .[formats]
git config set versionsort.suffix -rc
export SANSMIC_SPHINX_VERSION=${{ github.ref_name }}@`git rev-parse --short HEAD`
python build_docs.py
mkdir docs/_build
mkdir docs/_build/doxyxml
sphinx-build -b html docs/ out/
for TAG in `git tag --list --sort=-version:refname`
for TAG in `git tag --list "v*.*.*" --sort=-version:refname`
do
python -m pip uninstall -y sansmic
rm -rf docs/_build/doxyxml docs/apidocs/*
export SANSMIC_SPHINX_VERSION=$TAG
export VERSION_INFO=$TAG
mkdir docs/_build/doxyxml
git checkout -f $TAG
if [ -f "docs/requirements.txt" ]; then
python -m pip install --force-reinstall -r docs/requirements.txt
fi
python -m pip install -e .[docs]
sphinx-build -Q -b html docs/ out/$TAG
git clone --depth=1 --tag=$TAG https://github.com/sandialabs/sansmic-docs.git out/$TAG
rm -rf ./out/$TAG/.git
done
- name: Upload artifact
Expand Down
4 changes: 2 additions & 2 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
tags = git_tag.stdout.splitlines()
versions = [
{
"name": "main",
"version": "main",
"name": os.environ.get("SANSMIC_SPHINX_VERSION", "main"),
"version": os.environ.get("SANSMIC_SPHINX_VERSION", "main"),
"url": "https://sandialabs.github.io/sansmic/",
"preferred": False,
}
Expand Down
9 changes: 3 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@
##############################################################################
# Builder options #
##############################################################################

# -- Options for HTML output -------------------------------------------------
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
Expand All @@ -218,10 +217,6 @@
]
# html_sidebars = {"nomenclature": []}
html_theme_options = {
"logo": {
"image_light": "_static/logo-light.png",
"image_dark": "_static/logo-dark.png",
},
"icon_links": [
{
"name": "GitHub", # Label for this link
Expand All @@ -248,7 +243,9 @@
"show_toc_level": 2,
"switcher": {
"json_url": "https://sandialabs.github.io/sansmic/_static/switcher.json",
"version_match": version,
"version_match": "v" + version
if len(version) > 0 and version[0].isdigit()
else version,
},
# "secondary_sidebar_items": ["page-toc"], #["page-toc", "edit-this-page", "sourcelink"],
"navbar_start": [
Expand Down

0 comments on commit ab9dbe8

Please sign in to comment.