Skip to content

Commit 1abede1

Browse files
committed
pages/docs revamp
1 parent d2d4936 commit 1abede1

File tree

75 files changed

+315
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+315
-168
lines changed

.github/workflows/docs.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/pages.yml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
1-
name: pages
1+
name: Pages
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: true
514
jobs:
6-
gh-pages:
15+
build:
716
runs-on: ubuntu-latest
817
steps:
9-
- uses: actions/checkout@v2
10-
- name: Install package and docs extras
11-
run: pip install .[all]
12-
- name: pylint badge
13-
run: |
14-
python -m pylint --disable=C0103 --output-format=text statmechcrack | tee pylint.log || pylint-exit $?
15-
PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.log)
16-
if (( $(echo "${PYLINT_SCORE} >= 8.0" | bc -l) )); then
17-
COLOR=brightgreen
18-
elif (( $(echo "${PYLINT_SCORE} >= 4.0" | bc -l) )); then
19-
COLOR=yellow
20-
elif (( $(echo "${PYLINT_SCORE} >= 2.0" | bc -l) )); then
21-
COLOR=orange
22-
else
23-
COLOR=red
24-
fi
25-
curl "https://img.shields.io/badge/Pylint-${PYLINT_SCORE}-${COLOR}?logo=python&logoColor=FBE072" -o pylint.svg
26-
- name: Build docs
27-
run: |
28-
sudo apt-get install pandoc
29-
source .github/workflows/docs.sh
30-
sphinx-build -b html source/ build/html/
31-
sed -i -e "s/ module</</g" build/html/*.html
32-
sed -i '/Built with/,/Docs<\/a>./d' build/html/*.html
33-
mv build/html/ ../public/
34-
mv ../pylint.svg ../public/
35-
- name: Deploy docs to gh-pages
36-
uses: peaceiris/actions-gh-pages@v3
18+
- uses: actions/checkout@v3
19+
- uses: actions/configure-pages@v3
20+
- uses: actions/jekyll-build-pages@v1
3721
with:
38-
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: public/
22+
source: ./pages/
23+
destination: ./_site
24+
- uses: actions/upload-pages-artifact@v1
25+
deploy:
26+
if: github.event_name != 'pull_request'
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
needs: build
32+
steps:
33+
- id: deployment
34+
uses: actions/deploy-pages@v1

.github/workflows/rtd.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
version: 2
22
build:
3-
os: ubuntu-20.04
3+
os: ubuntu-22.04
44
tools:
5-
python: "3.9"
6-
sphinx:
7-
configuration: docs/source/conf.py
8-
python:
9-
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
13-
- docs
5+
python: "3.11"
6+
commands:
7+
- pip install .[docs]
8+
- pip install -r docs/requirements.txt
9+
- cd docs/ && make html
10+
- mkdir _readthedocs/
11+
- mv docs/build/html/ _readthedocs/

README.rst

Lines changed: 2 additions & 5 deletions

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
2+
{% block breadcrumbs_aside %}
3+
<li class="wy-breadcrumbs-aside">
4+
<a style="text-decoration: none; padding: 0" href="https://github.com/sandialabs/statMechCrack">
5+
<iconify-icon icon="fa-brands:github" height="1.6em"></iconify-icon>
6+
</a>
7+
<a style="text-decoration: none; padding: 0" href="https://pypi.org/project/statmechcrack">
8+
<iconify-icon icon="simple-icons:pypi" height="1.6em"></iconify-icon>
9+
</a>
10+
<a style="text-decoration: none; padding: 0" href="https://anaconda.org/mrbuche/statmechcrack">
11+
<iconify-icon icon="simple-icons:anaconda" height="1.6em"></iconify-icon>
12+
</a>
13+
</li>
14+
{% endblock %}

docs/source/_templates/footer.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% extends "!footer.html" %}
2+
{%- block contentinfo %}
3+
{{ super }}
4+
<a href="http://sandia.gov/" rel="noopener noreferrer" target="_blank" style="text-decoration: none">
5+
<img alt="Sandia National Laboratories" longdesc="http://sandia.gov" src="https://raw.githubusercontent.com/sandialabs/Polymers/main/pages/assets/images/SNL_Horizontal_Black_Blue.png" style="height:37px">
6+
</a>
7+
&nbsp;
8+
<a href="http://energy.gov" rel="noopener noreferrer" target="_blank" style="text-decoration: none">
9+
<img alt="U.S. Department of Energy" longdesc="http://energy.gov" src="https://raw.githubusercontent.com/sandialabs/Polymers/main/pages/assets/images/New_DOE_Logo_Color.png" style="height:37px">
10+
</a>
11+
&nbsp;
12+
<a href="http://nnsa.energy.gov/" rel="noopener noreferrer" target="_blank" style="text-decoration: none">
13+
<img alt="National Nuclear Security Administration" longdesc="http://nnsa.gov" src="https://raw.githubusercontent.com/sandialabs/Polymers/main/pages/assets/images/NNSA Logo_Color.png" style="height:37px">
14+
</a>
15+
<br><br>
16+
<div style="font-size: 0.8em">
17+
Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-NA-0003525.
18+
</div>
19+
{% endblock %}

docs/source/_templates/layout.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{%- extends "sphinx_rtd_theme/layout.html" %}
2+
{%- block extrahead %}
3+
{{ super() }}
4+
<script src="https://code.iconify.design/iconify-icon/1.0.2/iconify-icon.min.js"></script>
5+
{% endblock %}

docs/conf.py renamed to docs/source/conf.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,33 @@ def get_version():
2424
LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, \
2525
the U.S. Government retains certain rights in this software'
2626

27-
templates_path = ['_templates']
28-
html_static_path = ['_static']
29-
html_css_files = ['custom.css']
30-
html_theme = 'sphinx_rtd_theme'
31-
html_theme_options = {'navigation_depth': 8}
27+
add_module_names = False
28+
bibtex_bibfiles = ['main.bib']
29+
bibtex_default_style = 'plain'
3230
extensions = [
33-
'sphinx_copybutton',
31+
'matplotlib.sphinxext.plot_directive',
32+
'nbsphinx',
3433
'sphinx.ext.autodoc',
3534
'sphinx.ext.napoleon',
3635
'sphinx.ext.viewcode',
37-
'matplotlib.sphinxext.plot_directive',
3836
'sphinxcontrib.bibtex',
39-
'nbsphinx',
37+
'sphinx_copybutton'
38+
]
39+
html_css_files = [
40+
'custom.css'
4041
]
4142
html_show_sphinx = False
43+
html_show_sourcelink = False
44+
html_static_path = ['_static']
45+
html_theme = 'sphinx_rtd_theme'
46+
html_theme_options = {
47+
'navigation_depth': 8
48+
}
4249
latex_engine = 'xelatex'
43-
bibtex_bibfiles = ['main.bib']
44-
bibtex_default_style = 'plain'
50+
nbsphinx_allow_errors = True
4551
plot_html_show_formats = False
4652
plot_html_show_source_link = False
4753
plot_include_source = True
48-
add_module_names = False
4954
plot_rcparams = {'font.size': 10}
5055
plot_formats = [('png', 300)]
51-
nbsphinx_allow_errors = True
56+
templates_path = ['_templates']
File renamed without changes.

docs/source/statmechcrack.core.rst

Lines changed: 18 additions & 0 deletions
Lines changed: 8 additions & 0 deletions
Lines changed: 8 additions & 0 deletions
Lines changed: 18 additions & 0 deletions

0 commit comments

Comments
 (0)