-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Handle pep files with .rst
extensions.
#32
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
Conversation
@@ -469,7 +471,7 @@ def pep_type_error(inpath, pep_type): | |||
def browse_file(pep): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -41,7 +41,7 @@ def main(argv): | |||
abs_file_path = os.path.join(path, file_path) | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.