From a6e36b8158f8b37c5237d1aab62b1654a5a3f359 Mon Sep 17 00:00:00 2001 From: Richard Booth Date: Tue, 21 Apr 2020 10:23:02 +0100 Subject: [PATCH] Fixed hiding of prompt in nbsphinx --- docs/_static/custom.css | 4 ++++ docs/conf.py | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index e4bc82ac..0a71a2c1 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -9,3 +9,7 @@ .strike { text-decoration: line-through; } + +.nbinput .prompt, .nboutput .prompt { + display: none; +} diff --git a/docs/conf.py b/docs/conf.py index a3e68433..65cca159 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -109,14 +109,16 @@ autodoc_docstring_signature = True # Add a heading to notebooks +doc_path = "https://github.com/discsim/frank/blob/{}".format(branch) +nb_link = "`here <{0}/{1}>`_".format(doc_path, '{{ docname }}') + nbsphinx_prolog = """ -{%s set docname = env.doc2path(env.docname, base=None) %s} -.. note:: This tutorial is produced by the Jupyter notebook -`here `_. -""" % ("%", "%", branch,) +{{% set docname = env.doc2path(env.docname, base=None) %}} +.. note:: This tutorial is produced by the Jupyter notebook {}. + +""".format(nb_link) # nbsphinx -nbsphinx_prompt_width = 0 nbsphinx_timeout = 600 napoleon_use_ivar = True nbsphinx_allow_errors = True # TODO: remove once notebooks final