diff --git a/documentation/conf.py b/documentation/conf.py index 7be93c9c75..b1806d1752 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -248,6 +248,27 @@ def install_doxygen(): 'python': ('https://docs.python.org/3', None), } +# Add notebooks prolog with binder links +# get current git reference +ret = subprocess.run( + "git rev-parse HEAD".split(" "), + capture_output=True +) +ref = ret.stdout.rstrip().decode() +nbsphinx_prolog = ( + f"{{% set {ref=} %}}" + r""" + {% set docname = "documentation/" + env.doc2path(env.docname, base=False) %} + .. raw:: html + +