Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions ep_syntaxhighlighting/static/js/shBrushBash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 4.0.0 (February 7 2016)
*
* @copyright
* Copyright (C) 2004-2016 Alex Gorbatchev.
*
* @license
* MIT license.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush() {
function hereDocProcess(match, regexInfo) {
var result = [];

if (match.here_doc != null)
result.push(new Match(match.here_doc, match.index + match[0].indexOf(match.here_doc), 'string'));

if (match.full_tag != null)
result.push(new Match(match.full_tag, match.index, 'preprocessor'));

if (match.end_tag != null)
result.push(new Match(match.end_tag, match.index + match[0].lastIndexOf(match.end_tag), 'preprocessor'));

return result;
}

var keywords = 'if fi then elif else for do done until while break continue case esac function return in eq ne ge le';
var commands = 'alias apropos awk basename base64 bash bc bg builtin bunzip2 bzcat bzip2 bzip2recover cal cat cd cfdisk chgrp chmod chown chroot' +
'cksum clear cmp comm command cp cron crontab crypt csplit cut date dc dd ddrescue declare df ' +
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
'free fsck ftp gawk gcc gdb getconf getopts grep groups gunzip gzcat gzip hash head history hostname id ifconfig ' +
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
'mv nasm nc ndisasm netstat nice nl nohup nslookup objdump od open op passwd paste pathchk ping popd pr printcap ' +
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
'sleep sort source split ssh strace strings su sudo sum symlink sync tail tar tee test time ' +
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
'vi watch wc whereis which who whoami Wget xargs xxd yes chsh zcat';

this.regexList = [
{
regex: /^#!.*$/gm,
css: 'preprocessor bold'
},
{
regex: /\/[\w-\/]+/gm,
css: 'plain'
},
{
regex: SyntaxHighlighter.regexLib.singleLinePerlComments,
css: 'comments'
},
{
regex: SyntaxHighlighter.regexLib.doubleQuotedString,
css: 'string'
},
{
regex: SyntaxHighlighter.regexLib.singleQuotedString,
css: 'string'
},
{
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
},
{
regex: new RegExp(this.getKeywords(commands), 'gm'),
css: 'functions'
},
{
regex: new XRegExp("(?<full_tag>(&lt;|<){2}(?<tag>\\w+)) .*$(?<here_doc>[\\s\\S]*)(?<end_tag>^\\k<tag>$)", 'gm'),
func: hereDocProcess
}
];
};

Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['bash', 'shell', 'sh'];

SyntaxHighlighter.brushes.Bash = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
78 changes: 78 additions & 0 deletions ep_syntaxhighlighting/static/js/shBrushDelphi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 4.0.0 (February 7 2016)
*
* @copyright
* Copyright (C) 2004-2016 Alex Gorbatchev.
*
* @license
* MIT license.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush() {
var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
'case char class comp const constructor currency destructor div do double ' +
'downto else end except exports extended false file finalization finally ' +
'for function goto if implementation in inherited int64 initialization ' +
'integer interface is label library longint longword mod nil not object ' +
'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
'pint64 pointer private procedure program property pshortstring pstring ' +
'pvariant pwidechar pwidestring protected public published raise real real48 ' +
'record repeat set shl shortint shortstring shr single smallint string then ' +
'threadvar to true try type unit until uses val var varirnt while widechar ' +
'widestring with word write writeln xor';

this.regexList = [
{
regex: /\(\*[\s\S]*?\*\)/gm,
css: 'comments'
},
{
regex: /{(?!\$)[\s\S]*?}/gm,
css: 'comments'
},
{
regex: SyntaxHighlighter.regexLib.singleLineCComments,
css: 'comments'
},
{
regex: SyntaxHighlighter.regexLib.singleQuotedString,
css: 'string'
},
{
regex: /\{\$[a-zA-Z]+ .+\}/g,
css: 'color1'
},
{
regex: /\b[\d\.]+\b/g,
css: 'value'
},
{
regex: /\$[a-zA-Z0-9]+\b/g,
css: 'value'
},
{
regex: new RegExp(this.getKeywords(keywords), 'gmi'),
css: 'keyword'
}
];
};

Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['delphi', 'pascal', 'pas'];

SyntaxHighlighter.brushes.Delphi = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
58 changes: 58 additions & 0 deletions ep_syntaxhighlighting/static/js/shBrushDiff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 4.0.0 (February 7 2016)
*
* @copyright
* Copyright (C) 2004-2016 Alex Gorbatchev.
*
* @license
* MIT license.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush() {
this.regexList = [
{
regex: /^\+\+\+ .*$/gm,
css: 'color2'
},
{
regex: /^\-\-\- .*$/gm,
css: 'color2'
},
{
regex: /^\s.*$/gm,
css: 'color1'
},
{
regex: /^@@.*@@.*$/gm,
css: 'variable'
},
{
regex: /^\+.*$/gm,
css: 'string'
},
{
regex: /^\-.*$/gm,
css: 'color3'
}
];
};

Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['diff', 'patch'];

SyntaxHighlighter.brushes.Diff = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
72 changes: 72 additions & 0 deletions ep_syntaxhighlighting/static/js/shBrushErlang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 4.0.0 (February 7 2016)
*
* @copyright
* Copyright (C) 2004-2016 Alex Gorbatchev.
*
* @license
* MIT license.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush() {
// Contributed by Jean-Lou Dupont
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html

// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor ' +
'case catch cond div end fun if let not of or orelse ' +
'query receive rem try when xor' +
// additional
' module export import define';

this.regexList = [
{
regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'),
css: 'constants'
},
{
regex: new RegExp("\\%.+", 'gm'),
css: 'comments'
},
{
regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'),
css: 'preprocessor'
},
{
regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'),
css: 'functions'
},
{
regex: SyntaxHighlighter.regexLib.doubleQuotedString,
css: 'string'
},
{
regex: SyntaxHighlighter.regexLib.singleQuotedString,
css: 'string'
},
{
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}
];
};

Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['erlang', 'erl'];

SyntaxHighlighter.brushes.Erlang = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
Loading