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

rst: single backticks now render correctly in both rst2html and github #17028

Merged
merged 5 commits into from
Feb 13, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Feb 13, 2021

single backticks were already supported by rst2html however they didn't render as monospace in github.

this PR allows using .. default-role:: code (which rst2html now can handle instead of choking on it) which is interpreted by rst parsers (including github) as changing how single backticks text is rendered, changing it to monospace so that it appears like double backticks text.

After this PR, there's no need anymore to use double backticks anywhere, this allows (in a future PR) to do a sweeping change and change all double backticks to single backticks, which is simpler, shorter, and more familiar for most people (familiar with markdown), so we end up with 1 way to do things instead of 2.

example

before PR
see https://github.com/nim-lang/Nim/blob/devel/doc/contributing.rst

after PR
see https://github.com/timotheecour/Nim/blob/pr_rst_singlebacktick/doc/contributing.rst

note

here's a snippet from contributing.rst that contained (before this PR) both single and double backticks. As you can see, before this PR the single backticks didn't render as monospace:

before PR
image

after PR
image

source:

Each test should be in a separate ``block:`` statement, such that
each has its own scope. Use boolean conditions and ``doAssert`` for the
testing by itself, don't rely on echo statements or similar; in particular, avoid
things like `echo "done"`. Don't use `unittest.suite` and `unittest.test`.

future work

  • a single (or just a few) PR that changes all double to single backticks, and does nothing else

links

Copy link
Member

@ringabout ringabout left a comment

Choose a reason for hiding this comment

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

nice

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.

3 participants