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

gh-127276: add embedded styles to documentation pages created by a 'python -m pydoc -w' call #127277

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

denisbukanov
Copy link

@denisbukanov denisbukanov commented Nov 26, 2024

Copy link

cpython-cla-bot bot commented Nov 26, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Nov 26, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@@ -631,15 +632,19 @@ class HTMLDoc(Doc):

def page(self, title, contents):
"""Format an HTML page."""
css_data = importlib.resources.files('pydoc_data').joinpath('_pydoc.css').read_text()
Copy link
Member

Choose a reason for hiding this comment

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

Can this fail on any envs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally rhis should also be documented (i.e. you should say which file we are looking for). Maybe we can have a list of allowed files?

@@ -0,0 +1 @@
Add embedded styles to documentation pages created by a 'python -m pydoc -w' call
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm on mobile but this new feature warrants a What's New entry as well.

By the way, I'd suggest using back quotes to format the command line rather than single quotes as well as adding a period at the end of the sentence:

Allow to specify embedded styles for documentation pages created by :option:`pydoc -w`.

Please check that pydoc is documented as a program (with the .. program:: directive) and that -w is also a documented option (with the .. option:: directive). If not, you can just use

... created by the ``-w`` option of the :mod:`pydoc` program.

@@ -631,15 +632,19 @@ class HTMLDoc(Doc):

def page(self, title, contents):
"""Format an HTML page."""
css_data = importlib.resources.files('pydoc_data').joinpath('_pydoc.css').read_text()
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally rhis should also be documented (i.e. you should say which file we are looking for). Maybe we can have a list of allowed files?

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

Successfully merging this pull request may close these issues.

3 participants