-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
454 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: BiRD-documentation | ||
|
||
on: | ||
push: | ||
branches: [ sphinx ] | ||
paths: | ||
- 'docs/**' | ||
- '.github/workflows/docs_pages.yml' | ||
|
||
jobs: | ||
|
||
build_docs: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.10 | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install sphinx sphinx_rtd_theme sphinx-autoapi | ||
- name: Build documentation | ||
run: | | ||
cd docs | ||
make html | ||
- name: deploy | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/_build/html | ||
force_orphan: true | ||
full_commit_message: ${{ github.event.head_commit.message }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
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 | ||
rm -rf _build | ||
rm -rf source/_autosummary | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
github: html | ||
-git branch -D gh-pages | ||
-git push origin --delete gh-pages | ||
ghp-import -n -b gh-pages -m "Update documentation" ./_build/html | ||
git checkout gh-pages | ||
git push --set-upstream origin gh-pages | ||
git checkout ${BRANCH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=_build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% extends "!layout.html" %} | ||
|
||
{% block menu %} | ||
{{ super() }} | ||
<p class="caption"> | ||
<span class="caption-text">Indices</span> | ||
</p> | ||
<ul> | ||
<li class="toctree-l1"><a href= "{{pathto('genindex.html', 1)}}">Everything</a></li> | ||
<li class="toctree-l1"><a href= "{{pathto('py-modindex.html', 1)}}">Module Index</a></li> | ||
</ul> | ||
|
||
{% if menu_links %} | ||
<p class="caption"> | ||
<span class="caption-text">External links</span> | ||
</p> | ||
<ul> | ||
{% for text, link in menu_links %} | ||
<li class="toctree-l1"><a href="{{ link }}">{{ text }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block htmltitle %} | ||
{% if title == '' or title == 'Home' %} | ||
<title>{{ docstitle|e }}</title> | ||
{% else %} | ||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{%- macro automodule(modname, options) -%} | ||
.. automodule:: {{ modname }} | ||
{%- for option in options %} | ||
:{{ option }}: | ||
{%- endfor %} | ||
{%- endmacro %} | ||
|
||
{%- macro toctree(docnames) -%} | ||
.. toctree:: | ||
:maxdepth: {{ maxdepth }} | ||
{% for docname in docnames %} | ||
{{ docname }} | ||
{%- endfor %} | ||
{%- endmacro %} | ||
|
||
{%- if is_namespace %} | ||
{{- [pkgname, "namespace"] | join(" ") | e | heading }} | ||
{% else %} | ||
{{- [pkgname, "package"] | join(" ") | e | heading }} | ||
{% endif %} | ||
|
||
{%- if is_namespace %} | ||
.. py:module:: {{ pkgname }} | ||
{% endif %} | ||
|
||
{%- if modulefirst and not is_namespace %} | ||
{{ automodule(pkgname, automodule_options) }} | ||
{% endif %} | ||
|
||
{%- if subpackages %} | ||
Subpackages | ||
----------- | ||
|
||
{{ toctree(subpackages) }} | ||
{% endif %} | ||
|
||
{%- if submodules %} | ||
Submodules | ||
---------- | ||
{% if separatemodules %} | ||
{{ toctree(submodules) }} | ||
{% else %} | ||
{%- for submodule in submodules %} | ||
{% if show_headings %} | ||
{{- [submodule, "module"] | join(" ") | e | heading(2) }} | ||
{% endif %} | ||
{{ automodule(submodule, automodule_options) }} | ||
{% endfor %} | ||
{%- endif %} | ||
{%- endif %} | ||
|
||
# https://github.com/sphinx-doc/sphinx/blob/master/sphinx/templates/apidoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Quick start | ||
===== | ||
|
||
|
||
.. _installation: | ||
|
||
Installation | ||
------------ | ||
|
||
To use the functions include this import: | ||
|
||
.. code-block:: console | ||
import bird | ||
Examples | ||
---------------- | ||
|
||
For example: | ||
|
||
>>> import bird | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
import os | ||
import sys | ||
# Need this so sphinx can find lumache.py. Change is .py files are elsewhere than root. | ||
sys.path.insert(0, os.path.abspath('../..')) | ||
sys.path.insert(0, os.path.abspath('../../bird')) | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
with open(os.path.join(here, '..', '..', "bird", "version.py"), encoding="utf-8") as f: | ||
version = f.read() | ||
version = version.split("=")[-1].strip().strip('"').strip("'") | ||
|
||
# -- Project information | ||
|
||
project = "Bio Reactor Design (BiRD)" | ||
copyright = '2024' | ||
author = 'NREL' | ||
|
||
release = version | ||
version = version | ||
|
||
# -- General configuration | ||
|
||
extensions = [ | ||
'sphinx.ext.duration', | ||
'sphinx.ext.doctest', | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.autosummary', | ||
'sphinx.ext.intersphinx', | ||
# 'autoapi.extension', | ||
# 'sphinxcontrib.apidoc', | ||
] | ||
|
||
#autoapi_type = 'python' | ||
#autoapi_dirs = ['../../bird'] | ||
|
||
#apidoc_module_dir = '../../src' | ||
#apidoc_output_dir = '.' | ||
#apidoc_excluded_paths = ['tests'] | ||
#apidoc_separate_modules = True | ||
|
||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3/', None), | ||
'sphinx': ('https://www.sphinx-doc.org/en/master/', None), | ||
} | ||
intersphinx_disabled_domains = ['std'] | ||
|
||
templates_path = ['_templates'] | ||
|
||
# -- Options for HTML output | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
|
||
# -- Options for EPUB output | ||
epub_show_urls = 'footnote' | ||
|
||
html_context = { | ||
"display_github": True, # Integrate GitHub | ||
"github_repo": "NREL/BioReactorDesign", # Repo name | ||
"github_version": "main", # Version | ||
"conf_py_path": "docs/source/", # Path in the checkout to the docs root | ||
} | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
html_short_title = "bird-doc" | ||
html_show_sourcelink = False | ||
html_show_sphinx = True | ||
html_show_copyright = True | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
repository_url = f"https://github.com/NREL/BioReactorDesign" | ||
html_context = { | ||
"menu_links": [ | ||
( | ||
'<i class="fa fa-github fa-fw"></i> Source Code', | ||
repository_url, | ||
), | ||
( | ||
'<i class="fa fa-book fa-fw"></i> License', | ||
f"{repository_url}/blob/main/LICENSE", | ||
), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Quick start | ||
===== | ||
|
||
|
||
.. _installation: | ||
|
||
Installation | ||
------------ | ||
|
||
To use the functions include this import: | ||
|
||
.. code-block:: console | ||
import bird | ||
Examples | ||
---------------- | ||
|
||
For example: | ||
|
||
>>> import bird | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Bio Reactor Design (BiRD) | ||
=================================== | ||
|
||
`BiRD` is ... | ||
|
||
.. note:: | ||
|
||
This project is under active development. | ||
|
||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
quickstart | ||
meshing | ||
preprocess | ||
postprocess | ||
contribute | ||
references | ||
acknowledgments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Quick start | ||
===== | ||
|
||
|
||
.. _installation: | ||
|
||
Installation | ||
------------ | ||
|
||
To use the functions include this import: | ||
|
||
.. code-block:: console | ||
import bird | ||
Examples | ||
---------------- | ||
|
||
For example: | ||
|
||
>>> import bird | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Quick start | ||
===== | ||
|
||
|
||
.. _installation: | ||
|
||
Installation | ||
------------ | ||
|
||
To use the functions include this import: | ||
|
||
.. code-block:: console | ||
import bird | ||
Examples | ||
---------------- | ||
|
||
For example: | ||
|
||
>>> import bird | ||
|
Oops, something went wrong.