-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Consider syntax highlighting for shell sessions #1449
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
Labels
Comments
|
carols10cents
added a commit
to carols10cents/diesel.rs-website
that referenced
this issue
Jul 28, 2018
I learned in rust-lang/book#1449 that highlight.js has `shell` for console sessions. This is more appropriate than `bash`, which is for highlighting bash scripts.
steveklabnik
added a commit
that referenced
this issue
Jun 2, 2020
The "text" style is just plain text, but we were also using it for command line examples. Turns out that highlight.js has a style for this, called "console." This commit updates all instances of using text for a command line example to use console instead. Fixes #1449
Merged
Almost two years later, I've now done this. Thanks for bringing it up! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, code blocks that show interaction with the shell use plain
text
style.It has already been discussed in issue #327 that the styles
bash
orsh
are not appropriate since they're intended for shell scripts only.As shell sessions are such a common case, they are supported by multiple highlighting engines, including both highlight.js and GitHub linguist.
In highlight.js, it is known as
shell
orconsole
:https://github.com/highlightjs/highlight.js/blob/master/src/languages/shell.js
In GitHub linguist, it is named
ShellSession
with the aliasesbash session
andconsole
:https://github.com/github/linguist/blob/2942bf9f1bf7a4871167c046c1e27d26cb198200/lib/linguist/languages.yml#L4410-L4421
Here is a demo in linguist (from
ch01-03-hello-cargo.md
):I'd like to suggest the usage of
console
for the following reasons:shell
, which can easily be confused withsh
(which is intended for shell scripts and not sessions).The text was updated successfully, but these errors were encountered: