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

Convert website to Sphinx #263

Merged
merged 38 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ce38ab6
Use Sphinx for building
bryanwweber Jun 17, 2022
96a65d1
Add sphinx-design extension for Bootstrap support
bryanwweber Jun 19, 2022
eb4a718
Update dependencies and instructions
bryanwweber Mar 18, 2023
804e5fd
Formatting
bryanwweber Mar 18, 2023
a38b3da
add python 3.9 support for type hints
bryanwweber Apr 5, 2023
50f0f38
Update pdm and dependencies
bryanwweber Jul 2, 2023
bf7b1c4
More or less reproduce the home page
bryanwweber Jul 2, 2023
40ca92e
Some content reformatting
bryanwweber Jul 3, 2023
97a40dc
Bump api-docs submodule
speth Feb 25, 2024
aacb13d
Add tool for copying API docs into place
speth Feb 26, 2024
97918cf
Add header links to versioned sections and make styling more consistent
speth Feb 26, 2024
af0f35c
Ignore pdm.lock file
speth Feb 26, 2024
6c701e5
Delete content that was migrated to the Cantera/cantera repo
speth Feb 26, 2024
a2f7053
Delete Nikola plugin and theme files
speth Feb 26, 2024
2663431
Improve formatting of cards on homepage
speth Feb 27, 2024
f84d11b
Convert "Community" page to Markdown and update formatting
speth Feb 28, 2024
22fecba
Convert "affiliated" page to Markdown and update formatting
speth Feb 28, 2024
3d56a5e
Convert "Governance" page to Markdown and update formatting
speth Feb 28, 2024
0e3887b
Convert Dave Goodwin memorial page to Markdown and update formatting
speth Feb 29, 2024
27c9bfb
Use ABlog to handle news posts
speth Feb 29, 2024
f7c57dc
Clean up formatting of all news posts
speth Mar 2, 2024
4b44a66
Fix some warnings and display issues on index and community pages
speth Mar 4, 2024
5bcdf55
Redirect search to stable docs on most pages
speth Mar 7, 2024
7463476
Match style of navbar icons in current docs
speth Mar 7, 2024
bed0d03
Fix header links to stable docs from subdirectories
speth Mar 7, 2024
31c7e2a
Remove unused local Sphinx extensions
speth Mar 7, 2024
cffb509
Use updated favicon
speth Mar 8, 2024
cd6fc33
Add "assets" directory needed for legacy doc landing pages
speth Mar 8, 2024
d28d656
[CI] Update CI for Sphinx-built site
speth Dec 11, 2024
b137e7f
Read intersphinx inventories from cantera.org
speth Dec 12, 2024
c67d727
Configure PDM as an "application"
speth Dec 12, 2024
d1f8c2e
Remove obsolete use of api-docs repository
speth Dec 13, 2024
8c3c9bb
Merge branch 'main' into website-reformat-sphinx-myst
speth Dec 14, 2024
836d872
Increase minimum Python version to 3.10
speth Dec 14, 2024
d23216a
Log more from pdm
speth Dec 14, 2024
4c1d386
Fix pdm configuration
speth Dec 14, 2024
ac6da52
Fix Sphinx config issues
speth Dec 16, 2024
3892bc4
Don't set a misleading version number
speth Dec 16, 2024
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
84 changes: 19 additions & 65 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,83 +13,39 @@ on:
- testing

env:
NIKOLA_OUTPUT_DIR: output
WEBSITE_CLONE_DIR: website
SPHINX_OUTPUT_DIR: build/html
RSYNC_USER: "ctdeploy"
RSYNC_SERVER: "cantera.org"
DEPLOY: ${{ github.event_name == 'push' && github.repository_owner == 'Cantera' && (endswith(github.ref, 'main') || endsWith(github.ref, 'testing')) }}

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
name: Checkout the repository
with:
submodules: recursive
path: ${{ env.WEBSITE_CLONE_DIR }}
- uses: actions/checkout@v2
name: Checkout Cantera repository
with:
submodules: recursive
repository: Cantera/cantera
path: cantera
ref: "3.0"
- uses: actions/checkout@v2
name: Checkout Cantera 'main' repository
with:
submodules: recursive
repository: Cantera/cantera
path: cantera-dev
- uses: actions/checkout@v2
name: Checkout Cantera Jupyter repository
with:
repository: Cantera/cantera-jupyter
path: cantera-jupyter
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Upgrade pip
run: python3 -m pip install -U pip setuptools wheel
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(python3 -m pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install dependencies
run: python3 -m pip install -r requirements.txt
working-directory: ${{ env.WEBSITE_CLONE_DIR }}

# Parse SCons configuration for development version and move reST file
- name: Parse configuration options from Cantera SConstruct as reST
python-version: 3.13
- name: Install pdm
run: |
cd cantera-dev
python3 `which scons` help --restructured-text --dev --output=scons-config-options-dev.rst
cd ..
mv -f cantera-dev/scons-config-options-dev.rst ${{ env.WEBSITE_CLONE_DIR }}/pages/compiling/

python3 -m pip install pdm
pdm install --verbose
- name: Build the site
run: NIKOLA_DEBUG=1 nikola build
working-directory: ${{ env.WEBSITE_CLONE_DIR }}
run: pdm run build

# Create artifact containing output
- name: Create archive for website output
run: |
cd ${{ env.WEBSITE_CLONE_DIR }}; \
tar -czf website.tar.gz ${{ env.NIKOLA_OUTPUT_DIR }}
tar -czf website.tar.gz ${{ env.SPHINX_OUTPUT_DIR }}
- name: Store archive of website output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: ${{ env.WEBSITE_CLONE_DIR }}/website.tar.gz
retention-days: 5
path: website.tar.gz
retention-days: 14

# The known_hosts key is generated with `ssh-keygen -F cantera.org` from a
# machine that has previously logged in to cantera.org and trusts
Expand All @@ -106,17 +62,15 @@ jobs:
RSYNC_DEST: "cantera"
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable' \
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \
--filter='P /?.?' --filter='P /stable' \
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
- name: Upload the docs
if: env.DEPLOY == 'true' && endsWith(github.ref, 'testing')
env:
RSYNC_DEST: "testing.cantera.org"
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable' \
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /dev' \
--filter='P /?.?' --filter='P /stable' \
"${SPHINX_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
75 changes: 60 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Nikola directories
output/
cache/
.doit.db.*
.doit.db*

# CI Support
.ci_support/ctdeploy_key
/dev-docs
/dev-docs/
pdm.lock

# Byte-compiled / optimized / DLL files
__pycache__/
Expand All @@ -29,6 +24,7 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -47,14 +43,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -64,6 +63,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -76,16 +76,49 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# IPython
profile_default/
ipython_config.py

# celery beat schedule file
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm-python

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -111,9 +144,21 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# VS Code
.vscode/
# Cython debug symbols
cython_debug/

# macOS hidden files
*.DS_Store
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "api-docs"]
path = api-docs
url = https://github.com/Cantera/api-docs
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
hooks:
- id: mypy
# Override default --ignore-missing-imports
args: []
additional_dependencies:
- sphinx
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading