Skip to content

Instantly share code, notes, and snippets.

@angeloxx
Last active April 3, 2022 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angeloxx/1f897251bb49f6f84b959a7dc21dfc82 to your computer and use it in GitHub Desktop.
Save angeloxx/1f897251bb49f6f84b959a7dc21dfc82 to your computer and use it in GitHub Desktop.
Unix Syntax Hightligher Brush
/**
* SyntaxHighlighter Brush for Command Line Interface
* Author: Angelo Conforti
* License: GPL-2 | GPL-3
*/
SyntaxHighlighter.brushes.cli = function()
{
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.url, css: 'color1' },
{ regex: /^[\[\]][\w @\/\\:\-\.~\(\)\[\]]*?(>|>|\#|\$|%)+/gm, css: 'functions' },
];
};
SyntaxHighlighter.brushes.cli.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.cli.aliases = ['cli', 'cmd-prompt', 'shell-prompt'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment