-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
base: main
Are you sure you want to change the base?
Conversation
denisbukanov
commented
Nov 26, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Missing styles for pages created by a 'python -m pydoc -w' call #127276
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 |
…y a 'python -m pydoc -w' call
250661f
to
e3dce19
Compare
@@ -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() |
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.
Can this fail on any envs?
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.
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 |
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.
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() |
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.
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?