Skip to content
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

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Infrastructure updates #46

merged 2 commits into from
Mar 27, 2024

Conversation

Luthaf
Copy link
Contributor

@Luthaf Luthaf commented Mar 26, 2024

Fix #42
Fix #43

@Luthaf Luthaf requested review from PicoCentauri and jwa7 March 26, 2024 12:14
Comment on lines +131 to +153
# 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")
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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!

@Luthaf Luthaf merged commit ebc1b7e into main Mar 27, 2024
7 checks passed
@Luthaf Luthaf deleted the infra branch March 27, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants