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

Use .rst as the file extension for reST-based PEPs #1

Closed
brettcannon opened this issue Jun 15, 2016 · 22 comments
Closed

Use .rst as the file extension for reST-based PEPs #1

brettcannon opened this issue Jun 15, 2016 · 22 comments

Comments

@brettcannon
Copy link
Member

Requires not only renaming all relevant files but also updating code to accept the file extension. As part of this we can probably consider dropping the Content-Type as it will be known from the file extension (although others may disagree).

This will allow for rich rendering of the reST-based PEPS by GitHub.

@ncoghlan
Copy link
Contributor

#32 covers supporting .rst as an extension in the Makefile and PEP 0 generator

ilevkivskyi referenced this issue in ilevkivskyi/peps Aug 29, 2016
Added all the thing that should not be lost in megathreads
@ncoghlan ncoghlan mentioned this issue Oct 14, 2016
@ncoghlan
Copy link
Contributor

@berkerpeksag mentioned in #116 that the .rst extension isn't supported by the python.org importer yet.

I think that may be the only remaining barrier to a bulk rename of the existing text/x-rst PEPs.

@brettcannon
Copy link
Member Author

That's been my assumption as well about where things stand.

@brettcannon
Copy link
Member Author

This issue is also dependent on #4 .

@brettcannon
Copy link
Member Author

Looks like www.python.org/dev/peps/ will now display PEPs with a .rst ending as demonstrated by PEP 550! The next problem is that the source link at the end of PEPs don't work for PEPs that end in .rst.

@berkerpeksag
Copy link
Member

The problem is the converter doesn't know anything about the source file so we probably need to guess the extension (maybe do a HEAD request to .txt first; if status is not 200; try .rst?)

@brettcannon
Copy link
Member Author

What I'm expecting is once #4 is done we can update the converter to assume .rst and then start moving all the file names over so it won't matter what the assumption is.

@gvanrossum
Copy link
Member

Hm... The source link thing is sad. Where's the code for the converter?

@ncoghlan
Copy link
Contributor

This is the offending line in the web app: https://github.com/python/pythondotorg/blob/master/peps/converters.py#L184

I'm thinking it may make sense to move that part out of the web app and into pep2html.py.

@gvanrossum
Copy link
Member

gvanrossum commented Sep 13, 2017 via email

@Mariatta
Copy link
Member

I learned in #462 that renaming a file on GitHub has a side effect of not being able to view the file's complete history. For example, after pep-0008.txt was renamed to pep-0008.rst, GitHub is only showing the history of pep-0008.rst as if it is a new file.

(The "History" I'm referring to is the button on GitHub when you're viewing the file: https://github.com/python/peps/blob/master/pep-0008.txt:)
screen shot 2017-11-12 at 8 52 53 am

Using the command line, git log pep-0008.rst only shows the revision history after the rename.
To get the full history of PEP 8 since the very beginning, we need to do git log --follow pep-0008.rst.
To me, not being able to view the full revision history on GitHub is a major inconvenience. I reverted that PR so everything is back to *.txt again.

@gvanrossum
Copy link
Member

gvanrossum commented Nov 12, 2017 via email

@Rosuav
Copy link
Contributor

Rosuav commented Nov 12, 2017

Personally, I just use the command-line git tools, or gitk. If GitHub can't track across renames, that's their problem, not ours.

@ncoghlan
Copy link
Contributor

I use the online history browser to check "When did such & such a change happen?", so losing annotations would be more annoying than not having inline rendering.

So using .rst for new PEPs, and leaving existing ones alone sounds like a reasonable compromise to me (unless/until GitHub update their history browser and annotation display to handle renames)

@berkerpeksag
Copy link
Member

So using .rst for new PEPs, and leaving existing ones alone sounds like a reasonable compromise to me (unless/until GitHub update their history browser and annotation display to handle renames)

+1.

@brettcannon
Copy link
Member Author

Do realize that leaving old PEPs as-is will still require a code change as the link back to the PEP source will still be broken (right now it blindly assumes it's a .txt file).

@ncoghlan
Copy link
Contributor

Right, we should still pull that snippet out of the website code and move it into pep2html.py

@Mariatta
Copy link
Member

The link back to the PEP source has been fixed in python/pythondotorg#1195.

@brettcannon
Copy link
Member Author

So is this considered done at this point then?

@ncoghlan
Copy link
Contributor

Aye, looks done to me - if we find anything else missing, it can become a new issue.

@ncoghlan
Copy link
Contributor

Thanks to all involved in getting this done!

@pradyunsg
Copy link
Member

Relevant here: isaacs/github#900

lukpueh added a commit to lukpueh/peps that referenced this issue Oct 10, 2019
abn pushed a commit to abn/peps that referenced this issue Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants