You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/index.rst
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -317,14 +317,18 @@ Pygments.
317
317
318
318
Downloading the code as a script
319
319
--------------------------------
320
+
320
321
Jupyter Sphinx includes 2 roles that can be used to download the code embedded in a document:
321
-
``:jupyter-download:script:`` (for a raw script file) and ``:jupyter-download:notebook:`` (for
322
-
a Jupyter notebook). For example, to download all the code from this document as a script we
322
+
``:jupyter-download:script:`` (for a raw script file) and ``:jupyter-download:notebook:`` or ``:jupyter-download:nb:`` (for
323
+
a Jupyter notebook).
324
+
325
+
These roles are equivalent to the standard sphinx `download role <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-download>`__, **except** the extension of the file should not be given.
326
+
For example, to download all the code from this document as a script we
323
327
would use::
324
328
325
-
:jupyter-download:script:`index`
329
+
:jupyter-download:script:`click to download <index>`
326
330
327
-
Which produces a link like this: :jupyter-download:script:`index`. The name that the role is
331
+
Which produces a link like this: :jupyter-download:script:`click to download <index>`. The target that the role is
328
332
applied to (``index`` in this case) is the name of the document for which you wish to download
329
333
the code. If a document contains ``jupyter-kernel`` directives with ``:id:`` specified, then
330
334
the name provided to ``:id:`` can be used to get the code for the cells belonging to the
0 commit comments