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

Produce better Misc/NEWS output for Sphinx #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AA-Turner
Copy link
Member

Misc/NEWS is only consumed by Sphinx, which applies several transformations to it. This PR applies those transformations upstream:

  • Output b.p.o and GH directives for issue numbers
  • Remove "What's New in ..." prefixes
  • Remove stripped "Python News" header

xref python/cpython#129577

A

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

  • Remove "What's New in ..." prefixes

I see they don't show up in https://docs.python.org/3/whatsnew/changelog.html. Are they being removed by one of our Sphinx extensions?

It might be that the Windows installer is ingesting the NEWS file without Sphinx processing, but perhaps it's fine to remove these prefixes anyway, because the changelog isn't the same as our carefully edited "What's New in Python" documents?

@AA-Turner
Copy link
Member Author

  • Remove "What's New in ..." prefixes

I see they don't show up in docs.python.org/3/whatsnew/changelog.html. Are they being removed by one of our Sphinx extensions?

Yes, see https://github.com/python/cpython/blob/HEAD/Doc/tools/extensions/misc_news.py#L33-L35 (originally introduced in python/cpython@44d0c21).

It might be that the Windows installer is ingesting the NEWS file without Sphinx processing, but perhaps it's fine to remove these prefixes anyway, because the changelog isn't the same as our carefully edited "What's New in Python" documents?

Having checked my local installations, the NEWS file is indeed included in Doc\html\NEWS. Removing the "What's New" prefixes is still likely fine here. Removing the "Python News" header is more arguable, though I would take the position that Misc/NEWS is solely for our internal consumption since splitting the actual entries to Misc/NEWS.d -- we only create the file during the process of rendering our documentation.


To the Windows point, the NEWS file would ordinarily duplicate the content in Doc\html\whatsnew\changelog.html, as the Windows builds ship the rendered documentation, but the Changelog HTML file says " The NEWS file is not available." -- we should probably aim to fix this?

image

@AA-Turner
Copy link
Member Author

Note: we currently include Misc/NEWS in the generated release archives. I do think the arguments above still hold, but worth pointing out.

https://github.com/python/release-tools/blob/master/release.py#L585-L586

@@ -1013,7 +1006,7 @@ def print(*a, sep=" "):
assert len(filenames) == 1
blurbs.load(filenames[0])

header = "What's New in Python " + printable_version(version) + "?"
header = printable_version(version)
Copy link
Member

Choose a reason for hiding this comment

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

Something (I'm guessing this line?) is dropping "Python" before the version numbers in the headers, which has a knock-on effect that a lot (but not all) of anchors change from like #python-3-13-0-alpha-4 to #id62:

(main on left, PR on right)

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants