I'm looking for an easy way to syntax highlight C# code into HTML from the command line. Ideally this would be something like:
syntax-highlighter test.cs
... produces test.html.
Syntax highlighting is a feature of text editors that are used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms.
After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.
bashrc seems to be syntax highlighted automatically, even though I haven't told Emacs to do that.
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
A very good one is pygments.
The command is
pygmentize -f html /path/to/test.cs
Supports lots of languages, including C#. Requires python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With