Run from the Documentation directory where the requirements.txt file is
pip install -r requirements.txt
installation instruction described here
pip install sphinx
https://pypi.org/project/sphinx-rtd-theme/
pip install sphinx-rtd-theme
https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html#installation
pip install sphinxcontrib-bibtex
pip install sphinxcontrib-globalsubs
pip install sphinxcontrib-youtubepython -m pip install sphinx_collapse- part of default distribution
- We use
autosectionlabel_prefix_document = Truewhich means that the internal link must be prefixed by the file name and a semi-column, see here.
In the Documentation directory, run from terminal
make htmlThe command generates all the files for a static website and writes them in Documentation/_build/html
When the changes are pushed, the documentation is also automatically compiled on github using github actions
The deployment of the webpage can be followed from the github page section
The result can be view at
https://battmoteam.github.io/BattMo/
We use the export function from matlab to export the notebook to ipynb format. An help exporter class is provided
here. The following script gives example on how it can be used. I have noticed problems with older Matlab
version. Please update to R24b.
Write the output in the Documentation directory. At the moment, the notebooks are located in the directory
pynbnotebooks
- We use nbsphinx-link
- Create a link file with extension
nblink, see example here - insert link in index, see example
runThermalExample.nblinkin here (line 16)
See example to the tutorial pages here
- run
publishExamplesXMLinutilsdirectory (see documentation there) : It creates XML outputs - run python script
buildPublishedExamples.py: converts XML to rST output
- Matlab uses own markup language which complicates transformation to rST file and therefore it should not be used
- We offer possibility to include extra rST description file automatically. If the example is named
myexample.m, then the extra rST file should be namedmyexamplePreamble.rst
- To make sure that a comment you include in matlab example file appears as a comment in rST output (and not at a
comment in the matlab code formatting), start a cell with eventually no title. Include only one white-space
betwen
%sign and text (otherwisepublishroutine exports differently). - The directive
.. automodule::makes sure a directory is parsed.
https://www.sphinx-doc.org/en/master/contents.html
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
https://sphinx-rtd-theme.readthedocs.io/en/stable/
https://sphinxcontrib-bibtex.readthedocs.io/en/latest/index.html