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
Correct syntax highlighting #1413
Correct syntax highlighting #1413
Conversation
Use the explicit `.. code-block` reStructuredText directive throughout, and highlight all blocks with the correct pygments lexer. The `::` syntax uses the default Python lexer which causes mishighlighting when it's not Python. Also: * sneak in a change from `pip install` to `python -m pip install` as per my [blog post today](https://adamj.eu/tech/2020/02/25/use-python-m-pip-everywhere/). * Fix 'WARNING: html_static_path entry '_static' does not exist' by commenting out '_static' entry
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.
OK, overall looks good.
On Django we don't use code-block for the Python blocks.
Better go and read your blog post but... 😬
callable, that takes receive and send methods. It's usually written as a class:: | ||
callable, that takes receive and send methods. It's usually written as a class: | ||
|
||
.. code-block:: python |
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.
Python is the default right?
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.
It is but I think using ::
all over the place makes it hard for copy-pasters to find out about code-block
and thus realize they can control the language highlighting. I prefer to be explicit
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.
Yeah, OK.
pip install -U channels | ||
.. code-block:: sh | ||
|
||
python -m pip install -U channels |
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 so Meh about this. pip install...
has worked fine for years. 🙂
There was a matching one in contributing.txt
. (I'm not suggesting you update that too. 🙂)
@adamchainz OK, I'm Meh but I guess it's better advice for all and sundry. Can you update the pip install in contributing.txt too please? Ta. |
Updated all pip installs Yeah |
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.
Super. Thank you @adamchainz!
Use the explicit
.. code-block
reStructuredText directive throughout, and highlight all blocks with the correct pygments lexer. The::
syntax uses the default Python lexer which causes mishighlighting when it's not Python.Also:
pip install
topython -m pip install
as per my blog post today.