Skip to content
Snippets Groups Projects
Commit 1b0a95e0 authored by Astrid Muennich's avatar Astrid Muennich Committed by Mikhail Karnevskiy
Browse files

include tutorial notebook rendering rst in documentation

parent 07685620
No related branches found
No related tags found
1 merge request!21Beautify report
......@@ -31,12 +31,22 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
]
import sys
import os
from subprocess import Popen
sys.path.append(os.path.abspath("../pycalibration/"))
p = Popen(["./makeAllDocs.sh"])
p.communicate()
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......@@ -259,6 +269,7 @@ latex_elements = {
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'extraclassoptions': 'openany',
}
# Grouping the document tree into LaTeX files. List of tuples
......
......@@ -18,6 +18,7 @@ Contents:
available_notebooks
advanced
tutorial
_notebooks/index
Indices and tables
......
#!/bin/bash
# first convert notebooks to rst files
# the list of notebooks to convert:
notebooks=(calversion)
cd _notebooks
echo "Tutorial Example"> index.rst
echo "================">> index.rst
echo "" >> index.rst
echo "Tutorial Notebook:" >> index.rst
echo "" >> index.rst
echo ".. toctree::" >> index.rst
echo " :maxdepth: 5" >> index.rst
echo " :titlesonly:" >> index.rst
echo "" >> index.rst
for nb in ${notebooks[*]}
do
jupyter nbconvert --to rst ../../../notebooks/Tutorial/${nb}.ipynb --output-dir=./
##fix code blocks
sed -i.bak 's/code::/code-block::/g' ${nb}.rst
sed -i.bak 's/ipython3/python/g' ${nb}.rst
sed -i.bak 's/raw:: latex/math::/g' ${nb}.rst
sed -i.bak 's/``/`/g' ${nb}.rst
mv ${nb}.rst ${nb}.rst.end
echo ".. _${nb}:" > ${nb}.rst
cat ${nb}.rst.end >> ${nb}.rst
rm ${nb}.rst.end
echo " ${nb}" >> index.rst
done
rm *.bak
#cd .. rm api/* sphinx-apidoc -o ./api/ -E ../../iCalibrationDB/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment