-
Notifications
You must be signed in to change notification settings - Fork 22
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
Documentation site build rework #204
Changes from 14 commits
452c239
0c29f3c
7cf1589
55dbe88
575cc8a
ce33007
cfa4457
6717412
9758a4a
1784a2b
4e2cc53
02aa4d6
a9bbd27
4dbef31
f198382
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,15 +66,15 @@ The homepage source code is in `./docs/source/index.rst`. | |
To build the documentation locally (not required but good check) | ||
|
||
```bash | ||
cd docs | ||
make html | ||
python3 docs/build_docs.py | ||
``` | ||
|
||
The built documentation will be in `./docs/_build` and the homepage is `./docs/_build/index.html`. | ||
To delete do `make clean`. | ||
To delete, do `python3 docs/clean_docs.py`. | ||
|
||
The documentation uses the Jupyter notebook tutorials in the `examples` directory. | ||
When building the documentation locally you will need to have installed [pandoc](https://pandoc.org/installing.html) and [gifsicle](https://github.com/kohler/gifsicle). | ||
We recommend installing pandoc using its Anaconda distribution: `conda install -c conda-forge pandoc`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this while investigating #203. Pandoc is a pain to get playing nice with Python on Windows using the methods suggested on the website, but there is an undocumented precompiled version supported on conda-forge that works like a charm. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems to be the case with a lot of codes that require compiling. |
||
|
||
### Editing the tutorials | ||
The tutorials are used as part of the Documentation. | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
from shutil import rmtree | ||
import source.make_theory_animations | ||
from sphinx.application import Sphinx | ||
|
||
docs_dir = os.path.dirname(os.path.abspath(__file__)) | ||
source_dir = os.path.join(docs_dir, 'source') | ||
conf_dir = source_dir | ||
build_dir = os.path.join(docs_dir, '_build') | ||
doctree_dir = os.path.join(build_dir, '.doctrees') | ||
example_dir = os.path.join(source_dir, '_examples') | ||
api_dir = os.path.join(source_dir, 'api_docs') | ||
|
||
|
||
def linkcheck(): | ||
app = Sphinx(source_dir, | ||
conf_dir, | ||
build_dir, | ||
doctree_dir, | ||
'linkcheck', | ||
warningiserror=True) | ||
app.build() | ||
|
||
|
||
def html(): | ||
app = Sphinx(source_dir, | ||
conf_dir, | ||
build_dir, | ||
doctree_dir, | ||
'html', | ||
warningiserror=True) | ||
Comment on lines
+15
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think writing it like this is redundant, but Sphinx doesn't have a good way of handling multiple builders outside of the Makefile interface at the moment. However, this should be addressed in sphinx-doc/sphinx#5618 whenever it gets merged. |
||
|
||
app.build() | ||
|
||
|
||
if __name__ == '__main__': | ||
source.make_theory_animations | ||
linkcheck() | ||
html() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import os | ||
from shutil import rmtree | ||
|
||
docs_dir = os.path.dirname(os.path.abspath(__file__)) | ||
source_dir = os.path.join(docs_dir, 'source') | ||
example_dir = os.path.join(source_dir, '_examples') | ||
api_dir = os.path.join(source_dir, 'api_docs') | ||
|
||
def clean(): | ||
rmtree(example_dir) | ||
rmtree(api_dir) | ||
|
||
if __name__ == '__main__': | ||
clean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
make html/pdf/etc
andmake clean
are common interfaces. It is a shame to have to replace them. But that's OK, it is not like we use this often. It is mostly just the CI.