Forrest logo
back to the highlight tool

highlight:tldr:1b6e7

highlight: Produce an HTML fragment, suitable for inclusion in a larger document.
$ highlight --out-format=${html} --fragment --syntax ${language} ${source_file}
try on your machine

The given command is using the "highlight" tool to generate syntax-highlighted HTML code for a specific source file.

Here is what each part of the command does:

  • highlight: This is the name of the tool being used.
  • --out-format=${html}: This specifies the output format to be HTML. ${html} is likely a placeholder for the actual value of "html".
  • --fragment: This flag instructs highlight to generate a fragment of HTML code rather than a complete HTML document.
  • --syntax ${language}: This specifies the desired programming language for syntax highlighting. ${language} is likely a placeholder for the actual language value.
  • ${source_file}: This is the file that will be processed and highlighted.

Overall, this command will take a source file, apply syntax highlighting to it using the specified language, and output a fragment of HTML code representing the highlighted syntax.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the highlight tool