-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infrastructure updates #46
Conversation
# TODO: Explain | ||
with open(file) as fd: | ||
content = fd.read() | ||
|
||
if "Download Conda environment file" in content: | ||
# do not add the download link twice | ||
pass | ||
else: | ||
lines = content.split("\n") | ||
with open(file, "w") as fd: | ||
for line in lines: | ||
if "sphx-glr-download-jupyter" in line: | ||
# add the new download link before | ||
fd.write( | ||
""" | ||
.. container:: sphx-glr-download | ||
|
||
:download:`Download Conda environment file: environment.yml <environment.yml>` | ||
""" | ||
) | ||
|
||
fd.write(line) | ||
fd.write("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work very well. I don't know if like that this is here. I rather would like to put this as an extensions sphinx-gallery directly.
I will explore this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you find a way to do this? Or should we merge this version for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an idea how to do this within the conf.py. But, we can merge this and I change this later!
Fix #42
Fix #43