Highlighting Syntax syntax? #5679
Replies: 1 comment 3 replies
-
Where are you trying to do this? From this…
… can I assume here on GitHub? If so, you should be able to use fenced code blocks; the trick is identifying the correct language 😉 And then you're beholden to the upstream grammar for doing the right thing which may not be many as usage information is normally in comments (like in shell scripts) and almost certainly not written in the same language so may not be highlighted any differently from the other comments or code. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I've been trying to find a way to display the syntax that a programmer might describe their shell program with. Appologies - its a bit of a meta topic, I might not be using quite the right working, and I couldn't find anything touching on it.
Here are samples of how people describe require, optional, alternative, string, and repeditive parameters. Is this something already implimented somewhere, or possibly missed?
Sample from ss64;
Sample from Powershell;
Sample from Linux MAN;
Sample from C# reference on IF syntax;
Sample from Github;
Sample from Github;
Obviously its not possible to trigger Liguist to work on inline text (or fool it to do so), and it doesn't appear possible to customize text within a code fence. Using 'vim' error highlighting isn't the best workaround.
Thanks for your patience and tips!
Beta Was this translation helpful? Give feedback.
All reactions