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

Update code blocks in docs #545

Merged
merged 1 commit into from
Dec 17, 2020
Merged

Update code blocks in docs #545

merged 1 commit into from
Dec 17, 2020

Conversation

jdufresne
Copy link
Contributor

Update Python 2 syntax and drop Python-2-only examples.

Fix all Python console prompts to the full ">>> " for correct
highlighting.

Use "pycon" instead of "python" for interactive Python console session.
The "python" lexer is for Python scripts and doesn't interpret the ">>>"
prompt.

Fix all Python console code blocks to more accurately display what the
user will see. For example, when assigning a value to a variable, it
isn't also echoed.

Fix typo ".. code::" → ".. code-block::".

Use "console" instead of "sh" for shell sessions. The "sh" lexer is for
shell scripts. For a complete list of lexers, see:
https://pygments.org/docs/lexers/

Use blacken-docs to run black on code blocks.

@jpadilla jpadilla added this to the v2.0.0 milestone Dec 17, 2020
@jpadilla
Copy link
Owner

@jdufresne you've outdone yourself. I'm very thankful for all this awesome work you've done. ❤️

Use blacken-docs to run black on code blocks.

It'd be interesting to set this up in CI / pre-commit.

@jdufresne
Copy link
Contributor Author

It'd be interesting to set this up in CI / pre-commit.

Good idea. I've included this in the latest revision.

Update Python 2 syntax and drop Python-2-only examples.

Fix all Python console prompts to the full ">>> " for correct
highlighting.

Use "pycon" instead of "python" for interactive Python console session.
The "python" lexer is for Python scripts and doesn't interpret the ">>>"
prompt.

Fix all Python console code blocks to more accurately display what the
user will see. For example, when assigning a value to a variable, it
isn't also echoed.

Fix typo ".. code::" → ".. code-block::".

Use "console" instead of "sh" for shell sessions. The "sh" lexer is for
shell scripts. For a complete list of lexers, see:
https://pygments.org/docs/lexers/

Use blacken-docs to run black on code blocks. This is now included as a
pre-commit hook.
docs/algorithms.rst Show resolved Hide resolved
docs/usage.rst Show resolved Hide resolved
@jpadilla jpadilla merged commit a1907c0 into jpadilla:master Dec 17, 2020
@jdufresne jdufresne deleted the format-code-blocks branch December 18, 2020 00:50
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.

None yet

3 participants