-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
DOC: fix formatting of shell commands #131295
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
Conversation
"sudo zypper in python3-idle" gets highlighted as Python code. specifically "in" is highlighted in green. Since this is a shell command it needs to be formatted as such.
Doc/using/unix.rst
Outdated
| * For Debian and Ubuntu users:: | ||
| * For Debian and Ubuntu users: | ||
|
|
||
| .. code-block:: shell |
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.
Do we use shell or bash in general? also are you interested in fixing the other places which use incorrect highlighting?
|
Actually |
|
There is a small distinction between Using https://pygments.org/demo/: With With To avoid this weird formatting, I would advise using the full name |
|
|
||
| .. code-block:: shell | ||
| sudo zypper in python3-idle |
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.
As I said, this will still be highlighted as in is a valid shell keyword :( so let's use install.
| sudo zypper in python3-idle | |
| sudo zypper install python3-idle |
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.
what if we use shell-session lexer?
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.
The shell-session lexer seems to work but if we put a prompt (say $) in front of the command, it doesn't work. So I'm not sure what would be the best:
@hugovk what do you recommend here? I think it's not the only place where we're probably mixing lexers but I think it's better if we don't highlight in here. But using shell-session without a prompt looks a bit... weird =/
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.
Let's use install like in the Zypper docs:
|
Let's also take care with the indents inside bullet points. Before:
https://docs.python.org/3/using/unix.html#installing-idle After:
https://cpython-previews--131295.org.readthedocs.build/en/131295/using/unix.html#installing-idle |
|
submitted a new pull request #131310 instead of this one |







"sudo zypper in python3-idle" gets highlighted as Python code. specifically "in" is highlighted in green. Since this is a shell command it needs to be formatted as such.

📚 Documentation preview 📚: https://cpython-previews--131295.org.readthedocs.build/en/131295/using/unix.html