2017-05-10 13:00:00 -04:00
#!/bin/bash
if [ $# -ne 1 ] ; then
echo " Usage: $( basename $0 ) project-name "
exit 1
fi
PROJECT = $1
2023-08-25 15:22:14 -04:00
yes "n" | sphinx-quickstart --dot _ --project $PROJECT --author "Certbot Project" -v 0 --release 0 --language en --suffix .rst --master index --ext-autodoc --ext-intersphinx --ext-todo --ext-coverage --ext-viewcode --extensions sphinx_rtd_theme --makefile --batchfile $PROJECT /docs
2017-05-10 13:00:00 -04:00
cd $PROJECT /docs
sed -i -e "s|\# needs_sphinx = '1.0'|needs_sphinx = '1.0'|" conf.py
2021-11-11 03:44:59 -05:00
sed -i -e "s|intersphinx_mapping = {'https://docs.python.org/': None}|intersphinx_mapping = {\n 'python': ('https://docs.python.org/', None),\n 'acme': ('https://acme-python.readthedocs.org/en/latest/', None),\n 'certbot': ('https://eff-certbot.readthedocs.io/en/stable/', None),\n}|" conf.py
2023-08-25 15:22:14 -04:00
sed -i -e "s|html_theme = 'alabaster'|html_theme = 'sphinx_rtd_theme'|" conf.py
2020-01-10 19:48:01 -05:00
sed -i -e "s|# Add any paths that contain templates here, relative to this directory.|autodoc_member_order = 'bysource'\nautodoc_default_flags = ['show-inheritance']\n\n# Add any paths that contain templates here, relative to this directory.|" conf.py
2017-05-10 13:00:00 -04:00
sed -i -e "s|# The name of the Pygments (syntax highlighting) style to use.|default_role = 'py:obj'\n\n# The name of the Pygments (syntax highlighting) style to use.|" conf.py
2020-02-06 18:39:47 -05:00
# If the --ext-todo flag is removed from sphinx-quickstart, the line below can be removed.
sed -i -e "s|todo_include_todos = True|todo_include_todos = False|" conf.py
2017-05-10 13:00:00 -04:00
echo "/_build/" >> .gitignore
echo " =================
API Documentation
= = = = = = = = = = = = = = = = =
.. toctree::
:glob:
api/**" > api.rst
2018-03-12 20:10:23 -04:00
sed -i -e " s| :caption: Contents:| :caption: Contents:\n\n.. automodule:: ${ PROJECT //-/_ } \n :members:\n\n.. toctree::\n :maxdepth: 1\n\n api| " index.rst
2017-05-10 13:00:00 -04:00
echo " Suggested next steps:
* Add API docs to: $PROJECT /docs/api/
* Run: git add $PROJECT /docs"