Skip to content
Snippets Groups Projects

FIX + Doc / Build_readthedocs_documentation

Merged Karim Ahmed requested to merge doc/run_rtd into master
Compare and
7 files
+ 79
49
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 3
5
@@ -385,7 +385,6 @@ from nbconvert import RSTExporter
@@ -385,7 +385,6 @@ from nbconvert import RSTExporter
from xfel_calibrate import notebooks
from xfel_calibrate import notebooks
rst_exporter = RSTExporter()
rst_exporter = RSTExporter()
with open("available_notebooks.rst", "w") as f:
with open("available_notebooks.rst", "w") as f:
f.write(dedent("""
f.write(dedent("""
.. _available_notebooks:
.. _available_notebooks:
@@ -407,7 +406,8 @@ with open("available_notebooks.rst", "w") as f:
@@ -407,7 +406,8 @@ with open("available_notebooks.rst", "w") as f:
for caltype in sorted(values.keys()):
for caltype in sorted(values.keys()):
data = values[caltype]
data = values[caltype]
if data.get("notebook", None) is None:
 
continue
nbpath = os.path.abspath("{}/../../../{}".format(__file__, data["notebook"]))
nbpath = os.path.abspath("{}/../../../{}".format(__file__, data["notebook"]))
with open(nbpath, "r") as nf:
with open(nbpath, "r") as nf:
nb = nbformat.read(nf, as_version=4)
nb = nbformat.read(nf, as_version=4)
@@ -440,7 +440,7 @@ with open("available_notebooks.rst", "w") as f:
@@ -440,7 +440,7 @@ with open("available_notebooks.rst", "w") as f:
f.write("\n\n")
f.write("\n\n")
# add test results
# add test results
test_artefact_dir = os.path.realpath("../../tests/artefacts")
test_artefact_dir = os.path.realpath("../../tests/legacy/artefacts")
import shutil
import shutil
import textwrap
import textwrap
@@ -575,7 +575,6 @@ Contents:
@@ -575,7 +575,6 @@ Contents:
"""
"""
if not os.path.exists("./test_rsts"):
if not os.path.exists("./test_rsts"):
os.makedirs("./test_rsts")
os.makedirs("./test_rsts")
with open("test_results.rst", "w") as f:
with open("test_results.rst", "w") as f:
f.write(header)
f.write(header)
for commit, modtime in sorted_dir(test_artefact_dir):
for commit, modtime in sorted_dir(test_artefact_dir):
@@ -609,6 +608,5 @@ with open("test_results.rst", "w") as f:
@@ -609,6 +608,5 @@ with open("test_results.rst", "w") as f:
rst = xml_to_rst_report(xs, commit, reports=reports.get(rloc, []))
rst = xml_to_rst_report(xs, commit, reports=reports.get(rloc, []))
fr.write(rst)
fr.write(rst)
f.write(" test_rsts/{}\n".format(commit))
f.write(" test_rsts/{}\n".format(commit))
def setup(app):
def setup(app):
app.add_stylesheet('css/test_decorators.css')
app.add_stylesheet('css/test_decorators.css')
Loading