-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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-130160: use .. program::
directive for documenting cProfile
CLI
#130314
base: main
Are you sure you want to change the base?
Conversation
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.
Doc/library/profile.rst
Outdated
|
||
.. option:: -m <module> | ||
|
||
Specifies that a module is being profiled instead of a script. | ||
|
||
.. versionadded:: 3.7 |
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.
Please, indent these values to be in -m
section.
@@ -122,24 +122,31 @@ The :class:`pstats.Stats` class reads profile results from a file and formats | |||
them in various ways. | |||
|
|||
.. _profile-cli: | |||
.. program:: cProfile |
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.
One more idea to test: we have :ref:profile <profile-cli>
in Doc/library/cmdline.rst
, we can remove this: .. _profile-cli:
and use just :program:profile <cProfile>
Do we also need to add .. program:: profile
?
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.
We should keep the target, though yes the cross-ref could be updated.
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.
There are two references to these section and they are all in cmdline. For the experiment I tried replacing :ref:profile <profile-cli>
with :program:profile <cProfile>
. But the link is not active.
I also tried different variants with :program:cProfile
and with :option:cProfile
, but the link is active only if we specify an option like: :option:cProfile -o
.
Co-authored-by: Bénédikt Tran <[email protected]>
Use
.. program::
and.. option::
directive for documentingcProfile
CLI.. program::
and.. option::
directives for modules with a documented CLI #130160📚 Documentation preview 📚: https://cpython-previews--130314.org.readthedocs.build/