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

Look for Colab badges and redirect them to master #87

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

mwaskom
Copy link
Contributor

@mwaskom mwaskom commented Jun 20, 2020

Fixes #81

@mwaskom
Copy link
Contributor Author

mwaskom commented Jun 20, 2020

Fingers crossed that we're not in "now we have two problems" territory here.

@mwaskom mwaskom added the Infrastructure Things related to the workflows (e.g., book generation, process notebooks) label Jun 20, 2020
Copy link
Contributor

@patrickmineault patrickmineault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered this would work with a fork?

def redirect_colab_badge(cell):
"""Modify the Colab badge to point at the master branch on Github."""
cell_text = cell["source"]
p = re.compile(r"^(.+/NeuromatchAcademy/course-content/blob/)\w+(/.+$)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this wouldn't work if someone pulls in from a fork.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. But is that the workflow we're going to use? I'm not sure this bit of processing can solve all problems — we'd also have to replace the repository name in the badge then too.

Canonical Colab links should probably be hand-curated in the README / on the website.

@mwaskom
Copy link
Contributor Author

mwaskom commented Jun 21, 2020

Let's get this merged for now since it works for the workflow we currently prescribe. We can keep an open issue about broken badges for colabs that come in from a feature on a fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Things related to the workflows (e.g., book generation, process notebooks)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Colab links are broken / don't point to master
2 participants