Skip to content

Commit

Permalink
docs: conf: Add download button for ipython notebooks
Browse files Browse the repository at this point in the history
Signed-off-by: mHash1m <hashimchaudry23@gmail.com>
  • Loading branch information
mhash1m committed May 25, 2021
1 parent 16509b0 commit 471b5b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@
".md": "markdown",
}

# Download button for ipython notebooks
nb_version = ""
if "." not in version:
nb_version = "master/"
# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base=None) %}
.. image:: ../../images/Download-.ipynb-button.svg
:target: https://intel.github.io/dffml/{{nbversion}}{{docname[:-6]}}ipynb
:alt: Notebook download button
|
"""

# -- Options for HTML output -------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/images/Download-.ipynb-button.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 471b5b7

Please sign in to comment.