Repository navigation
Handle pep files with .rst extensions. - #32
Conversation
| import webbrowser | ||
| file = find_pep(pep) | ||
| if file.endswith(".txt"): | ||
| if (file.startswith('pep-') and (file.endswith(".txt") or file.endswith('.rst'))): |
There was a problem hiding this comment.
file.endswith((".txt", ".rst")) would be clearer.
I don't have time to test it this week, but it looks like a backward compatible change to me. Thanks! |
|
The only undefined behavior is if txt and rst are present. I'll update with your suggestions later.
|
|
Updated as per comment. |
|
You can see the difference in the generated html here , which is mostly due to the |
| if not os.path.isfile(abs_file_path): | ||
| continue | ||
| if file_path.startswith("pep-") and file_path.endswith(".txt"): | ||
| if file_path.startswith("pep-") and file_path[-4:] in (".txt", "rst"): |
There was a problem hiding this comment.
file_path.endswith((".txt", ".rst")) would work too.
|
Big +1 for the general idea, since setting the file extension will let GitHub render them nicely. At the detailed level, I didn't have anything to add to Berker's existing comments. |
|
That said, would it make sense to update https://www.python.org/dev/peps/pep-0012/ at the same time as making the changes to support the .rst extension? It turns out that needs an update anyway to refer to the GitHub repo rather than hg.python.org |
|
Will do both early next week.
|
|
Updated as well as pep12. |
|
Thanks for this, @Carreau ! |
Clarify that we are recommending Ed25519
Not completely sure how that would interact with deploying pep on pythondotorg and other services.