Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update landing page and build script #116

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,27 @@ jobs:
- name: Build documentation
run: |
python -m pip install -e .[formats]
sphinx-build -b html docs/ docs/_build/html
git config set versionsort.suffix -rc
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`
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 $TAG
python -m pip install --no-deps -e .
sphinx-build -b html docs/ out/releases/$TAG
done

- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: 'docs/_build/html'
path: 'out/'

deploy:
name: Deploy documentation to GitHub Pages
Expand Down
48 changes: 24 additions & 24 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
my_env = os.environ.copy()

git_tag = subprocess.run(
" ".join(["git", "tag", "--list", "v*.*.*", "--sort=version:refname"]),
" ".join(["git", "tag", "--list", "v*.*.*", "--sort=-version:refname"]),
capture_output=True,
text=True,
shell=True,
Expand All @@ -20,7 +20,7 @@
tags = git_tag.stdout.splitlines()
versions = [
{
"name": "main branch",
"name": "stable",
"version": "main",
"url": "https://sandialabs.github.io/sansmic/",
"preferred": False,
Expand All @@ -39,34 +39,34 @@
dict(
name=tag,
version=tag,
url="https://sandialabs.github.io/sansmic/" + tag + "/",
url="https://sandialabs.github.io/sansmic/releases/" + tag + "/",
preferred=latest,
)
)

with open(
os.path.abspath(os.path.join(".", "pages", "_static", "switcher.json")),
os.path.abspath(os.path.join(".", "docs", "_static", "switcher.json")),
"w",
) as fswitch:
json.dump(versions, fswitch)

for tag in tags:
os.environ["VERSION_INFO"] = repr(tag)
my_env["SANSMIC_SPHINX_VERSION"] = tag
files = glob.glob("./docs/apidocs/*.rst")
for f in files:
os.remove(f)
subprocess.run("git checkout " + tag, shell=True)
subprocess.run(
" ".join(
[
"sphinx-build",
"-b",
"html",
"docs/",
"pages/" + tag,
]
),
shell=True,
env=my_env,
)
# for tag in tags:
# os.environ["VERSION_INFO"] = repr(tag)
# my_env["SANSMIC_SPHINX_VERSION"] = tag
# files = glob.glob("./docs/apidocs/*.rst")
# for f in files:
# os.remove(f)
# subprocess.run("git checkout " + tag, shell=True)
# subprocess.run(
# " ".join(
# [
# "sphinx-build",
# "-b",
# "html",
# "docs/",
# "out/v/" + tag,
# ]
# ),
# shell=True,
# env=my_env,
# )
16 changes: 16 additions & 0 deletions docs/_static/pypi-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@
# -- Options for HTML output -------------------------------------------------
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_js_files = [
"pypi-icon.js",
]
# html_sidebars = {"nomenclature": []}
html_theme_options = {
"logo": {
Expand All @@ -226,9 +229,15 @@
"type": "fontawesome", # The type of image to be used
"icon": "fa-brands fa-github", # Icon class (if "type": "fontawesome"), or path to local image (if "type": "local")
},
{
"name": "PyPI", # Label for this link
"url": "https://pypi.org/project/sansmic/", # required URL where the link will redirect
"type": "fontawesome", # The type of image to be used
"icon": "fa-custom fa-pypi", # Icon class (if "type": "fontawesome"), or path to local image (if "type": "local")
},
{
"name": "Sandia National Laboratories",
"url": "https://sandia.gov", # required
"url": "https://www.sandia.gov", # required
"type": "local",
"icon": "_static/snl_logo.png",
},
Expand Down
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ exchanges, sales, remediations, and the original construction.
Citing sansmic
--------------

If you use sansmic for a publication, please use the following citation:

* Hart, David, & Zeitler, Todd, & Maurer, Hannah. (2024). *SANSMIC v.1.0*. [Computer software].
https://github.com/sandialabs/sansmic.
https://doi.org/10.11578/dc.20240911.9

The list of current contributors is located in the ``AUTHORS.md`` file.



Indices and tables
Expand Down