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

Add a quick reference for rst markup. #916

Merged
merged 5 commits into from
Aug 6, 2022

Conversation

ezio-melotti
Copy link
Member

This PR adds a quick reference table at the top of the rst reference page. The goal of this table is to show some commonly used markup and to include links to the relevant sections. I also added some internal references and changed a title.

This was proposed a decade ago on IRC, and then captured in python/cpython#58426 (comment) 1

Footnotes

  1. note that the issue itself (now transferred to include rendered output in addition to markup #14) is probably obsolete, and this proposal doesn't aim to solve that.

documentation/markup.rst Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

IMO, this PR is definitely a great improvement from a reader quick-reference perspective.

I do think, like for PEP 12, we shouldn't duplicate the Sphinx reST primer nearly word for word in most places, as opposed to just linking to it (via Intersphinx) and focusing on the guidance and conventions unique and specific to the CPython docs. I've opened python/docs-community#57 to discuss that issue further.

documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
@ezio-melotti
Copy link
Member Author

Here is a new iteration:
image

  • added parameters next to arguments
  • merged vars/literals/code
  • added examples of roles with custom text, without links, without the first part1.

I didn't add methods/classes as discussed in a previous comment. The goal of this table is to provide a quick reminder for the syntax (e.g. how do I create a link? or a coment? was it .. directive: or .. directive::?) -- additional roles (like meth or class) are just a click away.

Footnotes

  1. the descriptions in the first column are not too accurate, but IMHO functional enough. People that already know that e.g. there's a way to only show the last component of an object will recognize the entry and see the syntax in the table; people that are not familiar with the feature or find the description confusing can always click the link and find a more exhaustive description.

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

Looks good overall with your changes 👍 , I just had some textual improvements, minor nits and bikeshedding

documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
@ezio-melotti
Copy link
Member Author

ezio-melotti commented Aug 4, 2022

I believe I addressed all comments. This is the latest iteration of the table:
image

I also had to use a couple of rst tricks for .. and ``...``, but I was able to get it to work using :literal:`...`:
image
image

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

I suggested some re-writes to the roles section to avoid parts that are contradictory, duplicative and potentially confusing. Otherwise, this looks pretty good overall.

documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
Co-authored-by: CAM Gerlach <[email protected]>
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

Two tiny tweaks, otherwise LGTM 👍

documentation/markup.rst Outdated Show resolved Hide resolved
documentation/markup.rst Outdated Show resolved Hide resolved
@ezio-melotti ezio-melotti merged commit e807042 into python:main Aug 6, 2022
@ezio-melotti ezio-melotti deleted the rst-quick-ref branch August 6, 2022 00:01
@ezio-melotti
Copy link
Member Author

Merged. thanks for the review and suggestions!

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