Skip to content

Commit f39af67

Browse files
made the notebooks works on docker, renamed the containing folder, and added a link to the notebook
1 parent 184643b commit f39af67

9 files changed

+33
-6
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ COPY requirements.txt /usr/src/app/
88

99
RUN pip3 install --upgrade pip
1010
RUN pip3 install --no-cache-dir -r ../requirements-dev.txt
11+
RUN apt install pandoc
1112

1213
COPY .. /usr/src/app/mpqp/

docs/conf.py

+26
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@
5252
if sphinx_github_changelog_token is not None:
5353
extensions.append("sphinx_github_changelog")
5454

55+
# {% set docname = env.doc2path(env.docname,base=None).replace("\\", "/").split(".")[0].split("/")[-1] + '.ipynb' %}
56+
57+
# .. raw:: html
58+
59+
# <div class="admonition note">
60+
# This page was generated from the notebook
61+
# <a class="reference external" href="{{ docname|e }}">{{ docname|e }}</a>.
62+
# </div>
63+
64+
nbsphinx_prolog = r"""
65+
{% set docname = 'examples/notebooks/' + env.doc2path(env.docname,base=None).split("/")[-1].split("\\")[-1].split(".")[0] + '.ipynb' %}
66+
67+
.. raw:: html
68+
69+
<div class="admonition note">
70+
This page was generated from the notebook
71+
<a class="reference external" href="https://github.com/ColibrITD-SAS/mpqp/blob/main/{{ docname|e }}">{{ docname|e }}</a>.
72+
</div>
73+
74+
.. raw:: latex
75+
76+
\nbsphinxstartnotebook{\scriptsize\noindent\strut
77+
\textcolor{gray}{The following section was generated from the notebook
78+
\sphinxcode{\sphinxupquote{\strut {{ docname | escape_latex }}}} \dotfill}}
79+
"""
80+
5581
# The suffix of source filenames.
5682
source_suffix = ".rst"
5783

docs/examples.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ MPQP features.
88
:maxdepth: 1
99
:caption: Notebooks:
1010

11-
notebooks_link/1_Basics_of_circuit
12-
notebooks_link/2_Execution_Bell_circuit
13-
notebooks_link/3_Expectation_value_of_observables
14-
notebooks_link/4_Quantum_Fourier_Transform
15-
notebooks_link/5_Variational_Quantum_Algorithms
16-
notebooks_link/6_Pauli_string_observable
11+
notebooks/1_Basics_of_circuit
12+
notebooks/2_Execution_Bell_circuit
13+
notebooks/3_Expectation_value_of_observables
14+
notebooks/4_Quantum_Fourier_Transform
15+
notebooks/5_Variational_Quantum_Algorithms
16+
notebooks/6_Pauli_string_observable

0 commit comments

Comments
 (0)