Add livepreview (7f3ed651e4e4388977f9b3ce29ed1a995ff6d7a9).

This commit is contained in:
bootstraponline
2012-05-02 16:59:50 -06:00
parent 1086fba7da
commit 347260f17b
72 changed files with 8247 additions and 0 deletions
@@ -0,0 +1,72 @@
body {
overflow: hidden;
}
#editor {
margin: 0;
padding: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
#contentframe {
margin: 0 auto;
overflow: visible;
width: 80%;
}
#previewframe {
margin: 0;
padding: 0;
position: absolute;
top: 0;
bottom: 0;
left: 10px;
right: 0;
}
/* -- Start from notepag.es -- */
#toolpanel {
position: fixed;
background: #666;
top: 0;
height: 30px;
right: 20px;
width: 80px;
vertical-align: middle;
padding: 5px 0;
margin: 0;
text-align: center;
}
#toolpanel.edit a.edit {
opacity: 0.4;
/* Make it appear as a link even though save
doesn't have a href attribute. */
cursor: pointer;
display: inline-block;
}
#toolpanel a {
color: white;
text-decoration: none;
margin: 0 5px;
display: none;
padding: 4px;
font-family: sans-serif;
}
#toolpanel a img {
vertical-align: middle;
margin-left: 5px;
margin: 0;
padding: 0;
}
a img {
border: none;
}
/* -- End from notepag.es -- */
@@ -0,0 +1,361 @@
/*
Gollum v3 previewframe
*/
/**
added from new production css.
should go in gollum.css
*/
blockquote {
border-left: 4px solid #DDD;
padding: 0 15px;
color: #777;
}
em, i {
font-style: italic;
}
a {
color: #4183C4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
cursor: auto;
}
#previewframe hr {
/*
https://a248.e.akamai.net/assets.github.com/images/modules/pulls/dirty-shade.png
'../../images/modules/pulls/dirty-shade.png'
*/
background: transparent url('https://a248.e.akamai.net/assets.github.com/images/modules/pulls/dirty-shade.png') repeat-x 0 0;
border: 0 none;
color: #CCC;
height: 4px;
padding: 0;
}
#previewframe p code.nohighlight {
display: inline;
margin: 0 2px;
padding: 0 5px;
white-space: nowrap;
border: 1px solid #EAEAEA;
background-color: #F8F8F8;
border-radius: 3px;
}
/** end **/
/* margin & padding reset*/
* {
margin: 0;
padding: 0;
}
html, body {
color: black;
}
body {
font:100% helvetica,arial,freesans,clean,sans-serif;
line-height: 1.4;
}
img {
border: 0;
}
#previewframe {
font-size: 14px;
line-height: 1.4;
margin-bottom: 40px;
overflow-y: scroll;
}
/* Link Colors */
a.absent {
color: #c00;
}
/* Primary Body Copy */
#previewframe p {
margin: 1em 0;
padding: 0;
}
/* ReST first graf in nested list */
#previewframe * li p.first {
display: inline-block;
}
/* Headings */
#previewframe h1, #previewframe h2, #previewframe h3,
#previewframe h4, #previewframe h5, #previewframe h6 {
margin: 0;
padding: 0;
}
#previewframe h1 {
border-bottom: 1px solid #ccc;
font-size: 33px; /* was 32, GH is 33px */
line-height: normal;
padding: .08em 0 0 0;
margin: 0;
}
#previewframe h2 {
font-size: 22px;
line-height: normal;
margin: 22px 0 0;
padding: 7px 0 0;
}
#previewframe h3 {
font-size: 16px;
line-height: 26px;
padding: 26px 0 0;
}
#previewframe h4 {
font-size: 14px;
line-height: 26px;
padding: 18px 0 4px;
font-weight: bold;
text-transform: uppercase;
}
#previewframe h5 {
font-size: 13px;
line-height: 26px;
margin-bottom: -19px;
padding: 14px 0 0;
font-weight: bold;
text-transform: uppercase;
}
#previewframe h6 {
color: #666;
font-size: 14px;
line-height: 26px;
margin-bottom: -19px;
padding: 18px 0 0;
font-weight: normal;
font-variant: italic;
}
/* Border Reset for headers with horizontal rules */
#previewframe > h2:first-child,
#previewframe > h1:first-child {
margin: 12px 0 0;
padding: 10px 0 0;
}
/* Lists, Blockquotes & Such */
#previewframe ul,
#previewframe ol {
margin-top: 1.5em;
margin-left: 2.6em;
}
/* Nested Lists */
#previewframe ul li,
#previewframe ol li,
#previewframe ul li ul,
#previewframe ol li ol,
#previewframe ul li ol,
#previewframe ol li ul,
#previewframe ul ul,
#previewframe ol ol {
padding: 0;
margin: .5em 0;
}
#previewframe dl {
margin: 0;
padding: 20px 0 0;
}
#previewframe dl dt {
font-size: 14px;
font-weight: bold;
line-height: normal;
margin: 0;
padding: 20px 0 0;
}
#previewframe dl dt:first-child {
padding: 0;
}
#previewframe dl dd {
font-size: 13px;
margin: 0;
padding: 3px 0 0;
}
/* Tables */
#previewframe table {
border-collapse: collapse;
margin: 20px 0 0;
padding: 0;
}
#previewframe table * tr {
border-top: 1px solid #ccc;
background-color: #fff;
margin: 0;
padding: 0;
}
#previewframe table * tr:nth-child(2n) {
background-color: #f8f8f8;
}
#previewframe table * tr th,
#previewframe table * tr td {
border: 1px solid #ccc;
text-align: left;
margin: 0;
padding: 6px 13px;
}
/* Images & Stuff */
#previewframe img {
max-width: 100%;
}
/* Gollum Image Tags */
/* Framed */
#previewframe span.frame {
display: block;
overflow: hidden;
}
#previewframe span.frame > span {
border: 1px solid #ddd;
display: block;
float: left;
overflow: hidden;
margin: 13px 0 0;
padding: 7px;
width: auto;
}
#previewframe span.frame span img {
display: block;
float: left;
}
#previewframe span.frame span span {
clear: both;
color: #333;
display: block;
padding: 5px 0 0;
}
#previewframe span.align-center {
display: block;
overflow: hidden;
clear: both;
}
#previewframe span.align-center > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: center;
}
#previewframe span.align-center span img {
margin: 0 auto;
text-align: center;
}
#previewframe span.align-right {
display: block;
overflow: hidden;
clear: both;
}
#previewframe span.align-right > span {
display: block;
overflow: hidden;
margin: 13px 0 0;
text-align: right;
}
#previewframe span.align-right span img {
margin: 0;
text-align: right;
}
#previewframe span.float-left {
display: block;
margin-right: 13px;
overflow: hidden;
float: left;
}
#previewframe span.float-left span {
margin: 13px 0 0;
}
#previewframe span.float-right {
display: block;
margin-left: 13px;
overflow: hidden;
float: right;
}
#previewframe span.float-right > span {
display: block;
overflow: hidden;
margin: 13px auto 0;
text-align: right;
}
/* Code */
#previewframe code, #previewframe tt {
background-color: #f8f8f8;
border: 1px solid #dedede;
font-size: 13px;
padding: 0;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
#previewframe .highlight code, #previewframe code {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
pre, code {
font: 12px 'Bitstream Vera Sans Mono','Courier',monospace
}
#previewframe pre code, #previewframe pre tt {
background-color: transparent;
border: none;
}
/*
no highlight rules for client side preview mode! (we're using highlight.js instead of pygments)
*/
@@ -0,0 +1,129 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
code {
display: block; padding: 0.5em;
color: #000;
background: #f8f8ff
}
code .comment,
code .template_comment,
code .diff .header,
code .javadoc {
color: #998;
font-style: italic
}
code .keyword,
code .css .rule .keyword,
code .winutils,
code .javascript .title,
code .lisp .title,
code .subst {
color: #000;
font-weight: bold
}
code .number,
code .hexcolor {
color: #40a070
}
code .string,
code .tag .value,
code .phpdoc,
code .tex .formula {
color: #d14
}
code .title,
code .id {
color: #900;
font-weight: bold
}
code .javascript .title,
code .lisp .title,
code .subst {
font-weight: normal
}
code .class .title,
code .haskell .label,
code .tex .command {
color: #458;
font-weight: bold
}
code .tag,
code .tag .title,
code .rules .property,
code .django .tag .keyword {
color: #000080;
font-weight: normal
}
code .attribute,
code .variable,
code .instancevar,
code .lisp .body {
color: #008080
}
code .regexp {
color: #009926
}
code .class {
color: #458;
font-weight: bold
}
code .symbol,
code .ruby .symbol .string,
code .ruby .symbol .keyword,
code .ruby .symbol .keymethods,
code .lisp .keyword,
code .tex .special,
code .input_number {
color: #990073
}
code .builtin,
code .built_in,
code .lisp .title {
color: #0086b3
}
code .preprocessor,
code .pi,
code .doctype,
code .shebang,
code .cdata {
color: #999;
font-weight: bold
}
code .deletion {
background: #fdd
}
code .addition {
background: #dfd
}
code .diff .change {
background: #0086b3
}
code .chunk {
color: #aaa
}
code .tex .formula {
opacity: 0.5;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

@@ -0,0 +1,242 @@
<html>
<head>
<title>JavaScript Markdown Editor</title>
<link rel="stylesheet" type="text/css" href="css/gollum/template.css" />
<link rel="stylesheet" type="text/css" href="css/highlightjs/github.css" />
<link rel="stylesheet" type="text/css" href="css/custom.css" />
<script src="js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/mode-markdown.js" type="text/javascript" charset="utf-8"></script>
<script src="js/pagedown/Markdown.Converter.js" type="text/javascript" charset="utf-8"></script>
<script src="js/pagedown/Markdown.Sanitizer.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/highlightjs/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="editor"># Header 1
## Header 2
### Header 3
[link](http://www.example.com)
![Image example](https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png?1329920549)
**bold**
*italic*
`code`
```ruby
puts 'code highlighting'
puts "!"
```
Code blocks:
puts 'code' + \
'block'
- unordered list
- unordered list
- unordered list
----
0. ordered list
0. ordered list
0. ordered list
> Block Quote</div>
<div id="previewframe"><div id="contentframe"></div></div>
<!-- tool panel and save from notepage.es -->
<div id="toolpanel" class="edit" style="width: 500px; right: 0px; ">
<a id="save" class="edit"><img src="images/save_24.png" alt="save" title="save"></a>
<a id="toggle" class="edit" href="javascript:void(0)" onclick="jsm.toggleLeftRight();"><img src="images/lr_24.png" alt="Toggle left to right" title="Toggle left to right"></a>
</div>
<script type="text/javascript">
(function () {
var converter = Markdown.getSanitizingConverter();
var editor = ace.edit("editor");
var editorSession = editor.getSession();
var preview = document.getElementById("previewframe");
var content = document.getElementById("contentframe");
var toolPanel = document.getElementById("toolpanel");
var leftRight = true;
var jsm = {}; // JavaScript Markdown
window.jsm = jsm;
window.jsm.toggleLeftRight = function() {
leftRight = leftRight === false ? true : false;
jsm.resize();
}
editor.setTheme("ace/theme/twilight");
var MarkdownMode = require("ace/mode/markdown").Mode;
editorSession.setMode(new MarkdownMode());
// Gutter shows line numbers
editor.renderer.setShowGutter(true);
editor.renderer.setHScrollBarAlwaysVisible(false);
editorSession.setUseSoftTabs(true);
editorSession.setTabSize(2);
editorSession.setUseWrapMode(true);
editor.setShowPrintMargin(false);
editor.setBehavioursEnabled(true);
window.onload = function() {
// onChange calls applyTimeout which rate limits the calling of makePreviewHtml based on render time.
editor.on('change', applyTimeout);
makePreviewHtml(); // preview default text on load
function resize() {
var ace = editor.container;//document.getElementById("editor");
var widthHalf = $(window).width() / 2;
var height = $(window).height();
ace.style.width = widthHalf + "px";
// Minus 50 so the end of document text doesn't flow off the page.
ace.style.height = height - 50 + "px";
ace.style.left = leftRight === false ? widthHalf + "px" : "0px";
ace.style.top = "40px"; // use 40px for tool menu
ace.style.fontSize = 16 + "px";
editor.resize();
var previewFrame = document.getElementById("previewframe");
previewFrame.style.width = widthHalf - 2 - 10 + "px"; // -2 for scroll bar & -10 for left offset
previewFrame.style.height = height + "px";
previewFrame.style.left = leftRight === false ? "10px" : widthHalf + "px";
previewFrame.style.top = "0px";
// Resize tool panel
toolPanel.style.width = widthHalf + "px";
toolPanel.style.left = leftRight === false ? widthHalf + "px" : "0px";
}
window.jsm.resize = resize;
$(window).resize(function() {
resize();
});
// resize for the intial page load
resize();
};
var elapsedTime;
var oldInputText = "";
// ---- from Markdown.Editor
var previewSetter;
var timeout;
var nonSuckyBrowserPreviewSet = function (text) {
content.innerHTML = text;
}
// IE doesn't let you use innerHTML if the element is contained somewhere in a table
// (which is the case for inline editing) -- in that case, detach the element, set the
// value, and reattach. Yes, that *is* ridiculous.
var ieSafePreviewSet = function (text) {
var parent = content.parentNode;
var sibling = content.nextSibling;
parent.removeChild(content);
content.innerHTML = text;
if (!sibling)
parent.appendChild(content);
else
parent.insertBefore(content, sibling);
}
var previewSet = function (text) {
if (previewSetter)
return previewSetter(text);
try {
nonSuckyBrowserPreviewSet(text);
previewSetter = nonSuckyBrowserPreviewSet;
} catch (e) {
previewSetter = ieSafePreviewSet;
previewSetter(text);
}
};
var languages = [ "1c", "actionscript", "apache", "avrasm", "axapta",
"bash", "cmake", "coffeescript", "cpp", "cs", "css", "delphi", "diff",
"django", "d", "dos", "erlang", "erlang-repl", "go", "haskell", "ini",
"java", "javascript", "languages", "lisp", "lua", "markdown", "matlab",
"mel", "nginx", "objectivec", "parser3", "perl", "php", "profile",
"python", "renderman", "ruby", "rust", "scala", "smalltalk", "sql",
"tex", "vala", "vbscript", "vhdl", "xml" ];
var makePreviewHtml = function () {
var text = editorSession.getValue();
if (text && text == oldInputText) {
return; // Input text hasn't changed.
}
else {
oldInputText = text;
}
var prevTime = new Date().getTime();
text = converter.makeHtml(text);
// Calculate the processing time of the HTML creation.
// It's used as the delay time in the event listener.
var currTime = new Date().getTime();
elapsedTime = currTime - prevTime;
// Update the text using feature detection to support IE.
// preview.innerHTML = text; // this doesn't work on IE.
previewSet(text);
// highlight code blocks.
var codeElements = preview.getElementsByTagName("code");
var codeElementsLength = codeElements.length;
if (codeElementsLength > 0) {
for (var idx = 0; idx < codeElementsLength; idx++) {
var element = codeElements[idx];
var codeHTML = element.innerHTML;
var txt = element.innerHTML.split(/\b/);
// the syntax for code highlighting means all code, even one line, contains newlines.
if (txt.length > 0 && codeHTML.match(/\n/)) {
if ($.inArray(txt[0], languages) === -1) {
continue;
}
element.className = txt[0] + " highlight";
element.innerHTML = codeHTML.substring(txt[0].length);
hljs.highlightBlock(element, " ");
} else {
element.className = "nohighlight";
}
}
}
};
// setTimeout is already used. Used as an event listener.
var applyTimeout = function () {
if (timeout) {
clearTimeout(timeout);
timeout = undefined;
}
// 3 second max delay
if (elapsedTime > 3000) {
elapsedTime = 3000;
}
timeout = setTimeout(makePreviewHtml, elapsedTime);
};
})();
</script>
</body>
</html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(a,b,c){b.isDark=!0,b.cssClass="ace-twilight",b.cssText=".ace-twilight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-twilight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-twilight .ace_gutter { background: #e8e8e8; color: #333;}.ace-twilight .ace_print_margin { width: 1px; background: #e8e8e8;}.ace-twilight .ace_scroller { background-color: #141414;}.ace-twilight .ace_text-layer { cursor: text; color: #F8F8F8;}.ace-twilight .ace_cursor { border-left: 1px solid #A7A7A7;}.ace-twilight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;}.ace-twilight .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-twilight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-twilight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-twilight .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);}.ace-twilight .ace_marker-layer .ace_selected_word { border: 1px solid rgba(221, 240, 255, 0.20);}.ace-twilight .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-twilight .ace_keyword, .ace-twilight .ace_meta { color:#CDA869;}.ace-twilight .ace_constant, .ace-twilight .ace_constant.ace_other { color:#CF6A4C;}.ace-twilight .ace_constant.ace_character, { color:#CF6A4C;}.ace-twilight .ace_constant.ace_character.ace_escape, { color:#CF6A4C;}.ace-twilight .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-twilight .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-twilight .ace_support { color:#9B859D;}.ace-twilight .ace_support.ace_constant { color:#CF6A4C;}.ace-twilight .ace_fold { background-color: #AC885B; border-color: #F8F8F8;}.ace-twilight .ace_support.ace_function { color:#DAD085;}.ace-twilight .ace_storage { color:#F9EE98;}.ace-twilight .ace_variable { color:#AC885B;}.ace-twilight .ace_string { color:#8F9D6A;}.ace-twilight .ace_string.ace_regexp { color:#E9C062;}.ace-twilight .ace_comment { font-style:italic;color:#5F5A60;}.ace-twilight .ace_variable { color:#7587A6;}.ace-twilight .ace_xml_pe { color:#494949;}.ace-twilight .ace_meta.ace_tag { color:#AC885B;}.ace-twilight .ace_entity.ace_name.ace_function { color:#AC885B;}.ace-twilight .ace_markup.ace_underline { text-decoration:underline;}.ace-twilight .ace_markup.ace_heading { color:#CF6A4C;}.ace-twilight .ace_markup.ace_list { color:#F9EE98;}";var d=a("../lib/dom");d.importCssString(b.cssText,b.cssClass)})
File diff suppressed because one or more lines are too long
@@ -0,0 +1,98 @@
/*
Language: 1C
Author: Yuri Ivanov <ivanov@supersoft.ru>
Contributors: Sergey Baranov <segyrn@yandex.ru>
*/
hljs.LANGUAGES['1c'] = function(){
var IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
var OneS_KEYWORDS = {
'возврат':1,'дата':1,'для':1,'если':1,'и':1,'или':1,'иначе':1,'иначеесли':1,'исключение':1,'конецесли':1,
'конецпопытки':1,'конецпроцедуры':1,'конецфункции':1,'конеццикла':1,'константа':1,'не':1,'перейти':1,'перем':1,
'перечисление':1,'по':1,'пока':1,'попытка':1,'прервать':1,'продолжить':1,'процедура':1,'строка':1,'тогда':1,
'фс':1,'функция':1,'цикл':1,'число':1,'экспорт':1
};
var OneS_BUILT_IN = {
'ansitooem':1,'oemtoansi':1,'ввестивидсубконто':1,'ввестидату':1,'ввестизначение':1,'ввестиперечисление':1,
'ввестипериод':1,'ввестиплансчетов':1,'ввестистроку':1,'ввестичисло':1,'вопрос':1,'восстановитьзначение':1,
'врег':1,'выбранныйплансчетов':1,'вызватьисключение':1,'датагод':1,'датамесяц':1,'датачисло':1,'добавитьмесяц':1,
'завершитьработусистемы':1,'заголовоксистемы':1,'записьжурналарегистрации':1,'запуститьприложение':1,
'зафиксироватьтранзакцию':1,'значениевстроку':1,'значениевстрокувнутр':1,'значениевфайл':1,'значениеизстроки':1,
'значениеизстрокивнутр':1,'значениеизфайла':1,'имякомпьютера':1,'имяпользователя':1,'каталогвременныхфайлов':1,
'каталогиб':1,'каталогпользователя':1,'каталогпрограммы':1,'кодсимв':1,'командасистемы':1,'конгода':1,
'конецпериодаби':1,'конецрассчитанногопериодаби':1,'конецстандартногоинтервала':1,'конквартала':1,'конмесяца':1,
'коннедели':1,'лев':1,'лог':1,'лог10':1,'макс':1,'максимальноеколичествосубконто':1,'мин':1,'монопольныйрежим':1,
'названиеинтерфейса':1,'названиенабораправ':1,'назначитьвид':1,'назначитьсчет':1,'найти':1,
'найтипомеченныенаудаление':1,'найтиссылки':1,'началопериодаби':1,'началостандартногоинтервала':1,
'начатьтранзакцию':1,'начгода':1,'начквартала':1,'начмесяца':1,'начнедели':1,'номерднягода':1,'номерднянедели':1,
'номернеделигода':1,'нрег':1,'обработкаожидания':1,'окр':1,'описаниеошибки':1,'основнойжурналрасчетов':1,
'основнойплансчетов':1,'основнойязык':1,'открытьформу':1,'открытьформумодально':1,'отменитьтранзакцию':1,
'очиститьокносообщений':1,'периодстр':1,'полноеимяпользователя':1,'получитьвремята':1,'получитьдатута':1,
'получитьдокументта':1,'получитьзначенияотбора':1,'получитьпозициюта':1,'получитьпустоезначение':1,
'получитьта':1,'прав':1,'праводоступа':1,'предупреждение':1,'префиксавтонумерации':1,'пустаястрока':1,
'пустоезначение':1,'рабочаядаттьпустоезначение':1,'рабочаядата':1,'разделительстраниц':1,'разделительстрок':1,
'разм':1,'разобратьпозициюдокумента':1,'рассчитатьрегистрына':1,'рассчитатьрегистрыпо':1,'сигнал':1,'симв':1,
'символтабуляции':1,'создатьобъект':1,'сокрл':1,'сокрлп':1,'сокрп':1,' сообщить':1,'состояние':1,
'сохранитьзначение':1,'сред':1,'статусвозврата':1,'стрдлина':1,'стрзаменить':1,'стрколичествострок':1,
'стрполучитьстроку':1,' стрчисловхождений':1,'сформироватьпозициюдокумента':1,'счетпокоду':1,'текущаядата':1,
'текущеевремя':1,'типзначения':1,'типзначениястр':1,'удалитьобъекты':1,'установитьтана':1,'установитьтапо':1,
'фиксшаблон':1,'формат':1,'цел':1,'шаблон':1
};
var DQUOTE = {className: 'dquote', begin: '""'};
var STR_START = {
className: 'string',
begin: '"', end: '"|$',
contains: [DQUOTE],
relevance: 0
};
var STR_CONT = {
className: 'string',
begin: '\\|', end: '"|$',
contains: [DQUOTE]
};
return {
case_insensitive: true,
defaultMode: {
lexems: IDENT_RE_RU,
keywords: {'keyword':OneS_KEYWORDS,'built_in':OneS_BUILT_IN},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.NUMBER_MODE,
STR_START, STR_CONT,
{
className: 'function',
begin: '(процедура|функция)', end: '$',
lexems: IDENT_RE_RU,
keywords: {'процедура': 1, 'функция': 1},
contains: [
{className: 'title', begin: IDENT_RE_RU},
{
className: 'tail',
endsWithParent: true,
contains: [
{
className: 'params',
begin: '\\(', end: '\\)',
lexems: IDENT_RE_RU,
keywords: {'знач':1},
contains: [STR_START, STR_CONT]
},
{
className: 'export',
begin: 'экспорт', endsWithParent: true,
lexems: IDENT_RE_RU,
keywords: {'экспорт': 1},
contains: [hljs.C_LINE_COMMENT_MODE]
}
]
},
hljs.C_LINE_COMMENT_MODE
]
},
{className: 'preprocessor', begin: '#', end: '$'},
{className: 'date', begin: '\'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})\''}
]
}
};
}();
@@ -0,0 +1,94 @@
/*
Language: ActionScript
Author: Alexander Myadzel <myadzel@gmail.com>
*/
hljs.LANGUAGES.actionscript = function() {
var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
var AS3_REST_ARG_MODE = {
className: 'rest_arg',
begin: '[.]{3}', end: IDENT_RE,
relevance: 10
};
var TITLE_MODE = {className: 'title', begin: IDENT_RE};
return {
defaultMode: {
keywords: {
'keyword': {
'as': 1, 'break': 1, 'case': 1, 'catch': 1, 'class': 1, 'const': 1, 'continue': 1, 'default': 1,
'delete': 1, 'do': 1, 'dynamic': 5, 'each': 1, 'else': 1, 'extends': 1, 'final': 1, 'finally': 1,
'for': 1, 'function': 1, 'get': 1, 'if': 1, 'implements': 1, 'import': 1, 'in': 1, 'include': 1,
'instanceof': 1, 'interface': 1, 'internal': 1, 'is': 1, 'namespace': 1, 'native': 1, 'new': 1,
'override': 1, 'package': 1, 'private': 1, 'protected': 1, 'public': 1, 'return': 1, 'set': 1,
'static': 1, 'super': 5, 'switch': 1, 'this': 1, 'throw': 1, 'try': 1, 'typeof': 1, 'use': 1,
'var': 1, 'void': 1, 'while': 1, 'with': 1
},
'literal': {'true': 1, 'false': 1, 'null': 1, 'undefined': 1},
'reserved': {
'abstract': 0, 'boolean': 0, 'byte': 0, 'cast': 0, 'char': 0, 'debugger': 0, 'double': 0, 'enum': 0,
'export': 0, 'float': 0, 'goto': 0, 'intrinsic': 0, 'long': 0, 'prototype': 0, 'short': 0,
'synchronized': 0, 'throws': 0, 'to': 0, 'transient': 0, 'type': 0, 'virtual': 0, 'volatile': 0
}
},
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
{
className: 'package',
begin: 'package ?', end: '{',
keywords: {'package': 1},
contains: [TITLE_MODE]
},
{
className: 'class',
beginWithKeyword: true, end: '{',
keywords: {'class': 1, 'interface': 1},
contains: [
{
beginWithKeyword: true,
keywords: {'extends': 1, 'implements': 1},
relevance: 5
},
TITLE_MODE
]
},
{
className: 'preprocessor',
beginWithKeyword: true, end: ';',
keywords: {'import': 1, 'include': 1}
},
{
className: 'function',
beginWithKeyword: true, end: '[{;]',
keywords: {'function': 1},
contains: [
TITLE_MODE,
{
className: 'params',
begin: '\\(', end: '\\)',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
AS3_REST_ARG_MODE
]
},
{
className: 'type',
begin: ':',
end: IDENT_FUNC_RETURN_TYPE_RE,
relevance: 10
}
]
}
]
}
}
}();
@@ -0,0 +1,434 @@
/*
Language: Apache
Author: Ruslan Keba <rukeba@gmail.com>
Website: http://rukeba.com/
Description: language definition for Apache configuration files (httpd.conf & .htaccess)
Version: 1.1
Date: 2008-12-27
*/
hljs.LANGUAGES.apache = function(){
var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
return {
case_insensitive: true,
defaultMode: {
keywords: {
'keyword': {
'acceptfilter': 1,
'acceptmutex': 1,
'acceptpathinfo': 1,
'accessfilename': 1,
'action': 1,
'addalt': 1,
'addaltbyencoding': 1,
'addaltbytype': 1,
'addcharset': 1,
'adddefaultcharset': 1,
'adddescription': 1,
'addencoding': 1,
'addhandler': 1,
'addicon': 1,
'addiconbyencoding': 1,
'addiconbytype': 1,
'addinputfilter': 1,
'addlanguage': 1,
'addmoduleinfo': 1,
'addoutputfilter': 1,
'addoutputfilterbytype': 1,
'addtype': 1,
'alias': 1,
'aliasmatch': 1,
'allow': 1,
'allowconnect': 1,
'allowencodedslashes': 1,
'allowoverride': 1,
'anonymous': 1,
'anonymous_logemail': 1,
'anonymous_mustgiveemail': 1,
'anonymous_nouserid': 1,
'anonymous_verifyemail': 1,
'authbasicauthoritative': 1,
'authbasicprovider': 1,
'authdbduserpwquery': 1,
'authdbduserrealmquery': 1,
'authdbmgroupfile': 1,
'authdbmtype': 1,
'authdbmuserfile': 1,
'authdefaultauthoritative': 1,
'authdigestalgorithm': 1,
'authdigestdomain': 1,
'authdigestnccheck': 1,
'authdigestnonceformat': 1,
'authdigestnoncelifetime': 1,
'authdigestprovider': 1,
'authdigestqop': 1,
'authdigestshmemsize': 1,
'authgroupfile': 1,
'authldapbinddn': 1,
'authldapbindpassword': 1,
'authldapcharsetconfig': 1,
'authldapcomparednonserver': 1,
'authldapdereferencealiases': 1,
'authldapgroupattribute': 1,
'authldapgroupattributeisdn': 1,
'authldapremoteuserattribute': 1,
'authldapremoteuserisdn': 1,
'authldapurl': 1,
'authname': 1,
'authnprovideralias': 1,
'authtype': 1,
'authuserfile': 1,
'authzdbmauthoritative': 1,
'authzdbmtype': 1,
'authzdefaultauthoritative': 1,
'authzgroupfileauthoritative': 1,
'authzldapauthoritative': 1,
'authzownerauthoritative': 1,
'authzuserauthoritative': 1,
'balancermember': 1,
'browsermatch': 1,
'browsermatchnocase': 1,
'bufferedlogs': 1,
'cachedefaultexpire': 1,
'cachedirlength': 1,
'cachedirlevels': 1,
'cachedisable': 1,
'cacheenable': 1,
'cachefile': 1,
'cacheignorecachecontrol': 1,
'cacheignoreheaders': 1,
'cacheignorenolastmod': 1,
'cacheignorequerystring': 1,
'cachelastmodifiedfactor': 1,
'cachemaxexpire': 1,
'cachemaxfilesize': 1,
'cacheminfilesize': 1,
'cachenegotiateddocs': 1,
'cacheroot': 1,
'cachestorenostore': 1,
'cachestoreprivate': 1,
'cgimapextension': 1,
'charsetdefault': 1,
'charsetoptions': 1,
'charsetsourceenc': 1,
'checkcaseonly': 1,
'checkspelling': 1,
'chrootdir': 1,
'contentdigest': 1,
'cookiedomain': 1,
'cookieexpires': 1,
'cookielog': 1,
'cookiename': 1,
'cookiestyle': 1,
'cookietracking': 1,
'coredumpdirectory': 1,
'customlog': 1,
'dav': 1,
'davdepthinfinity': 1,
'davgenericlockdb': 1,
'davlockdb': 1,
'davmintimeout': 1,
'dbdexptime': 1,
'dbdkeep': 1,
'dbdmax': 1,
'dbdmin': 1,
'dbdparams': 1,
'dbdpersist': 1,
'dbdpreparesql': 1,
'dbdriver': 1,
'defaulticon': 1,
'defaultlanguage': 1,
'defaulttype': 1,
'deflatebuffersize': 1,
'deflatecompressionlevel': 1,
'deflatefilternote': 1,
'deflatememlevel': 1,
'deflatewindowsize': 1,
'deny': 1,
'directoryindex': 1,
'directorymatch': 1,
'directoryslash': 1,
'documentroot': 1,
'dumpioinput': 1,
'dumpiologlevel': 1,
'dumpiooutput': 1,
'enableexceptionhook': 1,
'enablemmap': 1,
'enablesendfile': 1,
'errordocument': 1,
'errorlog': 1,
'example': 1,
'expiresactive': 1,
'expiresbytype': 1,
'expiresdefault': 1,
'extendedstatus': 1,
'extfilterdefine': 1,
'extfilteroptions': 1,
'fileetag': 1,
'filterchain': 1,
'filterdeclare': 1,
'filterprotocol': 1,
'filterprovider': 1,
'filtertrace': 1,
'forcelanguagepriority': 1,
'forcetype': 1,
'forensiclog': 1,
'gracefulshutdowntimeout': 1,
'group': 1,
'header': 1,
'headername': 1,
'hostnamelookups': 1,
'identitycheck': 1,
'identitychecktimeout': 1,
'imapbase': 1,
'imapdefault': 1,
'imapmenu': 1,
'include': 1,
'indexheadinsert': 1,
'indexignore': 1,
'indexoptions': 1,
'indexorderdefault': 1,
'indexstylesheet': 1,
'isapiappendlogtoerrors': 1,
'isapiappendlogtoquery': 1,
'isapicachefile': 1,
'isapifakeasync': 1,
'isapilognotsupported': 1,
'isapireadaheadbuffer': 1,
'keepalive': 1,
'keepalivetimeout': 1,
'languagepriority': 1,
'ldapcacheentries': 1,
'ldapcachettl': 1,
'ldapconnectiontimeout': 1,
'ldapopcacheentries': 1,
'ldapopcachettl': 1,
'ldapsharedcachefile': 1,
'ldapsharedcachesize': 1,
'ldaptrustedclientcert': 1,
'ldaptrustedglobalcert': 1,
'ldaptrustedmode': 1,
'ldapverifyservercert': 1,
'limitinternalrecursion': 1,
'limitrequestbody': 1,
'limitrequestfields': 1,
'limitrequestfieldsize': 1,
'limitrequestline': 1,
'limitxmlrequestbody': 1,
'listen': 1,
'listenbacklog': 1,
'loadfile': 1,
'loadmodule': 1,
'lockfile': 1,
'logformat': 1,
'loglevel': 1,
'maxclients': 1,
'maxkeepaliverequests': 1,
'maxmemfree': 1,
'maxrequestsperchild': 1,
'maxrequestsperthread': 1,
'maxspareservers': 1,
'maxsparethreads': 1,
'maxthreads': 1,
'mcachemaxobjectcount': 1,
'mcachemaxobjectsize': 1,
'mcachemaxstreamingbuffer': 1,
'mcacheminobjectsize': 1,
'mcacheremovalalgorithm': 1,
'mcachesize': 1,
'metadir': 1,
'metafiles': 1,
'metasuffix': 1,
'mimemagicfile': 1,
'minspareservers': 1,
'minsparethreads': 1,
'mmapfile': 1,
'mod_gzip_on': 1,
'mod_gzip_add_header_count': 1,
'mod_gzip_keep_workfiles': 1,
'mod_gzip_dechunk': 1,
'mod_gzip_min_http': 1,
'mod_gzip_minimum_file_size': 1,
'mod_gzip_maximum_file_size': 1,
'mod_gzip_maximum_inmem_size': 1,
'mod_gzip_temp_dir': 1,
'mod_gzip_item_include': 1,
'mod_gzip_item_exclude': 1,
'mod_gzip_command_version': 1,
'mod_gzip_can_negotiate': 1,
'mod_gzip_handle_methods': 1,
'mod_gzip_static_suffix': 1,
'mod_gzip_send_vary': 1,
'mod_gzip_update_static': 1,
'modmimeusepathinfo': 1,
'multiviewsmatch': 1,
'namevirtualhost': 1,
'noproxy': 1,
'nwssltrustedcerts': 1,
'nwsslupgradeable': 1,
'options': 1,
'order': 1,
'passenv': 1,
'pidfile': 1,
'protocolecho': 1,
'proxybadheader': 1,
'proxyblock': 1,
'proxydomain': 1,
'proxyerroroverride': 1,
'proxyftpdircharset': 1,
'proxyiobuffersize': 1,
'proxymaxforwards': 1,
'proxypass': 1,
'proxypassinterpolateenv': 1,
'proxypassmatch': 1,
'proxypassreverse': 1,
'proxypassreversecookiedomain': 1,
'proxypassreversecookiepath': 1,
'proxypreservehost': 1,
'proxyreceivebuffersize': 1,
'proxyremote': 1,
'proxyremotematch': 1,
'proxyrequests': 1,
'proxyset': 1,
'proxystatus': 1,
'proxytimeout': 1,
'proxyvia': 1,
'readmename': 1,
'receivebuffersize': 1,
'redirect': 1,
'redirectmatch': 1,
'redirectpermanent': 1,
'redirecttemp': 1,
'removecharset': 1,
'removeencoding': 1,
'removehandler': 1,
'removeinputfilter': 1,
'removelanguage': 1,
'removeoutputfilter': 1,
'removetype': 1,
'requestheader': 1,
'require': 2,
'rewritebase': 1,
'rewritecond': 10,
'rewriteengine': 1,
'rewritelock': 1,
'rewritelog': 1,
'rewriteloglevel': 1,
'rewritemap': 1,
'rewriteoptions': 1,
'rewriterule': 10,
'rlimitcpu': 1,
'rlimitmem': 1,
'rlimitnproc': 1,
'satisfy': 1,
'scoreboardfile': 1,
'script': 1,
'scriptalias': 1,
'scriptaliasmatch': 1,
'scriptinterpretersource': 1,
'scriptlog': 1,
'scriptlogbuffer': 1,
'scriptloglength': 1,
'scriptsock': 1,
'securelisten': 1,
'seerequesttail': 1,
'sendbuffersize': 1,
'serveradmin': 1,
'serveralias': 1,
'serverlimit': 1,
'servername': 1,
'serverpath': 1,
'serverroot': 1,
'serversignature': 1,
'servertokens': 1,
'setenv': 1,
'setenvif': 1,
'setenvifnocase': 1,
'sethandler': 1,
'setinputfilter': 1,
'setoutputfilter': 1,
'ssienableaccess': 1,
'ssiendtag': 1,
'ssierrormsg': 1,
'ssistarttag': 1,
'ssitimeformat': 1,
'ssiundefinedecho': 1,
'sslcacertificatefile': 1,
'sslcacertificatepath': 1,
'sslcadnrequestfile': 1,
'sslcadnrequestpath': 1,
'sslcarevocationfile': 1,
'sslcarevocationpath': 1,
'sslcertificatechainfile': 1,
'sslcertificatefile': 1,
'sslcertificatekeyfile': 1,
'sslciphersuite': 1,
'sslcryptodevice': 1,
'sslengine': 1,
'sslhonorciperorder': 1,
'sslmutex': 1,
'ssloptions': 1,
'sslpassphrasedialog': 1,
'sslprotocol': 1,
'sslproxycacertificatefile': 1,
'sslproxycacertificatepath': 1,
'sslproxycarevocationfile': 1,
'sslproxycarevocationpath': 1,
'sslproxyciphersuite': 1,
'sslproxyengine': 1,
'sslproxymachinecertificatefile': 1,
'sslproxymachinecertificatepath': 1,
'sslproxyprotocol': 1,
'sslproxyverify': 1,
'sslproxyverifydepth': 1,
'sslrandomseed': 1,
'sslrequire': 1,
'sslrequiressl': 1,
'sslsessioncache': 1,
'sslsessioncachetimeout': 1,
'sslusername': 1,
'sslverifyclient': 1,
'sslverifydepth': 1,
'startservers': 1,
'startthreads': 1,
'substitute': 1,
'suexecusergroup': 1,
'threadlimit': 1,
'threadsperchild': 1,
'threadstacksize': 1,
'timeout': 1,
'traceenable': 1,
'transferlog': 1,
'typesconfig': 1,
'unsetenv': 1,
'usecanonicalname': 1,
'usecanonicalphysicalport': 1,
'user': 1,
'userdir': 1,
'virtualdocumentroot': 1,
'virtualdocumentrootip': 1,
'virtualscriptalias': 1,
'virtualscriptaliasip': 1,
'win32disableacceptex': 1,
'xbithack': 1
},
'literal': {'on': 1, 'off': 1}
},
contains: [
hljs.HASH_COMMENT_MODE,
{
className: 'sqbracket',
begin: '\\s\\[', end: '\\]$'
},
{
className: 'cbracket',
begin: '[\\$%]\\{', end: '\\}',
contains: ['self', NUMBER]
},
NUMBER,
{className: 'tag', begin: '</?', end: '>'},
hljs.QUOTE_STRING_MODE
]
}
};
}();
@@ -0,0 +1,75 @@
/*
Language: AVR Assembler
Author: Vladimir Ermakov <vooon341@gmail.com>
*/
hljs.LANGUAGES.avrasm =
{
case_insensitive: true,
defaultMode: {
keywords: {
'keyword': {
/* mnemonic */
'adc': 1, 'add': 1 , 'adiw': 1 , 'and': 1 , 'andi': 1 , 'asr': 1 , 'bclr': 1 , 'bld': 1 , 'brbc': 1 , 'brbs': 1 , 'brcc': 1 ,
'brcs': 1, 'break': 1, 'breq': 1, 'brge': 1, 'brhc': 1, 'brhs': 1, 'brid': 1, 'brie': 1, 'brlo': 1, 'brlt': 1, 'brmi': 1,
'brne': 1, 'brpl': 1, 'brsh': 1, 'brtc': 1, 'brts': 1, 'brvc': 1, 'brvs': 1, 'bset': 1, 'bst': 1, 'call': 1, 'cbi': 1,
'cbr': 1, 'clc': 1, 'clh': 1, 'cli': 1, 'cln': 1, 'clr': 1, 'cls': 1, 'clt': 1, 'clv': 1, 'clz': 1, 'com': 1, 'cp': 1,
'cpc': 1, 'cpi': 1, 'cpse': 1, 'dec': 1, 'eicall': 1, 'eijmp': 1, 'elpm': 1, 'eor': 1, 'fmul': 1, 'fmuls': 1, 'fmulsu': 1,
'icall': 1, 'ijmp': 1, 'in': 1, 'inc': 1, 'jmp': 1, 'ld': 1, 'ldd': 1, 'ldi': 1, 'lds': 1, 'lpm': 1, 'lsl': 1, 'lsr': 1,
'mov': 1, 'movw': 1, 'mul': 1, 'muls': 1, 'mulsu': 1, 'neg': 1, 'nop': 1, 'or': 1, 'ori': 1, 'out': 1, 'pop': 1, 'push': 1,
'rcall': 1, 'ret': 1, 'reti': 1, 'rjmp': 1, 'rol': 1, 'ror': 1, 'sbc': 1, 'sbr': 1, 'sbrc': 1, 'sbrs': 1, 'sec': 1, 'seh': 1,
'sbi': 1, 'sbci': 1, 'sbic': 1, 'sbis': 1, 'sbiw': 1, 'sei': 1, 'sen': 1, 'ser': 1, 'ses': 1, 'set': 1, 'sev': 1, 'sez': 1,
'sleep': 1, 'spm': 1, 'st': 1, 'std': 1, 'sts': 1, 'sub': 1, 'subi': 1, 'swap': 1, 'tst': 1, 'wdr': 1
},
'built_in': {
/* general purpose registers */
'r0': 1, 'r1': 1, 'r2': 1, 'r3': 1, 'r4': 1, 'r5': 1, 'r6': 1, 'r7': 1, 'r8': 1, 'r9': 1, 'r10': 1, 'r11': 1, 'r12': 1,
'r13': 1, 'r14': 1, 'r15': 1, 'r16': 1, 'r17': 1, 'r18': 1, 'r19': 1, 'r20': 1, 'r21': 1, 'r22': 1, 'r23': 1, 'r24': 1,
'r25': 1, 'r26': 1, 'r27': 1, 'r28': 1, 'r29': 1, 'r30': 1, 'r31': 1,
'x': 0 /* R27:R26 */, 'xh': 1 /* R27 */, 'xl': 1 /* R26 */,
'y': 0 /* R29:R28 */, 'yh': 1 /* R29 */, 'yl': 1 /* R28 */,
'z': 0 /* R31:R30 */, 'zh': 1 /* R31 */, 'zl': 1 /* R30 */,
/* IO Registers (ATMega128) */
'ucsr1c': 1, 'udr1': 1, 'ucsr1a': 1, 'ucsr1b': 1, 'ubrr1l': 1, 'ubrr1h': 1, 'ucsr0c': 1, 'ubrr0h': 1, 'tccr3c': 1,
'tccr3a': 1, 'tccr3b': 1, 'tcnt3h': 1, 'tcnt3l': 1, 'ocr3ah': 1, 'ocr3al': 1, 'ocr3bh': 1, 'ocr3bl': 1, 'ocr3ch': 1,
'ocr3cl': 1, 'icr3h': 1, 'icr3l': 1, 'etimsk': 1, 'etifr': 1, 'tccr1c': 1, 'ocr1ch': 1, 'ocr1cl': 1, 'twcr': 1,
'twdr': 1, 'twar': 1, 'twsr': 1, 'twbr': 1, 'osccal': 1, 'xmcra': 1, 'xmcrb': 1, 'eicra': 1, 'spmcsr': 1, 'spmcr': 1,
'portg': 1, 'ddrg': 1, 'ping': 1, 'portf': 1, 'ddrf': 1, 'sreg': 1, 'sph': 1, 'spl': 1, 'xdiv': 1, 'rampz': 1,
'eicrb': 1, 'eimsk': 1, 'gimsk': 1, 'gicr': 1, 'eifr': 1, 'gifr': 1, 'timsk': 1, 'tifr': 1, 'mcucr': 1,
'mcucsr': 1, 'tccr0': 1, 'tcnt0': 1, 'ocr0': 1, 'assr': 1, 'tccr1a': 1, 'tccr1b': 1, 'tcnt1h': 1, 'tcnt1l': 1,
'ocr1ah': 1, 'ocr1al': 1, 'ocr1bh': 1, 'ocr1bl': 1, 'icr1h': 1, 'icr1l': 1, 'tccr2': 1, 'tcnt2': 1, 'ocr2': 1,
'ocdr': 1, 'wdtcr': 1, 'sfior': 1, 'eearh': 1, 'eearl': 1, 'eedr': 1, 'eecr': 1, 'porta': 1, 'ddra': 1, 'pina': 1,
'portb': 1, 'ddrb': 1, 'pinb': 1, 'portc': 1, 'ddrc': 1, 'pinc': 1, 'portd': 1, 'ddrd': 1, 'pind': 1, 'spdr': 1,
'spsr': 1, 'spcr': 1, 'udr0': 1, 'ucsr0a': 1, 'ucsr0b': 1, 'ubrr0l': 1, 'acsr': 1, 'admux': 1, 'adcsr': 1, 'adch': 1,
'adcl': 1, 'porte': 1, 'ddre': 1, 'pine': 1, 'pinf': 1
}
},
contains: [
hljs.C_BLOCK_COMMENT_MODE,
{className: 'comment', begin: ';', end: '$'},
hljs.C_NUMBER_MODE, // 0x..., decimal, float
hljs.BINARY_NUMBER_MODE, // 0b...
{
className: 'number',
begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
},
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'', end: '[^\\\\]\'',
illegal: '[^\\\\][^\']'
},
{className: 'label', begin: '^[A-Za-z0-9_.$]+:'},
{className: 'preprocessor', begin: '#', end: '$'},
{ // директивы «.include» «.macro» и т.д.
className: 'preprocessor',
begin: '\\.[a-zA-Z]+'
},
{ // подстановка в «.macro»
className: 'localvars',
begin: '@[0-9]+'
}
]
}
};
@@ -0,0 +1,48 @@
/*
Language: Axapta
Author: Dmitri Roudakov <dmitri@roudakov.ru>
*/
hljs.LANGUAGES.axapta = {
defaultMode: {
keywords: {
'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1,
'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1,
'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1,
'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1,
'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'reverse': 1, 'firstfast': 1, 'firstonly': 1, 'forupdate': 1,
'nofetch': 1, 'sum': 1, 'avg': 1, 'minof': 1, 'maxof': 1, 'count': 1, 'order': 1, 'group': 1, 'by': 1, 'asc': 1,
'desc': 1, 'index': 1, 'hint': 1, 'like': 1, 'dispaly': 1, 'edit': 1, 'client': 1, 'server': 1, 'ttsbegin': 1,
'ttscommit': 1, 'str': 1, 'real': 1, 'date': 1, 'container': 1, 'anytype': 1, 'common': 1, 'div': 1, 'mod': 1
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '#', end: '$'
},
{
className: 'class',
beginWithKeyword: true, end: '{',
illegal: ':',
keywords: {'class': 1, 'interface': 1},
contains: [
{
className: 'inheritance',
beginWithKeyword: true,
keywords: {'extends': 1, 'implements': 1},
relevance: 10
},
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
}
]
}
]
}
};
@@ -0,0 +1,66 @@
/*
Language: Bash
Author: vah <vahtenberg@gmail.com>
*/
hljs.LANGUAGES.bash = function(){
var BASH_LITERAL = {'true' : 1, 'false' : 1};
var VAR1 = {
className: 'variable',
begin: '\\$([a-zA-Z0-9_]+)\\b'
};
var VAR2 = {
className: 'variable',
begin: '\\$\\{(([^}])|(\\\\}))+\\}',
contains: [hljs.C_NUMBER_MODE]
};
var QUOTE_STRING = {
className: 'string',
begin: '"', end: '"',
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
relevance: 0
};
var APOS_STRING = {
className: 'string',
begin: '\'', end: '\'',
contains: [{begin: '\'\''}],
relevance: 0
};
var TEST_CONDITION = {
className: 'test_condition',
begin: '', end: '',
contains: [QUOTE_STRING, APOS_STRING, VAR1, VAR2, hljs.C_NUMBER_MODE],
keywords: {
'literal': BASH_LITERAL
},
relevance: 0
};
return {
defaultMode: {
keywords: {
'keyword': {
'if' : 1, 'then' : 1, 'else' : 1, 'fi' : 1, 'for' : 1, 'break' : 1, 'continue' : 1, 'while' : 1, 'in' : 1,
'do' : 1, 'done' : 1, 'echo' : 1, 'exit' : 1, 'return' : 1, 'set' : 1, 'declare' : 1
},
'literal': BASH_LITERAL
},
contains: [
{
className: 'shebang',
begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
relevance: 10
},
VAR1,
VAR2,
hljs.HASH_COMMENT_MODE,
hljs.C_NUMBER_MODE,
QUOTE_STRING,
APOS_STRING,
hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
]
}
};
}();
@@ -0,0 +1,42 @@
/*
Language: CMake
Description: CMake is an open-source cross-platform system for build automation.
Author: Igor Kalnitsky <igor.kalnitsky@gmail.com>
Website: http://kalnitsky.org.ua/
*/
hljs.LANGUAGES.cmake = {
case_insensitive: true,
defaultMode: {
keywords: {
'add_custom_command': 2, 'add_custom_target': 2, 'add_definitions': 2, 'add_dependencies': 2,
'add_executable': 2, 'add_library': 2, 'add_subdirectory': 2, 'add_test': 2, 'aux_source_directory': 2,
'break': 1, 'build_command': 2, 'cmake_minimum_required': 3, 'cmake_policy': 3, 'configure_file': 1,
'create_test_sourcelist': 1, 'define_property': 1, 'else': 1, 'elseif': 1, 'enable_language': 2,
'enable_testing': 2, 'endforeach': 1, 'endfunction': 1, 'endif': 1, 'endmacro': 1, 'endwhile': 1,
'execute_process': 2, 'export': 1, 'find_file': 1, 'find_library': 2, 'find_package': 2, 'find_path': 1,
'find_program': 1, 'fltk_wrap_ui': 2, 'foreach': 1, 'function': 1, 'get_cmake_property': 3,
'get_directory_property': 1, 'get_filename_component': 1, 'get_property': 1, 'get_source_file_property': 1,
'get_target_property': 1, 'get_test_property': 1, 'if': 1, 'include': 1, 'include_directories': 2,
'include_external_msproject': 1, 'include_regular_expression': 2, 'install': 1, 'link_directories': 1,
'load_cache': 1, 'load_command': 1, 'macro': 1, 'mark_as_advanced': 1, 'message': 1, 'option': 1,
'output_required_files': 1, 'project': 1, 'qt_wrap_cpp': 2, 'qt_wrap_ui': 2, 'remove_definitions': 2,
'return': 1, 'separate_arguments': 1, 'set': 1, 'set_directory_properties': 1, 'set_property': 1,
'set_source_files_properties': 1, 'set_target_properties': 1, 'set_tests_properties': 1, 'site_name': 1,
'source_group': 1, 'string': 1, 'target_link_libraries': 2, 'try_compile': 2, 'try_run': 2, 'unset': 1,
'variable_watch': 2, 'while': 1, 'build_name': 1, 'exec_program': 1, 'export_library_dependencies': 1,
'install_files': 1, 'install_programs': 1, 'install_targets': 1, 'link_libraries': 1, 'make_directory': 1,
'remove': 1, 'subdir_depends': 1, 'subdirs': 1, 'use_mangled_mesa': 1, 'utility_source': 1,
'variable_requires': 1, 'write_file': 1
},
contains: [
{
className: 'envvar',
begin: '\\${', end: '}'
},
hljs.HASH_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE
]
}
};
@@ -0,0 +1,112 @@
/*
Language: CoffeeScript
Author: Dmytrii Nagirniak <dnagir@gmail.com>
Contributors: Oleg Efimov <efimovov@gmail.com>
Description: CoffeeScript is a programming language that transcompiles to JavaScript. For info about language see http://coffeescript.org/
*/
hljs.LANGUAGES.coffeescript = function() {
var keywords = {
'keyword': {
// JS keywords
'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1,
'new': 1, 'do': 1, 'return': 1, 'else': 1,
'break': 1, 'catch': 1, 'instanceof': 1, 'throw': 1,
'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1,
'delete': 1, 'debugger': 1,
'class': 1, 'extends': 1, 'super': 1,
// Coffee keywords
'then': 1, 'unless': 1, 'until': 1, 'loop': 2, 'of': 2, 'by': 1, 'when': 2,
'and': 1, 'or': 1, 'is': 1, 'isnt': 2, 'not': 1
},
'literal': {
// JS literals
'true': 1, 'false': 1, 'null': 1, 'undefined': 1,
// Coffee literals
'yes': 1, 'no': 1, 'on': 1, 'off': 1
},
'reserved': {
'case': 1, 'default': 1, 'function': 1, 'var': 1, 'void': 1, 'with': 1,
'const': 1, 'let': 1, 'enum': 1, 'export': 1, 'import': 1, 'native': 1,
'__hasProp': 1 , '__extends': 1 , '__slice': 1 , '__bind': 1 , '__indexOf': 1
}
};
var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
var COFFEE_QUOTE_STRING_SUBST_MODE = {
className: 'subst',
begin: '#\\{', end: '}',
keywords: keywords,
contains: [hljs.C_NUMBER_MODE, hljs.BINARY_NUMBER_MODE]
};
var COFFEE_QUOTE_STRING_MODE = {
className: 'string',
begin: '"', end: '"',
relevance: 0,
contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
};
var COFFEE_HEREDOC_MODE = {
className: 'string',
begin: '"""', end: '"""',
contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
};
var COFFEE_HERECOMMENT_MODE = {
className: 'comment',
begin: '###', end: '###'
};
var COFFEE_HEREGEX_MODE = {
className: 'regexp',
begin: '///', end: '///',
contains: [hljs.HASH_COMMENT_MODE]
};
var COFFEE_FUNCTION_DECLARATION_MODE = {
className: 'function',
begin: JS_IDENT_RE + '\\s*=\\s*(\\(.+\\))?\\s*[-=]>',
returnBegin: true,
contains: [
{
className: 'title',
begin: JS_IDENT_RE
},
{
className: 'params',
begin: '\\(', end: '\\)'
}
]
};
var COFFEE_EMBEDDED_JAVASCRIPT = {
className: 'javascript',
begin: '`', end: '`',
excludeBegin: true, excludeEnd: true,
subLanguage: 'javascript'
};
return {
defaultMode: {
keywords: keywords,
contains: [
// Numbers
hljs.C_NUMBER_MODE,
hljs.BINARY_NUMBER_MODE,
// Strings
hljs.APOS_STRING_MODE,
COFFEE_HEREDOC_MODE, // Should be before COFFEE_QUOTE_STRING_MODE for greater priority
COFFEE_QUOTE_STRING_MODE,
// Comments
COFFEE_HERECOMMENT_MODE, // Should be before hljs.HASH_COMMENT_MODE for greater priority
hljs.HASH_COMMENT_MODE,
// CoffeeScript specific modes
COFFEE_HEREGEX_MODE,
COFFEE_EMBEDDED_JAVASCRIPT,
COFFEE_FUNCTION_DECLARATION_MODE
]
}
};
}();
@@ -0,0 +1,66 @@
/*
Language: C++
Contributors: Evgeny Stepanischev <imbolk@gmail.com>
*/
hljs.LANGUAGES.cpp = function(){
var CPP_KEYWORDS = {
'keyword': {
'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, 'char': 1,
'catch': 1, 'export': 1, 'virtual': 1, 'operator': 2, 'sizeof': 2,
'dynamic_cast': 2, 'typedef': 2, 'const_cast': 2, 'const': 1,
'struct': 1, 'for': 1, 'static_cast': 2, 'union': 1, 'namespace': 1,
'unsigned': 1, 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1,
'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1, 'if': 1,
'public': 1, 'friend': 2, 'do': 1, 'return': 1, 'goto': 1, 'auto': 1,
'void': 2, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'extern': 1,
'using': 1, 'true': 1, 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1,
'short': 1, 'reinterpret_cast': 2, 'default': 1, 'double': 1,
'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, 'try': 1,
'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, 'inline': 1,
'delete': 1, 'alignof': 1, 'char16_t': 1, 'char32_t': 1, 'constexpr': 1,
'decltype': 1, 'noexcept': 1, 'nullptr': 1, 'static_assert': 1,
'thread_local': 1, 'restrict': 1, '_Bool':1, 'complex': 1
},
'built_in': {
'std': 1, 'string': 1, 'cin': 1, 'cout': 1, 'cerr': 1, 'clog': 1,
'stringstream': 1, 'istringstream': 1, 'ostringstream': 1, 'auto_ptr': 1,
'deque': 1, 'list': 1, 'queue': 1, 'stack': 1, 'vector': 1, 'map': 1,
'set': 1, 'bitset': 1, 'multiset': 1, 'multimap': 1, 'unordered_set': 1,
'unordered_map': 1, 'unordered_multiset': 1, 'unordered_multimap': 1,
'array': 1, 'shared_ptr': 1
}
};
return {
defaultMode: {
keywords: CPP_KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'\\\\?.', end: '\'',
illegal: '.'
},
{
className: 'number',
begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
},
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '#', end: '$'
},
{
className: 'stl_container',
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
keywords: CPP_KEYWORDS,
relevance: 10,
contains: ['self']
}
]
}
};
}();
@@ -0,0 +1,58 @@
/*
Language: C#
Author: Jason Diamond <jason@diamond.name>
*/
hljs.LANGUAGES.cs = {
defaultMode: {
keywords: {
// Normal keywords.
'abstract': 1, 'as': 1, 'base': 1, 'bool': 1, 'break': 1, 'byte': 1, 'case': 1, 'catch': 1, 'char': 1,
'checked': 1, 'class': 1, 'const': 1, 'continue': 1, 'decimal': 1, 'default': 1, 'delegate': 1, 'do': 1,
'double': 1, 'else': 1, 'enum': 1, 'event': 1, 'explicit': 1, 'extern': 1, 'false': 1, 'finally': 1, 'fixed': 1,
'float': 1, 'for': 1, 'foreach': 1, 'goto': 1, 'if': 1, 'implicit': 1, 'in': 1, 'int': 1, 'interface': 1,
'internal': 1, 'is': 1, 'lock': 1, 'long': 1, 'namespace': 1, 'new': 1, 'null': 1, 'object': 1, 'operator': 1,
'out': 1, 'override': 1, 'params': 1, 'private': 1, 'protected': 1, 'public': 1, 'readonly': 1, 'ref': 1,
'return': 1, 'sbyte': 1, 'sealed': 1, 'short': 1, 'sizeof': 1, 'stackalloc': 1, 'static': 1, 'string': 1,
'struct': 1, 'switch': 1, 'this': 1, 'throw': 1, 'true': 1, 'try': 1, 'typeof': 1, 'uint': 1, 'ulong': 1,
'unchecked': 1, 'unsafe': 1, 'ushort': 1, 'using': 1, 'virtual': 1, 'volatile': 1, 'void': 1, 'while': 1,
// Contextual keywords.
'ascending': 1, 'descending': 1, 'from': 1, 'get': 1, 'group': 1, 'into': 1, 'join': 1, 'let': 1, 'orderby': 1,
'partial': 1, 'select': 1, 'set': 1, 'value': 1, 'var': 1, 'where': 1, 'yield': 1
},
contains: [
{
className: 'comment',
begin: '///', end: '$', returnBegin: true,
contains: [
{
className: 'xmlDocTag',
begin: '///|<!--|-->'
},
{
className: 'xmlDocTag',
begin: '</?', end: '>'
}
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'preprocessor',
begin: '#', end: '$',
keywords: {
'if': 1, 'else': 1, 'elif': 1, 'endif': 1, 'define': 1, 'undef': 1, 'warning': 1,
'error': 1, 'line': 1, 'region': 1, 'endregion': 1, 'pragma': 1, 'checksum': 1
}
},
{
className: 'string',
begin: '@"', end: '"',
contains: [{begin: '""'}]
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE
]
}
};
@@ -0,0 +1,101 @@
/*
Language: CSS
*/
hljs.LANGUAGES.css = function() {
var FUNCTION = {
className: 'function',
begin: hljs.IDENT_RE + '\\(', end: '\\)',
contains: [{
endsWithParent: true, excludeEnd: true,
contains: [hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
}]
};
return {
case_insensitive: true,
defaultMode: {
illegal: '[=/|\']',
contains: [
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'id', begin: '\\#[A-Za-z0-9_-]+'
},
{
className: 'class', begin: '\\.[A-Za-z0-9_-]+',
relevance: 0
},
{
className: 'attr_selector',
begin: '\\[', end: '\\]',
illegal: '$'
},
{
className: 'pseudo',
begin: ':(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\"\\\']+'
},
{
className: 'at_rule',
begin: '@(font-face|page)',
lexems: '[a-z-]+',
keywords: {'font-face': 1, 'page': 1}
},
{
className: 'at_rule',
begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
// because it doesn't let it to be parsed as
// a rule set but instead drops parser into
// the defaultMode which is how it should be.
excludeEnd: true,
keywords: {'import': 1, 'page': 1, 'media': 1, 'charset': 1},
contains: [
FUNCTION,
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE
]
},
{
className: 'tag', begin: hljs.IDENT_RE,
relevance: 0
},
{
className: 'rules',
begin: '{', end: '}',
illegal: '[^\\s]',
relevance: 0,
contains: [
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'rule',
begin: '[^\\s]', returnBegin: true, end: ';', endsWithParent: true,
contains: [
{
className: 'attribute',
begin: '[A-Z\\_\\.\\-]+', end: ':',
excludeEnd: true,
illegal: '[^\\s]',
starts: {
className: 'value',
endsWithParent: true, excludeEnd: true,
contains: [
FUNCTION,
hljs.NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'hexcolor', begin: '\\#[0-9A-F]+'
},
{
className: 'important', begin: '!important'
}
]
}
}
]
}
]
}
]
}
};
}();
@@ -0,0 +1,294 @@
/*
Language: D
Author: Aleksandar Ruzicic <aleksandar@ruzicic.info>
Description: D is a language with C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity.
Version: 1.0a
Date: 2012-04-08
*/
/**
* Known issues:
*
* - invalid hex string literals will be recognized as a double quoted strings
* but 'x' at the beginning of string will not be matched
*
* - delimited string literals are not checked for matching end delimiter
* (not possible to do with js regexp)
*
* - content of token string is colored as a string (i.e. no keyword coloring inside a token string)
* also, content of token string is not validated to contain only valid D tokens
*
* - special token sequence rule is not strictly following D grammar (anything following #line
* up to the end of line is matched as special token sequence)
*/
hljs.LANGUAGES.d = function() {
/**
* Language keywords
*
* @type {Object}
*/
var D_KEYWORDS = {
keyword: {
'abstract': 1, 'alias': 1, 'align': 1, 'asm': 1, 'assert': 1, 'auto': 1,
'body': 1, 'break': 1, 'byte': 1,
'case': 1, 'cast': 1, 'catch': 1, 'class': 1, 'const': 1, 'continue': 1,
'debug': 1, 'default': 1, 'delete': 1, 'deprecated': 1, 'do': 1,
'else': 1, 'enum': 1, 'export': 1, 'extern': 1,
'final': 1, 'finally': 1, 'for': 1, 'foreach': 1, 'foreach_reverse': 10,
'goto': 1,
'if': 1, 'immutable': 1, 'import': 1, 'in': 1, 'inout': 1, 'int': 1, 'interface': 1, 'invariant': 1, 'is': 1,
'lazy': 1,
'macro': 1, 'mixin': 1, 'module': 1,
'new': 1, 'nothrow': 1,
'out': 1, 'override': 1,
'package': 1, 'pragma': 1, 'private': 1, 'protected': 1, 'public': 1, 'pure': 1,
'ref': 1, 'return': 1,
'scope': 1, 'shared': 1, 'static': 1, 'struct': 1, 'super': 1, 'switch': 1, 'synchronized': 1,
'template': 1, 'this': 1, 'throw': 1, 'try': 1, 'typedef': 1, 'typeid': 1, 'typeof': 1,
'union': 1, 'unittest': 1,
'version': 1, 'void': 1, 'volatile': 1,
'while': 1, 'with': 1,
'__FILE__': 1, '__LINE__': 1, '__gshared': 10, '__thread': 10, '__traits': 10,
'__DATE__': 1, '__EOF__': 1, '__TIME__': 1, '__TIMESTAMP__': 1, '__VENDOR__': 1, '__VERSION__': 1
},
built_in: {
'bool': 1,
'cdouble': 1, 'cent': 1, 'cfloat': 1, 'char': 1, 'creal': 1,
'dchar': 1, 'delegate': 1, 'double': 1, 'dstring': 1,
'float': 1, 'function': 1,
'idouble': 1, 'ifloat': 1, 'ireal': 1,
'long': 1,
'real': 1,
'short': 1, 'string': 1,
'ubyte': 1, 'ucent': 1, 'uint': 1, 'ulong': 1, 'ushort': 1,
'wchar': 1, 'wstring': 1
},
literal: {
'false': 1,
'null': 1,
'true': 1
}
};
/**
* Number literal regexps
*
* @type {String}
*/
var decimal_integer_re = '(0|[1-9][\\d_]*)',
decimal_integer_nosus_re = '(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)',
binary_integer_re = '0[bB][01_]+',
hexadecimal_digits_re = '([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)',
hexadecimal_integer_re = '0[xX]' + hexadecimal_digits_re,
decimal_exponent_re = '([eE][+-]?' + decimal_integer_nosus_re + ')',
decimal_float_re = '(' + decimal_integer_nosus_re + '(\\.\\d*|' + decimal_exponent_re + ')|' +
'\\d+\\.' + decimal_integer_nosus_re + decimal_integer_nosus_re + '|' +
'\\.' + decimal_integer_re + decimal_exponent_re + '?' +
')',
hexadecimal_float_re = '(0[xX](' +
hexadecimal_digits_re + '\\.' + hexadecimal_digits_re + '|'+
'\\.?' + hexadecimal_digits_re +
')[pP][+-]?' + decimal_integer_nosus_re + ')';
integer_re = '(' +
decimal_integer_re + '|' +
binary_integer_re + '|' +
hexadecimal_integer_re +
')',
float_re = '(' +
hexadecimal_float_re + '|' +
decimal_float_re +
')';
/**
* Escape sequence supported in D string and character literals
*
* @type {String}
*/
var escape_sequence_re = '\\\\(' +
'[\'"\\?\\\\abfnrtv]|' + // common escapes
'u[\\dA-Fa-f]{4}|' + // four hex digit unicode codepoint
'[0-7]{1,3}|' + // one to three octal digit ascii char code
'x[\\dA-Fa-f]{2}|' + // two hex digit ascii char code
'U[\\dA-Fa-f]{8}' + // eight hex digit unicode codepoint
')|' +
'&[a-zA-Z\\d]{2,};'; // named character entity
/**
* D integer number literals
*
* @type {Object}
*/
var D_INTEGER_MODE = {
className: 'number',
begin: '\\b' + integer_re + '(L|u|U|Lu|LU|uL|UL)?',
relevance: 0
};
/**
* [D_FLOAT_MODE description]
* @type {Object}
*/
var D_FLOAT_MODE = {
className: 'number',
begin: '\\b(' +
float_re + '([fF]|L|i|[fF]i|Li)?|' +
integer_re + '(i|[fF]i|Li)' +
')',
relevance: 0
};
/**
* D character literal
*
* @type {Object}
*/
var D_CHARACTER_MODE = {
className: 'string',
begin: '\'(' + escape_sequence_re + '|.)', end: '\'',
illegal: '.'
};
/**
* D string escape sequence
*
* @type {Object}
*/
var D_ESCAPE_SEQUENCE = {
begin: escape_sequence_re,
relevance: 0
}
/**
* D double quoted string literal
*
* @type {Object}
*/
var D_STRING_MODE = {
className: 'string',
begin: '"',
contains: [D_ESCAPE_SEQUENCE],
end: '"[cwd]?',
relevance: 0
};
/**
* D wysiwyg and delimited string literals
*
* @type {Object}
*/
var D_WYSIWYG_DELIMITED_STRING_MODE = {
className: 'string',
begin: '[rq]"',
end: '"[cwd]?',
relevance: 5
};
/**
* D alternate wysiwyg string literal
*
* @type {Object}
*/
var D_ALTERNATE_WYSIWYG_STRING_MODE = {
className: 'string',
begin: '`',
end: '`[cwd]?'
};
/**
* D hexadecimal string literal
*
* @type {Object}
*/
var D_HEX_STRING_MODE = {
className: 'string',
begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
relevance: 10
};
/**
* D delimited string literal
*
* @type {Object}
*/
var D_TOKEN_STRING_MODE = {
className: 'string',
begin: 'q"\\{',
end: '\\}"'
};
/**
* Hashbang support
*
* @type {Object}
*/
var D_HASHBANG_MODE = {
className: 'shebang',
begin: '^#!',
end: '$',
relevance: 5
};
/**
* D special token sequence
*
* @type {Object}
*/
var D_SPECIAL_TOKEN_SEQUENCE_MODE = {
className: 'preprocessor',
begin: '#(line)',
end: '$',
relevance: 5
};
/**
* D attributes
*
* @type {Object}
*/
var D_ATTRIBUTE_MODE = {
className: 'keyword',
begin: '@[a-zA-Z_][a-zA-Z_\\d]*'
};
/**
* D nesting comment
*
* @type {Object}
*/
var D_NESTING_COMMENT_MODE = {
className: 'comment',
begin: '\\/\\+',
contains: ['self'],
end: '\\+\\/',
relevance: 10
}
return {
defaultMode: {
lexems: hljs.UNDERSCORE_IDENT_RE,
keywords: D_KEYWORDS,
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
D_NESTING_COMMENT_MODE,
D_HEX_STRING_MODE,
D_STRING_MODE,
D_WYSIWYG_DELIMITED_STRING_MODE,
D_ALTERNATE_WYSIWYG_STRING_MODE,
D_TOKEN_STRING_MODE,
D_FLOAT_MODE,
D_INTEGER_MODE,
D_CHARACTER_MODE,
D_HASHBANG_MODE,
D_SPECIAL_TOKEN_SEQUENCE_MODE,
D_ATTRIBUTE_MODE
]
}
};
}();
@@ -0,0 +1,88 @@
/*
Language: Delphi
*/
hljs.LANGUAGES.delphi = function(){
var DELPHI_KEYWORDS = {
'and': 1, 'safecall': 1, 'cdecl': 1, 'then': 1, 'string': 1, 'exports': 1, 'library': 1, 'not': 1, 'pascal': 1,
'set': 1, 'virtual': 1, 'file': 1, 'in': 1, 'array': 1, 'label': 1, 'packed': 1, 'end.': 1, 'index': 1,
'while': 1, 'const': 1, 'raise': 1, 'for': 1, 'to': 1, 'implementation': 1, 'with': 1, 'except': 1,
'overload': 1, 'destructor': 1, 'downto': 1, 'finally': 1, 'program': 1, 'exit': 1, 'unit': 1, 'inherited': 1,
'override': 1, 'if': 1, 'type': 1, 'until': 1, 'function': 1, 'do': 1, 'begin': 1, 'repeat': 1, 'goto': 1,
'nil': 1, 'far': 1, 'initialization': 1, 'object': 1, 'else': 1, 'var': 1, 'uses': 1, 'external': 1,
'resourcestring': 1, 'interface': 1, 'end': 1, 'finalization': 1, 'class': 1, 'asm': 1, 'mod': 1, 'case': 1,
'on': 1, 'shr': 1, 'shl': 1, 'of': 1, 'register': 1, 'xorwrite': 1, 'threadvar': 1, 'try': 1, 'record': 1,
'near': 1, 'stored': 1, 'constructor': 1, 'stdcall': 1, 'inline': 1, 'div': 1, 'out': 1, 'or': 1, 'procedure': 1
};
var DELPHI_CLASS_KEYWORDS = {
'safecall': 1, 'stdcall': 1, 'pascal': 1, 'stored': 1, 'const': 1, 'implementation': 1, 'finalization': 1,
'except': 1, 'to': 1, 'finally': 1, 'program': 1, 'inherited': 1, 'override': 1, 'then': 1, 'exports': 1,
'string': 1, 'read': 1, 'not': 1, 'mod': 1, 'shr': 1, 'try': 1, 'div': 1, 'shl': 1, 'set': 1, 'library': 1,
'message': 1, 'packed': 1, 'index': 1, 'for': 1, 'near': 1, 'overload': 1, 'label': 1, 'downto': 1, 'exit': 1,
'public': 1, 'goto': 1, 'interface': 1, 'asm': 1, 'on': 1, 'of': 1, 'constructor': 1, 'or': 1, 'private': 1,
'array': 1, 'unit': 1, 'raise': 1, 'destructor': 1, 'var': 1, 'type': 1, 'until': 1, 'function': 1, 'else': 1,
'external': 1, 'with': 1, 'case': 1, 'default': 1, 'record': 1, 'while': 1, 'protected': 1, 'property': 1,
'procedure': 1, 'published': 1, 'and': 1, 'cdecl': 1, 'do': 1, 'threadvar': 1, 'file': 1, 'in': 1, 'if': 1,
'end': 1, 'virtual': 1, 'write': 1, 'far': 1, 'out': 1, 'begin': 1, 'repeat': 1, 'nil': 1, 'initialization': 1,
'object': 1, 'uses': 1, 'resourcestring': 1, 'class': 1, 'register': 1, 'xorwrite': 1, 'inline': 1, 'static': 1
};
var CURLY_COMMENT = {
className: 'comment',
begin: '{', end: '}',
relevance: 0
};
var PAREN_COMMENT = {
className: 'comment',
begin: '\\(\\*', end: '\\*\\)',
relevance: 10
};
var STRING = {
className: 'string',
begin: '\'', end: '\'',
contains: [{begin: '\'\''}],
relevance: 0
};
var CHAR_STRING = {
className: 'string', begin: '(#\\d+)+'
};
var FUNCTION = {
className: 'function',
beginWithKeyword: true, end: '[:;]',
keywords: {'function': 1, 'constructor': 10, 'destructor': 10, 'procedure': 10},
contains: [
{
className: 'title', begin: hljs.IDENT_RE
},
{
className: 'params',
begin: '\\(', end: '\\)',
keywords: DELPHI_KEYWORDS,
contains: [STRING, CHAR_STRING]
},
CURLY_COMMENT, PAREN_COMMENT
]
};
return {
case_insensitive: true,
defaultMode: {
keywords: DELPHI_KEYWORDS,
illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
contains: [
CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
STRING, CHAR_STRING,
hljs.NUMBER_MODE,
FUNCTION,
{
className: 'class',
begin: '=\\bclass\\b', end: 'end;',
keywords: DELPHI_CLASS_KEYWORDS,
contains: [
STRING, CHAR_STRING,
CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
FUNCTION
]
}
]
}
};
}();
@@ -0,0 +1,64 @@
/*
Language: Diff
Description: Unified and context diff
Author: Vasily Polovnyov <vast@whiteants.net>
*/
hljs.LANGUAGES.diff = {
case_insensitive: true,
defaultMode: {
contains: [
{
className: 'chunk',
begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$',
relevance: 10
},
{
className: 'chunk',
begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$',
relevance: 10
},
{
className: 'chunk',
begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$',
relevance: 10
},
{
className: 'header',
begin: 'Index: ', end: '$'
},
{
className: 'header',
begin: '=====', end: '=====$'
},
{
className: 'header',
begin: '^\\-\\-\\-', end: '$'
},
{
className: 'header',
begin: '^\\*{3} ', end: '$'
},
{
className: 'header',
begin: '^\\+\\+\\+', end: '$'
},
{
className: 'header',
begin: '\\*{5}', end: '\\*{5}$'
},
{
className: 'addition',
begin: '^\\+', end: '$'
},
{
className: 'deletion',
begin: '^\\-', end: '$'
},
{
className: 'change',
begin: '^\\!', end: '$'
}
]
}
};
@@ -0,0 +1,94 @@
/*
Language: Django
Requires: xml.js
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Ilya Baryshev <baryshev@gmail.com>
*/
hljs.LANGUAGES.django = function() {
function allowsDjangoSyntax(mode, parent) {
return (
parent == undefined || // defaultMode
(!mode.className && parent.className == 'tag') || // tag_internal
mode.className == 'value' // value
);
}
function copy(mode, parent) {
var result = {};
for (var key in mode) {
if (key != 'contains') {
result[key] = mode[key];
}
var contains = [];
for (var i = 0; mode.contains && i < mode.contains.length; i++) {
contains.push(copy(mode.contains[i], mode));
}
if (allowsDjangoSyntax(mode, parent)) {
contains = DJANGO_CONTAINS.concat(contains);
}
if (contains.length) {
result.contains = contains;
}
}
return result;
}
var FILTER = {
className: 'filter',
begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
keywords: {
'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1,
'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1,
'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1,
'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1,
'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1,
'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1,
'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1,
'slugify': 1, 'first': 1, 'escapejs': 1, 'force_escape': 1, 'iriencode': 1, 'last': 1, 'safe': 1, 'safeseq': 1,
'truncatechars': 1, 'localize': 1, 'unlocalize': 1, 'localtime': 1, 'utc': 1, 'timezone': 1
},
contains: [
{className: 'argument', begin: '"', end: '"'}
]
};
var DJANGO_CONTAINS = [
{
className: 'template_comment',
begin: '{%\\s*comment\\s*%}', end: '{%\\s*endcomment\\s*%}'
},
{
className: 'template_comment',
begin: '{#', end: '#}'
},
{
className: 'template_tag',
begin: '{%', end: '%}',
keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1,
'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1,
'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1,
'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1,
'block': 1, 'endblock': 1, 'else': 1, 'autoescape': 1, 'endautoescape': 1, 'csrf_token': 1, 'empty': 1,
'elif': 1, 'endwith': 1, 'static': 1, 'trans': 1, 'blocktrans': 1, 'endblocktrans': 1,
'get_static_prefix': 1, 'get_media_prefix': 1, 'plural': 1, 'get_current_language': 1, 'language': 1,
'get_available_languages': 1, 'get_current_language_bidi': 1, 'get_language_info': 1,
'get_language_info_list': 1, 'localize': 1, 'endlocalize': 1, 'localtime': 1, 'endlocaltime': 1, 'timezone': 1,
'endtimezone': 1, 'get_current_timezone': 1
},
contains: [FILTER]
},
{
className: 'variable',
begin: '{{', end: '}}',
contains: [FILTER]
}
];
return {
case_insensitive: true,
defaultMode: copy(hljs.LANGUAGES.xml.defaultMode)
};
}();
@@ -0,0 +1,35 @@
/*
Language: DOS .bat
Author: Alexander Makarov (http://rmcreative.ru/)
*/
hljs.LANGUAGES.dos = {
case_insensitive: true,
defaultMode: {
keywords: {
'flow': {'if':1, 'else':1, 'goto':1, 'for':1, 'in':1, 'do':1, 'call':1, 'exit':1, 'not':1, 'exist':1, 'errorlevel':1, 'defined':1, 'equ':1, 'neq':1, 'lss':1, 'leq':1, 'gtr':1, 'geq':1},
'keyword':{'shift':1, 'cd':1, 'dir':1, 'echo':1, 'setlocal':1, 'endlocal':1, 'set':1, 'pause':1, 'copy':1},
'stream':{'prn':1, 'nul':1, 'lpt3':1, 'lpt2':1, 'lpt1':1, 'con':1, 'com4':1, 'com3':1, 'com2':1, 'com1':1, 'aux':1},
'winutils':{'ping':1, 'net':1, 'ipconfig':1, 'taskkill':1, 'xcopy':1, 'ren':1, 'del':1}
},
contains: [
{
className: 'envvar', begin: '%%[^ ]'
},
{
className: 'envvar', begin: '%[^ ]+?%'
},
{
className: 'envvar', begin: '![^ ]+?!'
},
{
className: 'number', begin: '\\b\\d+',
relevance: 0
},
{
className: 'comment',
begin: '@?rem', end: '$'
}
]
}
};
@@ -0,0 +1,85 @@
/*
Language: Erlang REPL
Author: Sergey Ignatov <sergey@ignatov.spb.su>
*/
hljs.LANGUAGES.erlang_repl = {
defaultMode: {
keywords: {
'special_functions':{
'spawn':10,
'spawn_link':10,
'self':2
},
'reserved':{
'after':1,
'and':1,
'andalso':5,
'band':1,
'begin':1,
'bnot':1,
'bor':1,
'bsl':1,
'bsr':1,
'bxor':1,
'case':1,
'catch':0,
'cond':1,
'div':1,
'end':1,
'fun':0,
'if':0,
'let':1,
'not':0,
'of':1,
'or':1,
'orelse':5,
'query':1,
'receive':0,
'rem':1,
'try':0,
'when':1,
'xor':1
}
},
contains: [
{
className: 'input_number', begin: '^[0-9]+> ',
relevance: 10
},
{
className: 'comment',
begin: '%', end: '$'
},
{
className: 'number',
begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
relevance: 0
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'constant', begin: '\\?(::)?([A-Z]\\w*(::)?)+'
},
{
className: 'arrow', begin: '->'
},
{
className: 'ok', begin: 'ok'
},
{
className: 'exclamation_mark', begin: '!'
},
{
className: 'function_or_atom',
begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
relevance: 0
},
{
className: 'variable',
begin: '[A-Z][a-zA-Z0-9_\']*',
relevance: 0
}
]
}
};
@@ -0,0 +1,206 @@
/*
Language: Erlang
Description: Erlang is a general-purpose functional language, with strict evaluation, single assignment, and dynamic typing.
Author: Nikolay Zakharov <nikolay.desh@gmail.com>, Dmitry Kovega <arhibot@gmail.com>
*/
hljs.LANGUAGES.erlang = function(){
var BASIC_ATOM_RE = '[a-z\'][a-zA-Z0-9_\']*';
var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';
var ERLANG_RESERVED = {
'keyword': {
'after': 1,
'and': 1,
'andalso': 10,
'band': 1,
'begin': 1,
'bnot': 1,
'bor': 1,
'bsl': 1,
'bzr': 1,
'bxor': 1,
'case': 1,
'catch': 1,
'cond': 1,
'div': 1,
'end': 1,
'fun': 1,
'let': 1,
'not': 1,
'of': 1,
'orelse': 10,
'query': 1,
'receive': 1,
'rem': 1,
'try': 1,
'when': 1,
'xor': 1
},
'literal': {'false': 1, 'true': 1}
};
var COMMENT = {
className: 'comment',
begin: '%', end: '$',
relevance: 0
};
var NUMBER = {
className: 'number',
begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
relevance: 0
};
var NAMED_FUN = {
begin: 'fun\\s+' + BASIC_ATOM_RE + '/\\d+'
};
var FUNCTION_CALL = {
begin: FUNCTION_NAME_RE + '\\(', end: '\\)',
returnBegin: true,
relevance: 0,
contains: [
{
className: 'function_name', begin: FUNCTION_NAME_RE,
relevance: 0
},
{
begin: '\\(', end: '\\)', endsWithParent: true,
returnEnd: true,
relevance: 0
// "contains" defined later
}
]
};
var TUPLE = {
className: 'tuple',
begin: '{', end: '}',
relevance: 0
// "contains" defined later
};
var VAR1 = {
className: 'variable',
begin: '\\b_([A-Z][A-Za-z0-9_]*)?',
relevance: 0
};
var VAR2 = {
className: 'variable',
begin: '[A-Z][a-zA-Z0-9_]*',
relevance: 0
};
var RECORD_ACCESS = {
begin: '#', end: '}',
illegal: '.',
relevance: 0,
returnBegin: true,
contains: [
{
className: 'record_name',
begin: '#' + hljs.UNDERSCORE_IDENT_RE,
relevance: 0
},
{
begin: '{', endsWithParent: true,
relevance: 0
// "contains" defined later
}
]
};
var BLOCK_STATEMENTS = {
keywords: ERLANG_RESERVED,
begin: '(fun|receive|if|try|case)', end: 'end'
};
BLOCK_STATEMENTS.contains = [
COMMENT,
NAMED_FUN,
hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),
BLOCK_STATEMENTS,
FUNCTION_CALL,
hljs.QUOTE_STRING_MODE,
NUMBER,
TUPLE,
VAR1, VAR2,
RECORD_ACCESS
];
var BASIC_MODES = [
COMMENT,
NAMED_FUN,
BLOCK_STATEMENTS,
FUNCTION_CALL,
hljs.QUOTE_STRING_MODE,
NUMBER,
TUPLE,
VAR1, VAR2,
RECORD_ACCESS
];
FUNCTION_CALL.contains[1].contains = BASIC_MODES;
TUPLE.contains = BASIC_MODES;
RECORD_ACCESS.contains[1].contains = BASIC_MODES;
var PARAMS = {
className: 'params',
begin: '\\(', end: '\\)',
endsWithParent: true,
contains: BASIC_MODES
};
return {
defaultMode: {
keywords: ERLANG_RESERVED,
illegal: '(</|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))',
contains: [
{
className: 'function',
begin: '^' + BASIC_ATOM_RE + '\\(', end: ';|\\.',
returnBegin: true,
contains: [
PARAMS,
{
className: 'title', begin: BASIC_ATOM_RE
},
{
keywords: ERLANG_RESERVED,
begin: '->', endsWithParent: true,
contains: BASIC_MODES
}
]
},
COMMENT,
{
className: 'pp',
begin: '^-', end: '\\.',
relevance: 0,
excludeEnd: true,
returnBegin: true,
lexems: '-' + hljs.IDENT_RE,
keywords: {
'-module':1,
'-record':1,
'-undef':1,
'-export':1,
'-ifdef':1,
'-ifndef':1,
'-author':1,
'-copyright':1,
'-doc':1,
'-vsn':1,
'-import': 1,
'-include': 1,
'-include_lib': 1,
'-compile': 1,
'-define': 1,
'-else': 1,
'-endif': 1,
'-file': 1,
'-behaviour': 1,
'-behavior': 1
},
contains: [PARAMS]
},
NUMBER,
hljs.QUOTE_STRING_MODE,
RECORD_ACCESS,
VAR1, VAR2,
TUPLE
]
}
};
}();
@@ -0,0 +1,59 @@
/*
Language: Go
Author: Stephan Kountso aka StepLg <steplg@gmail.com>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>
Description: Google go language (golang). For info about language see http://golang.org/
*/
hljs.LANGUAGES.go = function(){
var GO_KEYWORDS = {
'keyword': {
'break' : 1, 'default' : 1, 'func' : 1, 'interface' : 1, 'select' : 1,
'case' : 1, 'map' : 1, 'struct' : 1, 'chan' : 1,
'else' : 1, 'goto' : 1, 'package' : 1, 'switch' : 1, 'const' : 1,
'fallthrough' : 1, 'if' : 1, 'range' : 1, 'type' : 1, 'continue' : 1,
'for' : 1, 'import' : 1, 'return' : 1, 'var' : 1, 'go': 1, 'defer' : 1
},
'constant': {
'true': 1, 'false': 1, 'iota': 1, 'nil': 1
},
'typename': {
'bool': 1, 'byte': 1, 'complex64': 1, 'complex128': 1, 'float32': 1,
'float64': 1, 'int8': 1, 'int16': 1, 'int32': 1, 'int64': 1, 'string': 1,
'uint8': 1, 'uint16': 1, 'uint32': 1, 'uint64': 1, 'int': 1, 'uint': 1,
'uintptr': 1, 'rune': 1
},
'built_in': {
'append': 1, 'cap': 1, 'close': 1, 'complex': 1, 'copy': 1, 'imag': 1,
'len': 1, 'make': 1, 'new': 1, 'panic': 1, 'print': 1, 'println': 1,
'real': 1, 'recover': 1, 'delete': 1
}
};
return {
defaultMode: {
keywords: GO_KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'', end: '[^\\\\]\'',
relevance: 0
},
{
className: 'string',
begin: '`', end: '`'
},
{
className: 'number',
begin: '[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?',
relevance: 0
},
hljs.C_NUMBER_MODE
]
}
};
}();
@@ -0,0 +1,77 @@
/*
Language: Haskell
Author: Jeremy Hull <sourdrums@gmail.com>
*/
hljs.LANGUAGES.haskell = function(){
var LABEL = {
className: 'label',
begin: '\\b[A-Z][\\w\']*',
relevance: 0
};
var CONTAINER = {
className: 'container',
begin: '\\(', end: '\\)',
contains: [
{className: 'label', begin: '\\b[A-Z][\\w\\(\\)\\.\']*'},
{className: 'title', begin: '[_a-z][\\w\']*'}
]
};
return {
defaultMode: {
keywords: {
'keyword': {
'let': 1, 'in': 1, 'if': 1, 'then': 1, 'else': 1, 'case': 1, 'of': 1,
'where': 1, 'do': 1, 'module': 1, 'import': 1, 'hiding': 1,
'qualified': 1, 'type': 1, 'data': 1, 'newtype': 1, 'deriving': 1,
'class': 1, 'instance': 1, 'null': 1, 'not': 1, 'as': 1
}
},
contains: [
{
className: 'comment',
begin: '--', end: '$'
},
{
className: 'comment',
begin: '{-', end: '-}'
},
{
className: 'string',
begin: '\\s+\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
},
hljs.QUOTE_STRING_MODE,
{
className: 'import',
begin: '\\bimport', end: '$',
keywords: {'import': 1, 'qualified': 1, 'as': 1, 'hiding': 1},
contains: [CONTAINER]
},
{
className: 'module',
begin: '\\bmodule', end: 'where',
keywords: {'module': 1, 'where': 1},
contains: [CONTAINER]
},
{
className: 'class',
begin: '\\b(class|instance|data|(new)?type)', end: '(where|$)',
keywords: {'class': 1, 'where': 1, 'instance': 1,'data': 1,'type': 1,'newtype': 1, 'deriving': 1},
contains: [LABEL]
},
hljs.C_NUMBER_MODE,
{
className: 'shebang',
begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
},
LABEL,
{
className: 'title', begin: '^[_a-z][\\w\']*'
}
]
}
};
}();
@@ -0,0 +1,32 @@
/*
Language: Ini
*/
hljs.LANGUAGES.ini = {
case_insensitive: true,
defaultMode: {
illegal: '[^\\s]',
contains: [
{
className: 'comment',
begin: ';', end: '$'
},
{
className: 'title',
begin: '^\\[', end: '\\]'
},
{
className: 'setting',
begin: '^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*', end: '$',
contains: [
{
className: 'value',
endsWithParent: true,
keywords: {'on': 1, 'off': 1, 'true': 1, 'false': 1, 'yes': 1, 'no': 1},
contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE]
}
]
}
]
}
};
@@ -0,0 +1,53 @@
/*
Language: Java
Author: Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
*/
hljs.LANGUAGES.java = {
defaultMode: {
keywords: {
'false': 1, 'synchronized': 1, 'int': 1, 'abstract': 1, 'float': 1, 'private': 1, 'char': 1,
'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'const': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1,
'throw': 1, 'strictfp': 1, 'finally': 1, 'protected': 1, 'import': 1, 'native': 1, 'final': 1,
'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'transient': 1, 'new': 1, 'catch': 1,
'instanceof': 1, 'byte': 1, 'super': 1, 'volatile': 1, 'case': 1, 'assert': 1, 'short': 1,
'package': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1,
'throws': 1
},
contains: [
{
className: 'javadoc',
begin: '/\\*\\*', end: '\\*/',
contains: [{
className: 'javadoctag', begin: '@[A-Za-z]+'
}],
relevance: 10
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'class',
beginWithKeyword: true, end: '{',
keywords: {'class': 1, 'interface': 1},
illegal: ':',
contains: [
{
beginWithKeyword: true,
keywords: {'extends': 1, 'implements': 1},
relevance: 10
},
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
}
]
},
hljs.C_NUMBER_MODE,
{
className: 'annotation', begin: '@[A-Za-z]+'
}
]
}
};
@@ -0,0 +1,57 @@
/*
Language: JavaScript
*/
hljs.LANGUAGES.javascript = {
defaultMode: {
keywords: {
'keyword': {
'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1, 'new': 1, 'function': 1, 'do': 1,
'return': 1, 'void': 1, 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1, 'throw': 1,
'case': 1, 'default': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1
},
'literal': {'true': 1, 'false': 1, 'null': 1}
},
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
{ // regexp container
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
keywords: {'return': 1, 'throw': 1, 'case': 1},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'regexp',
begin: '/', end: '/[gim]*',
contains: [{begin: '\\\\/'}]
}
],
relevance: 0
},
{
className: 'function',
beginWithKeyword: true, end: '{',
keywords: {'function': 1},
contains: [
{
className: 'title', begin: '[A-Za-z$_][0-9A-Za-z$_]*'
},
{
className: 'params',
begin: '\\(', end: '\\)',
contains: [
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE
]
}
]
}
]
}
};
@@ -0,0 +1,88 @@
/*
Language: Lisp
Description: Generic lisp syntax
Author: Vasily Polovnyov <vast@whiteants.net>
*/
hljs.LANGUAGES.lisp = function(){
var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*';
var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
var LITERAL = {
className: 'literal',
begin: '\\b(t{1}|nil)\\b'
};
var NUMBERS = [
{
className: 'number', begin: LISP_SIMPLE_NUMBER_RE
},
{
className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
},
{
className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
},
{
className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
},
{
className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
}
]
var STRING = {
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
};
var COMMENT = {
className: 'comment',
begin: ';', end: '$'
};
var VARIABLE = {
className: 'variable',
begin: '\\*', end: '\\*'
};
var KEYWORD = {
className: 'keyword',
begin: '[:&]' + LISP_IDENT_RE
};
var QUOTED_LIST = {
begin: '\\(', end: '\\)',
contains: ['self', LITERAL, STRING].concat(NUMBERS)
};
var QUOTED1 = {
className: 'quoted',
begin: '[\'`]\\(', end: '\\)',
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
};
var QUOTED2 = {
className: 'quoted',
begin: '\\(quote ', end: '\\)',
keywords: {'title': {'quote': 1}},
contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
};
var LIST = {
className: 'list',
begin: '\\(', end: '\\)'
};
var BODY = {
className: 'body',
endsWithParent: true, excludeEnd: true
};
LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
return {
case_insensitive: true,
defaultMode: {
illegal: '[^\\s]',
contains: NUMBERS.concat([
LITERAL,
STRING,
COMMENT,
QUOTED1, QUOTED2,
LIST
])
}
};
}();
@@ -0,0 +1,75 @@
/*
Language: Lua
Author: Andrew Fedorov <dmmdrs@mail.ru>
*/
hljs.LANGUAGES.lua = function() {
var OPENING_LONG_BRACKET = '\\[=*\\[';
var CLOSING_LONG_BRACKET = '\\]=*\\]';
var LONG_BRACKETS = {
begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
contains: ['self']
};
var COMMENTS = [
{
className: 'comment',
begin: '--(?!' + OPENING_LONG_BRACKET + ')', end: '$'
},
{
className: 'comment',
begin: '--' + OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
contains: [LONG_BRACKETS],
relevance: 10
}
]
return {
defaultMode: {
lexems: hljs.UNDERSCORE_IDENT_RE,
keywords: {
'keyword': {
'and': 1, 'break': 1, 'do': 1, 'else': 1, 'elseif': 1, 'end': 1,
'false': 1, 'for': 1, 'if': 1, 'in': 1, 'local': 1, 'nil': 1,
'not': 1, 'or': 1, 'repeat': 1, 'return': 1, 'then': 1, 'true': 1,
'until': 1, 'while': 1
},
'built_in': {
'_G': 1, '_VERSION': 1, 'assert': 1, 'collectgarbage': 1, 'dofile': 1,
'error': 1, 'getfenv': 1, 'getmetatable': 1, 'ipairs': 1, 'load': 1,
'loadfile': 1, 'loadstring': 1, 'module': 1, 'next': 1, 'pairs': 1,
'pcall': 1, 'print': 1, 'rawequal': 1, 'rawget': 1, 'rawset': 1,
'require': 1, 'select': 1, 'setfenv': 1, 'setmetatable': 1,
'tonumber': 1, 'tostring': 1, 'type': 1, 'unpack': 1, 'xpcall': 1,
'coroutine': 1, 'debug': 1, 'io': 1, 'math': 1, 'os': 1, 'package': 1,
'string': 1, 'table': 1
}
},
contains: COMMENTS.concat([
{
className: 'function',
beginWithKeyword: true, end: '\\)',
keywords: {'function': 1},
contains: [
{
className: 'title',
begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'
},
{
className: 'params',
begin: '\\(', endsWithParent: true,
contains: COMMENTS
}
].concat(COMMENTS)
},
hljs.C_NUMBER_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
contains: [LONG_BRACKETS],
relevance: 10
}
])
}
};
}();
@@ -0,0 +1,85 @@
/*
Language: Markdown
Requires: xml.js
Author: John Crepezzi <john.crepezzi@gmail.com>
Website: http://seejohncode.com/
*/
hljs.LANGUAGES.markdown = {
case_insensitive: true,
defaultMode: {
contains: [
// highlight headers
{
className: 'header',
begin: '^#{1,3}', end: '$'
},
{
className: 'header',
begin: '^.+?\\n[=-]{2,}$'
},
// inline html
{
begin: '<', end: '>',
subLanguage: 'xml',
relevance: 0
},
// lists (indicators only)
{
className: 'bullet',
begin: '^([*+-]|(\\d+\\.))\\s+'
},
// strong segments
{
className: 'strong',
begin: '[*_]{2}.+?[*_]{2}'
},
// emphasis segments
{
className: 'emphasis',
begin: '\\*.+?\\*'
},
{
className: 'emphasis',
begin: '_.+?_',
relevance: 0
},
// blockquotes
{
className: 'blockquote',
begin: '^>\\s+', end: '$'
},
// code snippets
{
className: 'code',
begin: '`.+?`'
},
{
className: 'code',
begin: '^ ', end: '$',
relevance: 0
},
// horizontal rules
{
className: 'horizontal_rule',
begin: '^-{3,}', end: '$'
},
// using links - title and link
{
begin: '\\[.+?\\]\\(.+?\\)',
returnBegin: true,
contains: [
{
className: 'link_label',
begin: '\\[.+\\]'
},
{
className: 'link_url',
begin: '\\(', end: '\\)',
excludeBegin: true, excludeEnd: true
}
]
}
]
}
};
@@ -0,0 +1,75 @@
/*
Language: Matlab
Author: Denis Bardadym <bardadymchik@gmail.com>
*/
hljs.LANGUAGES.matlab = {
defaultMode: {
keywords: {
'keyword': {
'break': 1, 'case': 1,'catch': 1,'classdef': 1,'continue': 1,'else': 1,'elseif': 1,'end': 1,'enumerated': 1,
'events': 1,'for': 1,'function': 1,'global': 1,'if': 1,'methods': 1,'otherwise': 1,'parfor': 1,
'persistent': 1,'properties': 1,'return': 1,'spmd': 1,'switch': 1,'try': 1,'while': 1
},
'built_in': {
'sin': 1,'sind': 1,'sinh': 1,'asin': 1,'asind': 1,'asinh': 1,'cos': 1,'cosd': 1,'cosh': 1,
'acos': 1,'acosd': 1,'acosh': 1,'tan': 1,'tand': 1,'tanh': 1,'atan': 1,'atand': 1,'atan2': 1,
'atanh': 1,'sec': 1,'secd': 1,'sech': 1,'asec': 1,'asecd': 1,'asech': 1,'csc': 1,'cscd': 1,
'csch': 1,'acsc': 1,'acscd': 1,'acsch': 1,'cot': 1,'cotd': 1,'coth': 1,'acot': 1,'acotd': 1,
'acoth': 1,'hypot': 1,'exp': 1,'expm1': 1,'log': 1,'log1p': 1,'log10': 1,'log2': 1,'pow2': 1,
'realpow': 1,'reallog': 1,'realsqrt': 1,'sqrt': 1,'nthroot': 1,'nextpow2': 1,'abs': 1,
'angle': 1,'complex': 1,'conj': 1,'imag': 1,'real': 1,'unwrap': 1,'isreal': 1,'cplxpair': 1,
'fix': 1,'floor': 1,'ceil': 1,'round': 1,'mod': 1,'rem': 1,'sign': 1,
'airy': 1,'besselj': 1,'bessely': 1,'besselh': 1,'besseli': 1,'besselk': 1,'beta': 1,
'betainc': 1,'betaln': 1,'ellipj': 1,'ellipke': 1,'erf': 1,'erfc': 1,'erfcx': 1,
'erfinv': 1,'expint': 1,'gamma': 1,'gammainc': 1,'gammaln': 1,'psi': 1,'legendre': 1,
'cross': 1,'dot': 1,'factor': 1,'isprime': 1,'primes': 1,'gcd': 1,'lcm': 1,'rat': 1,
'rats': 1,'perms': 1,'nchoosek': 1,'factorial': 1,'cart2sph': 1,'cart2pol': 1,
'pol2cart': 1,'sph2cart': 1,'hsv2rgb': 1,'rgb2hsv': 1,
'zeros': 1,'ones': 1,'eye': 1,'repmat': 1,'rand': 1,'randn': 1,'linspace': 1,'logspace': 1,
'freqspace': 1,'meshgrid': 1,'accumarray': 1,'size': 1,'length': 1,'ndims': 1,'numel': 1,
'disp': 1,'isempty': 1,'isequal': 1,'isequalwithequalnans': 1,'cat': 1,'reshape': 1,
'diag': 1,'blkdiag': 1,'tril': 1,'triu': 1,'fliplr': 1,'flipud': 1,'flipdim': 1,'rot90': 1,
'find': 1, 'sub2ind': 1,'ind2sub': 1,'bsxfun': 1,'ndgrid': 1,'permute': 1,
'ipermute': 1,'shiftdim': 1,'circshift': 1,'squeeze': 1,'isscalar': 1,'isvector': 1,
'ans': 1,'eps': 1,'realmax': 1,'realmin': 1,'pi': 1,'i': 1,'inf': 1,'nan': 1,'isnan': 1,
'isinf': 1,'isfinite': 1,'j': 1,'why': 1,'compan': 1,'gallery': 1,'hadamard': 1,'hankel': 1,
'hilb': 1,'invhilb': 1,'magic': 1,'pascal': 1,'rosser': 1,'toeplitz': 1,'vander': 1,
'wilkinson': 1
},
},
illegal: '(//|"|#|/\\*|\\s+/\\w+)',
contains: [
{
className: 'function',
beginWithKeyword: true, end: '$',
keywords: {'function': 1},
contains: [
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
},
{
className: 'params',
begin: '\\(', end: '\\)'
},
{
className: 'params',
begin: '\\[', end: '\\]'
}
]
},
{
className: 'string',
begin: '\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
relevance: 0
},
{
className: 'comment',
begin: '\\%', end: '$'
},
hljs.C_NUMBER_MODE
]
}
};
File diff suppressed because one or more lines are too long
@@ -0,0 +1,220 @@
/*
Language: Nginx
Author: Peter Leonov <gojpeg@yandex.ru>
*/
hljs.LANGUAGES.nginx = function() {
var VAR1 = {
className: 'variable',
begin: '\\$\\d+'
};
var VAR2 = {
className: 'variable',
begin: '\\${', end: '}'
};
var VAR3 = {
className: 'variable',
begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE
};
return {
defaultMode: {
contains: [
hljs.HASH_COMMENT_MODE,
{ // directive
begin: hljs.UNDERSCORE_IDENT_RE, end: ';|{', returnEnd: true,
keywords: {
accept_mutex: 1, accept_mutex_delay: 1, access_log: 1,
add_after_body: 1, add_before_body: 1, add_header: 1,
addition_types: 1, alias: 1, allow: 1, ancient_browser: 1,
ancient_browser_value: 1, auth_basic: 1, auth_basic_user_file: 1,
autoindex: 1, autoindex_exact_size: 1, autoindex_localtime: 1,
'break': 1, charset: 1, charset_map: 1,
charset_types: 1, client_body_buffer_size: 1,
client_body_in_file_only: 1, client_body_in_single_buffer: 1,
client_body_temp_path: 1, client_body_timeout: 1,
client_header_buffer_size: 1, client_header_timeout: 1,
client_max_body_size: 1, connection_pool_size: 1, connections: 1,
create_full_put_path: 1, daemon: 1, dav_access: 1, dav_methods: 1,
debug_connection: 1, debug_points: 1, default_type: 1, deny: 1,
directio: 1, directio_alignment: 1, echo: 1, echo_after_body: 1,
echo_before_body: 1, echo_blocking_sleep: 1, echo_duplicate: 1,
echo_end: 1, echo_exec: 1, echo_flush: 1, echo_foreach_split: 1,
echo_location: 1, echo_location_async: 1, echo_read_request_body: 1,
echo_request_body: 1, echo_reset_timer: 1, echo_sleep: 1,
echo_subrequest: 1, echo_subrequest_async: 1, empty_gif: 1,
env: 1, error_log: 1, error_page: 1,
events: 1, expires: 1, fastcgi_bind: 1, fastcgi_buffer_size: 1,
fastcgi_buffers: 1, fastcgi_busy_buffers_size: 1, fastcgi_cache: 1,
fastcgi_cache_key: 1, fastcgi_cache_methods: 1,
fastcgi_cache_min_uses: 1, fastcgi_cache_path: 1,
fastcgi_cache_use_stale: 1, fastcgi_cache_valid: 1,
fastcgi_catch_stderr: 1, fastcgi_connect_timeout: 1,
fastcgi_hide_header: 1, fastcgi_ignore_client_abort: 1,
fastcgi_ignore_headers: 1, fastcgi_index: 1,
fastcgi_intercept_errors: 1, fastcgi_max_temp_file_size: 1,
fastcgi_next_upstream: 1, fastcgi_param: 1, fastcgi_pass: 1,
fastcgi_pass_header: 1, fastcgi_pass_request_body: 1,
fastcgi_pass_request_headers: 1, fastcgi_read_timeout: 1,
fastcgi_send_lowat: 1, fastcgi_send_timeout: 1,
fastcgi_split_path_info: 1, fastcgi_store: 1, fastcgi_store_access: 1,
fastcgi_temp_file_write_size: 1, fastcgi_temp_path: 1,
fastcgi_upstream_fail_timeout: 1, fastcgi_upstream_max_fails: 1,
flv: 1, geo: 1, geoip_city: 1, geoip_country: 1, gzip: 1,
gzip_buffers: 1, gzip_comp_level: 1, gzip_disable: 1, gzip_hash: 1,
gzip_http_version: 1, gzip_min_length: 1, gzip_no_buffer: 1,
gzip_proxied: 1, gzip_static: 1, gzip_types: 1, gzip_vary: 1,
gzip_window: 1, http: 1, 'if': 1, if_modified_since: 1,
ignore_invalid_headers: 1, image_filter: 1, image_filter_buffer: 1,
image_filter_jpeg_quality: 1, image_filter_transparency: 1, include: 1,
index: 1, internal: 1, ip_hash: 1, js: 1, js_load: 1, js_require: 1,
js_utf8: 1, keepalive_requests: 1, keepalive_timeout: 1,
kqueue_changes: 1, kqueue_events: 1, large_client_header_buffers: 1,
limit_conn: 1, limit_conn_log_level: 1, limit_except: 1, limit_rate: 1,
limit_rate_after: 1, limit_req: 1, limit_req_log_level: 1,
limit_req_zone: 1, limit_zone: 1, lingering_time: 1,
lingering_timeout: 1, listen: 1, location: 1, lock_file: 1,
log_format: 1, log_not_found: 1, log_subrequest: 1, map: 1,
map_hash_bucket_size: 1, map_hash_max_size: 1, master_process: 1,
memcached_bind: 1, memcached_buffer_size: 1,
memcached_connect_timeout: 1, memcached_next_upstream: 1,
memcached_pass: 1, memcached_read_timeout: 1,
memcached_send_timeout: 1, memcached_upstream_fail_timeout: 1,
memcached_upstream_max_fails: 1, merge_slashes: 1, min_delete_depth: 1,
modern_browser: 1, modern_browser_value: 1, more_clear_headers: 1,
more_clear_input_headers: 1, more_set_headers: 1,
more_set_input_headers: 1, msie_padding: 1, msie_refresh: 1,
multi_accept: 1, open_file_cache: 1, open_file_cache_errors: 1,
open_file_cache_events: 1, open_file_cache_min_uses: 1,
open_file_cache_retest: 1, open_file_cache_valid: 1,
open_log_file_cache: 1, optimize_server_names: 1, output_buffers: 1,
override_charset: 1, perl: 1, perl_modules: 1,
perl_require: 1, perl_set: 1, pid: 1, port_in_redirect: 1,
post_action: 1, postpone_gzipping: 1, postpone_output: 1,
proxy_bind: 1, proxy_buffer_size: 1, proxy_buffering: 1,
proxy_buffers: 1, proxy_busy_buffers_size: 1, proxy_cache: 1,
proxy_cache_key: 1, proxy_cache_methods: 1, proxy_cache_min_uses: 1,
proxy_cache_path: 1, proxy_cache_use_stale: 1, proxy_cache_valid: 1,
proxy_connect_timeout: 1, proxy_headers_hash_bucket_size: 1,
proxy_headers_hash_max_size: 1, proxy_hide_header: 1,
proxy_ignore_client_abort: 1, proxy_ignore_headers: 1,
proxy_intercept_errors: 1, proxy_max_temp_file_size: 1,
proxy_method: 1, proxy_next_upstream: 1, proxy_pass: 1,
proxy_pass_header: 1, proxy_pass_request_body: 1,
proxy_pass_request_headers: 1, proxy_read_timeout: 1,
proxy_redirect: 1, proxy_send_lowat: 1, proxy_send_timeout: 1,
proxy_set_body: 1, proxy_set_header: 1, proxy_store: 1,
proxy_store_access: 1, proxy_temp_file_write_size: 1,
proxy_temp_path: 1, proxy_upstream_fail_timeout: 1,
proxy_upstream_max_fails: 1, push_authorized_channels_only: 1,
push_channel_group: 1, push_max_channel_id_length: 1,
push_max_channel_subscribers: 1, push_max_message_buffer_length: 1,
push_max_reserved_memory: 1, push_message_buffer_length: 1,
push_message_timeout: 1, push_min_message_buffer_length: 1,
push_min_message_recipients: 1, push_publisher: 1,
push_store_messages: 1, push_subscriber: 1,
push_subscriber_concurrency: 1, random_index: 1, read_ahead: 1,
real_ip_header: 1, recursive_error_pages: 1, request_pool_size: 1,
reset_timedout_connection: 1, resolver: 1, resolver_timeout: 1,
'return': 1, rewrite: 1, rewrite_log: 1, root: 1, satisfy: 1,
satisfy_any: 1, send_lowat: 1, send_timeout: 1, sendfile: 1,
sendfile_max_chunk: 1, server: 1, server_name: 1,
server_name_in_redirect: 1, server_names_hash_bucket_size: 1,
server_names_hash_max_size: 1, server_tokens: 1, 'set': 1,
set_real_ip_from: 1, source_charset: 1, ssi: 1,
ssi_ignore_recycled_buffers: 1, ssi_min_file_chunk: 1,
ssi_silent_errors: 1, ssi_types: 1, ssi_value_length: 1, ssl: 1,
ssl_certificate: 1, ssl_certificate_key: 1, ssl_ciphers: 1,
ssl_client_certificate: 1, ssl_crl: 1, ssl_dhparam: 1,
ssl_prefer_server_ciphers: 1, ssl_protocols: 1, ssl_session_cache: 1,
ssl_session_timeout: 1, ssl_verify_client: 1, ssl_verify_depth: 1,
sub_filter: 1, sub_filter_once: 1, sub_filter_types: 1, tcp_nodelay: 1,
tcp_nopush: 1, timer_resolution: 1, try_files: 1, types: 1,
types_hash_bucket_size: 1, types_hash_max_size: 1,
underscores_in_headers: 1, uninitialized_variable_warn: 1, upstream: 1,
use: 1, user: 1, userid: 1, userid_domain: 1, userid_expires: 1, userid_mark: 1,
userid_name: 1, userid_p3p: 1, userid_path: 1, userid_service: 1,
valid_referers: 1, variables_hash_bucket_size: 1,
variables_hash_max_size: 1, worker_connections: 1,
worker_cpu_affinity: 1, worker_priority: 1, worker_processes: 1,
worker_rlimit_core: 1, worker_rlimit_nofile: 1,
worker_rlimit_sigpending: 1, working_directory: 1, xml_entities: 1,
xslt_stylesheet: 1, xslt_types: 1
},
relevance: 0,
contains: [
hljs.HASH_COMMENT_MODE,
{
begin: '\\s', end: '[;{]', returnBegin: true, returnEnd: true,
lexems: '[a-z/]+',
keywords: {
'built_in': {
'on': 1, 'off': 1, 'yes': 1, 'no': 1, 'true': 1, 'false': 1,
'none': 1, 'blocked': 1, 'debug': 1, 'info': 1, 'notice': 1,
'warn': 1, 'error': 1, 'crit': 1, 'select': 1, 'permanent': 1,
'redirect': 1, 'kqueue': 1, 'rtsig': 1, 'epoll': 1, 'poll': 1,
'/dev/poll': 1
}
},
relevance: 0,
contains: [
hljs.HASH_COMMENT_MODE,
{
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3],
relevance: 0
},
{
className: 'string',
begin: "'", end: "'",
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3],
relevance: 0
},
{
className: 'string',
begin: '([a-z]+):/', end: '[;\\s]', returnEnd: true
},
{
className: 'regexp',
begin: "\\s\\^", end: "\\s|{|;", returnEnd: true,
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
},
// regexp locations (~, ~*)
{
className: 'regexp',
begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true,
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
},
// *.example.com
{
className: 'regexp',
begin: "\\*(\\.[a-z\\-]+)+",
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
},
// sub.example.*
{
className: 'regexp',
begin: "([a-z\\-]+\\.)+\\*",
contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
},
// IP
{
className: 'number',
begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b'
},
// units
{
className: 'number',
begin: '\\s\\d+[kKmMgGdshdwy]*\\b',
relevance: 0
},
VAR1, VAR2, VAR3
]
}
]
}
]
}
}
}();
@@ -0,0 +1,94 @@
/*
Language: Objective C
Author: Valerii Hiora <valerii.hiora@gmail.com>
*/
hljs.LANGUAGES.objectivec = function(){
var OBJC_KEYWORDS = {
'keyword': {
'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, 'char': 1,
'catch': 1, 'export': 1, 'sizeof': 2, 'typedef': 2, 'const': 1,
'struct': 1, 'for': 1, 'union': 1, 'unsigned': 1, 'long': 1,
'volatile': 2, 'static': 1, 'protected': 1, 'bool': 1, 'mutable': 1,
'if': 1, 'public': 1, 'do': 1, 'return': 1, 'goto': 1, 'void': 2,
'enum': 1, 'else': 1, 'break': 1, 'extern': 1, 'true': 1, 'class': 1,
'asm': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'throw': 1,
'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, 'try': 1,
'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, 'inline': 1,
'readonly': 1, 'assign': 1, 'property': 1, 'protocol': 10, 'self': 1,
'synchronized': 1, 'end': 1, 'synthesize': 50, 'id': 1, 'optional': 1,
'required': 1, 'implementation': 10, 'nonatomic': 1,'interface': 1,
'super': 1, 'unichar': 1, 'finally': 2, 'dynamic': 2, 'nil': 1
},
'built_in': {
'YES': 5, 'NO': 5, 'NULL': 1, 'IBOutlet': 50, 'IBAction': 50,
'NSString': 50, 'NSDictionary': 50, 'CGRect': 50, 'CGPoint': 50,
'NSRange': 50, 'release': 1, 'retain': 1, 'autorelease': 50,
'UIButton': 50, 'UILabel': 50, 'UITextView': 50, 'UIWebView': 50,
'MKMapView': 50, 'UISegmentedControl': 50, 'NSObject': 50,
'UITableViewDelegate': 50, 'UITableViewDataSource': 50, 'NSThread': 50,
'UIActivityIndicator': 50, 'UITabbar': 50, 'UIToolBar': 50,
'UIBarButtonItem': 50, 'UIImageView': 50, 'NSAutoreleasePool': 50,
'UITableView': 50, 'BOOL': 1, 'NSInteger': 20, 'CGFloat': 20,
'NSException': 50, 'NSLog': 50, 'NSMutableString': 50,
'NSMutableArray': 50, 'NSMutableDictionary': 50, 'NSURL': 50
}
};
return {
defaultMode: {
keywords: OBJC_KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.C_NUMBER_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'',
end: '[^\\\\]\'',
illegal: '[^\\\\][^\']'
},
{
className: 'preprocessor',
begin: '#import',
end: '$',
contains: [
{
className: 'title',
begin: '\"',
end: '\"'
},
{
className: 'title',
begin: '<',
end: '>'
}
]
},
{
className: 'preprocessor',
begin: '#',
end: '$'
},
{
className: 'class',
beginWithKeyword: true,
end: '({|$)',
keywords: {
'interface': 1,
'class': 1,
'protocol': 5,
'implementation': 5
},
contains: [{
className: 'id',
begin: hljs.UNDERSCORE_IDENT_RE
}
]
}
]
}
};
}();
@@ -0,0 +1,50 @@
/*
Language: Parser3
Requires: xml.js
Author: Oleg Volchkov <oleg@volchkov.net>
*/
hljs.LANGUAGES.parser3 = {
defaultMode: {
subLanguage: 'html',
contains: [
{
className: 'comment',
begin: '^#', end: '$'
},
{
className: 'comment',
begin: '\\^rem{', end: '}',
relevance: 10,
contains: [
{
begin: '{', end: '}',
contains: ['self']
}
]
},
{
className: 'preprocessor',
begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
relevance: 10
},
{
className: 'title',
begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
},
{
className: 'variable',
begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?'
},
{
className: 'keyword',
begin: '\\^[\\w\\-\\.\\:]+'
},
{
className: 'number',
begin: '\\^#[0-9a-fA-F]+'
},
hljs.C_NUMBER_MODE
]
}
};
@@ -0,0 +1,181 @@
/*
Language: Perl
Author: Peter Leonov <gojpeg@yandex.ru>
*/
hljs.LANGUAGES.perl = function(){
var PERL_KEYWORDS = {
'getpwent': 1, 'getservent': 1, 'quotemeta': 1, 'msgrcv': 1, 'scalar': 1, 'kill': 1, 'dbmclose': 1, 'undef': 1,
'lc': 1, 'ma': 1, 'syswrite': 1, 'tr': 1, 'send': 1, 'umask': 1, 'sysopen': 1, 'shmwrite': 1, 'vec': 1, 'qx': 1,
'utime': 1, 'local': 1, 'oct': 1, 'semctl': 1, 'localtime': 1, 'readpipe': 1, 'do': 1, 'return': 1, 'format': 1,
'read': 1, 'sprintf': 1, 'dbmopen': 1, 'pop': 1, 'getpgrp': 1, 'not': 1, 'getpwnam': 1, 'rewinddir': 1, 'qq': 1,
'fileno': 1, 'qw': 1, 'endprotoent': 1, 'wait': 1, 'sethostent': 1, 'bless': 1, 's': 0, 'opendir': 1,
'continue': 1, 'each': 1, 'sleep': 1, 'endgrent': 1, 'shutdown': 1, 'dump': 1, 'chomp': 1, 'connect': 1,
'getsockname': 1, 'die': 1, 'socketpair': 1, 'close': 1, 'flock': 1, 'exists': 1, 'index': 1, 'shmget': 1,
'sub': 1, 'for': 1, 'endpwent': 1, 'redo': 1, 'lstat': 1, 'msgctl': 1, 'setpgrp': 1, 'abs': 1, 'exit': 1,
'select': 1, 'print': 1, 'ref': 1, 'gethostbyaddr': 1, 'unshift': 1, 'fcntl': 1, 'syscall': 1, 'goto': 1,
'getnetbyaddr': 1, 'join': 1, 'gmtime': 1, 'symlink': 1, 'semget': 1, 'splice': 1, 'x': 0, 'getpeername': 1,
'recv': 1, 'log': 1, 'setsockopt': 1, 'cos': 1, 'last': 1, 'reverse': 1, 'gethostbyname': 1, 'getgrnam': 1,
'study': 1, 'formline': 1, 'endhostent': 1, 'times': 1, 'chop': 1, 'length': 1, 'gethostent': 1, 'getnetent': 1,
'pack': 1, 'getprotoent': 1, 'getservbyname': 1, 'rand': 1, 'mkdir': 1, 'pos': 1, 'chmod': 1, 'y': 0, 'substr': 1,
'endnetent': 1, 'printf': 1, 'next': 1, 'open': 1, 'msgsnd': 1, 'readdir': 1, 'use': 1, 'unlink': 1,
'getsockopt': 1, 'getpriority': 1, 'rindex': 1, 'wantarray': 1, 'hex': 1, 'system': 1, 'getservbyport': 1,
'endservent': 1, 'int': 1, 'chr': 1, 'untie': 1, 'rmdir': 1, 'prototype': 1, 'tell': 1, 'listen': 1, 'fork': 1,
'shmread': 1, 'ucfirst': 1, 'setprotoent': 1, 'else': 1, 'sysseek': 1, 'link': 1, 'getgrgid': 1, 'shmctl': 1,
'waitpid': 1, 'unpack': 1, 'getnetbyname': 1, 'reset': 1, 'chdir': 1, 'grep': 1, 'split': 1, 'require': 1,
'caller': 1, 'lcfirst': 1, 'until': 1, 'warn': 1, 'while': 1, 'values': 1, 'shift': 1, 'telldir': 1, 'getpwuid': 1,
'my': 1, 'getprotobynumber': 1, 'delete': 1, 'and': 1, 'sort': 1, 'uc': 1, 'defined': 1, 'srand': 1, 'accept': 1,
'package': 1, 'seekdir': 1, 'getprotobyname': 1, 'semop': 1, 'our': 1, 'rename': 1, 'seek': 1, 'if': 1, 'q': 0,
'chroot': 1, 'sysread': 1, 'setpwent': 1, 'no': 1, 'crypt': 1, 'getc': 1, 'chown': 1, 'sqrt': 1, 'write': 1,
'setnetent': 1, 'setpriority': 1, 'foreach': 1, 'tie': 1, 'sin': 1, 'msgget': 1, 'map': 1, 'stat': 1,
'getlogin': 1, 'unless': 1, 'elsif': 1, 'truncate': 1, 'exec': 1, 'keys': 1, 'glob': 1, 'tied': 1, 'closedir': 1,
'ioctl': 1, 'socket': 1, 'readlink': 1, 'eval': 1, 'xor': 1, 'readline': 1, 'binmode': 1, 'setservent': 1,
'eof': 1, 'ord': 1, 'bind': 1, 'alarm': 1, 'pipe': 1, 'atan2': 1, 'getgrent': 1, 'exp': 1, 'time': 1, 'push': 1,
'setgrent': 1, 'gt': 1, 'lt': 1, 'or': 1, 'ne': 1, 'm': 0
};
var SUBST = {
className: 'subst',
begin: '[$@]\\{', end: '\\}',
keywords: PERL_KEYWORDS,
relevance: 10
};
var VAR1 = {
className: 'variable',
begin: '\\$\\d'
};
var VAR2 = {
className: 'variable',
begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)'
};
var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR1, VAR2];
var METHOD = {
begin: '->',
contains: [
{begin: hljs.IDENT_RE},
{begin: '{', end: '}'}
]
};
var COMMENT = {
className: 'comment',
begin: '^(__END__|__DATA__)', end: '\\n$',
relevance: 5
}
var PERL_DEFAULT_CONTAINS = [
VAR1, VAR2,
hljs.HASH_COMMENT_MODE,
COMMENT,
METHOD,
{
className: 'string',
begin: 'q[qwxr]?\\s*\\(', end: '\\)',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: 'q[qwxr]?\\s*\\[', end: '\\]',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: 'q[qwxr]?\\s*\\{', end: '\\}',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: 'q[qwxr]?\\s*\\|', end: '\\|',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: 'q[qwxr]?\\s*\\<', end: '\\>',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: 'qw\\s+q', end: 'q',
contains: STRING_CONTAINS,
relevance: 5
},
{
className: 'string',
begin: '\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
},
{
className: 'string',
begin: '"', end: '"',
contains: STRING_CONTAINS,
relevance: 0
},
{
className: 'string',
begin: '`', end: '`',
contains: [hljs.BACKSLASH_ESCAPE]
},
{
className: 'string',
begin: '{\\w+}',
relevance: 0
},
{
className: 'string',
begin: '\-?\\w+\\s*\\=\\>',
relevance: 0
},
{
className: 'number',
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
relevance: 0
},
{ // regexp container
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
keywords: {'split': 1, 'return': 1, 'print': 1, 'reverse': 1, 'grep': 1},
relevance: 0,
contains: [
hljs.HASH_COMMENT_MODE,
COMMENT,
{
className: 'regexp',
begin: '(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*',
relevance: 10
},
{
className: 'regexp',
begin: '(m|qr)?/', end: '/[a-z]*',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
}
]
},
{
className: 'sub',
begin: '\\bsub\\b', end: '(\\s*\\(.*?\\))?[;{]',
keywords: {'sub':1},
relevance: 5
},
{
className: 'operator',
begin: '-\\w\\b',
relevance: 0
},
{
className: 'pod',
begin: '\\=\\w', end: '\\=cut'
}
];
SUBST.contains = PERL_DEFAULT_CONTAINS;
METHOD.contains[1].contains = PERL_DEFAULT_CONTAINS;
return {
defaultMode: {
keywords: PERL_KEYWORDS,
contains: PERL_DEFAULT_CONTAINS
}
};
}();
@@ -0,0 +1,120 @@
/*
Language: PHP
Author: Victor Karamzin <Victor.Karamzin@enterra-inc.com>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Ivan Sagalaev <maniac@softwaremaniacs.org>
*/
hljs.LANGUAGES.php = function() {
var VARIABLE = {
className: 'variable', begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
};
var STRINGS = [
hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
{
className: 'string',
begin: 'b"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE]
},
{
className: 'string',
begin: 'b\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE]
}
];
var NUMBERS = [
hljs.C_NUMBER_MODE, // 0x..., 0..., decimal, float
hljs.BINARY_NUMBER_MODE // 0b...
];
var TITLE = {
className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
};
return {
case_insensitive: true,
defaultMode: {
keywords: {
'and': 1, 'include_once': 1, 'list': 1, 'abstract': 1, 'global': 1,
'private': 1, 'echo': 1, 'interface': 1, 'as': 1, 'static': 1,
'endswitch': 1, 'array': 1, 'null': 1, 'if': 1, 'endwhile': 1, 'or': 1,
'const': 1, 'for': 1, 'endforeach': 1, 'self': 1, 'var': 1, 'while': 1,
'isset': 1, 'public': 1, 'protected': 1, 'exit': 1, 'foreach': 1,
'throw': 1, 'elseif': 1, 'include': 1, '__FILE__': 1,
'empty': 1, 'require_once': 1, 'do': 1, 'xor': 1,
'return': 1, 'implements': 1, 'parent': 1, 'clone': 1, 'use': 1,
'__CLASS__': 1, '__LINE__': 1, 'else': 1, 'break': 1, 'print': 1,
'eval': 1, 'new': 1, 'catch': 1, '__METHOD__': 1, 'case': 1,
'exception': 1, 'php_user_filter': 1, 'default': 1, 'die': 1,
'require': 1, '__FUNCTION__': 1, 'enddeclare': 1, 'final': 1, 'try': 1,
'this': 1, 'switch': 1, 'continue': 1, 'endfor': 1, 'endif': 1,
'declare': 1, 'unset': 1, 'true': 1, 'false': 1, 'namespace': 1, 'trait':1,
'goto':1, 'instanceof':1, 'insteadof': 1, '__DIR__':1, '__NAMESPACE__':1, '__halt_compiler':1
},
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.HASH_COMMENT_MODE,
{
className: 'comment',
begin: '/\\*', end: '\\*/',
contains: [{
className: 'phpdoc',
begin: '\\s@[A-Za-z]+'
}]
},
{
className: 'comment',
excludeBegin: true,
begin: '__halt_compiler.+?;', end: hljs.EOF_RE
},
{
className: 'string',
begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',
contains: [hljs.BACKSLASH_ESCAPE]
},
{
className: 'preprocessor',
begin: '<\\?php',
relevance: 10
},
{
className: 'preprocessor',
begin: '\\?>'
},
VARIABLE,
{
className: 'function',
beginWithKeyword: true, end: '{',
keywords: {'function': 1},
illegal: '\\$',
contains: [
TITLE,
{
className: 'params',
begin: '\\(', end: '\\)',
contains: [
VARIABLE,
hljs.C_BLOCK_COMMENT_MODE
].concat(STRINGS).concat(NUMBERS)
}
]
},
{
className: 'class',
beginWithKeyword: true, end: '{',
keywords: {'class': 1},
illegal: '[:\\(\\$]',
contains: [
{
beginWithKeyword: true, endsWithParent: true,
keywords: {'extends': 1},
contains: [TITLE]
},
TITLE
]
},
{
begin: '=>' // No markup, just a relevance booster
}
].concat(STRINGS).concat(NUMBERS)
}
};
}();
@@ -0,0 +1,49 @@
/*
Language: Python profile
Description: Python profiler results
Author: Brian Beck <exogen@gmail.com>
*/
hljs.LANGUAGES.profile = {
defaultMode: {
contains: [
hljs.C_NUMBER_MODE,
{
className: 'builtin',
begin: '{', end: '}$',
excludeBegin: true, excludeEnd: true,
contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE],
relevance: 0
},
{
className: 'filename',
begin: '[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}', end: ':',
excludeEnd: true
},
{
className: 'header',
begin: '(ncalls|tottime|cumtime)', end: '$',
keywords: {'ncalls': 1, 'tottime': 10, 'cumtime': 10, 'filename': 1},
relevance: 10
},
{
className: 'summary',
begin: 'function calls', end: '$',
contains: [hljs.C_NUMBER_MODE],
relevance: 10
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'function',
begin: '\\(', end: '\\)$',
contains: [{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE,
relevance: 0
}],
relevance: 0
}
]
}
};
@@ -0,0 +1,82 @@
/*
Language: Python
*/
hljs.LANGUAGES.python = function() {
var STRINGS = [
{
className: 'string',
begin: '(u|b)?r?\'\'\'', end: '\'\'\'',
relevance: 10
},
{
className: 'string',
begin: '(u|b)?r?"""', end: '"""',
relevance: 10
},
{
className: 'string',
begin: '(u|r|ur)\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 10
},
{
className: 'string',
begin: '(u|r|ur)"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 10
},
{
className: 'string',
begin: '(b|br)\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE]
},
{
className: 'string',
begin: '(b|br)"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE]
}
].concat([
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]);
var TITLE = {
className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
};
var PARAMS = {
className: 'params',
begin: '\\(', end: '\\)',
contains: STRINGS.concat([hljs.C_NUMBER_MODE])
};
var FUNC_CLASS_PROTO = {
beginWithKeyword: true, end: ':',
illegal: '[${]',
contains: [TITLE, PARAMS],
relevance: 10
};
return {
defaultMode: {
keywords: {
'keyword': {
'and': 1, 'elif': 1, 'is': 1, 'global': 1, 'as': 1, 'in': 1, 'if': 1, 'from': 1, 'raise': 1, 'for': 1,
'except': 1, 'finally': 1, 'print': 1, 'import': 1, 'pass': 1, 'return': 1, 'exec': 1, 'else': 1,
'break': 1, 'not': 1, 'with': 1, 'class': 1, 'assert': 1, 'yield': 1, 'try': 1, 'while': 1, 'continue': 1,
'del': 1, 'or': 1, 'def': 1, 'lambda': 1, 'nonlocal': 10
},
'built_in': {'None': 1, 'True': 1, 'False': 1, 'Ellipsis': 1, 'NotImplemented': 1}
},
illegal: '(</|->|\\?)',
contains: STRINGS.concat([
hljs.HASH_COMMENT_MODE,
hljs.inherit(FUNC_CLASS_PROTO, {className: 'function', keywords: {'def': 1}}),
hljs.inherit(FUNC_CLASS_PROTO, {className: 'class', keywords: {'class': 1}}),
hljs.C_NUMBER_MODE,
{
className: 'decorator',
begin: '@', end: '$'
}
])
}
};
}();
@@ -0,0 +1,230 @@
/*
Language: RenderMan
Description: RenderMan Languages RIB and RSL
Author: Konstantin Evdokimenko <qewerty@gmail.com>
Contributors: Shuen-Huei Guan <drake.guan@gmail.com>
*/
hljs.LANGUAGES.rib = {
defaultMode: {
keywords: {
'keyword': {
'ArchiveRecord': 1,
'AreaLightSource': 1,
'Atmosphere': 1,
'Attribute': 1,
'AttributeBegin': 1,
'AttributeEnd': 1,
'Basis': 1,
'Begin': 1,
'Blobby': 1,
'Bound': 1,
'Clipping': 1,
'ClippingPlane': 1,
'Color': 1,
'ColorSamples': 1,
'ConcatTransform': 1,
'Cone': 1,
'CoordinateSystem': 1,
'CoordSysTransform': 1,
'CropWindow': 1,
'Curves': 1,
'Cylinder': 1,
'DepthOfField': 1,
'Detail': 1,
'DetailRange': 1,
'Disk': 1,
'Displacement': 1,
'Display': 1,
'End': 1,
'ErrorHandler': 1,
'Exposure': 1,
'Exterior': 1,
'Format': 1,
'FrameAspectRatio': 1,
'FrameBegin': 1,
'FrameEnd': 1,
'GeneralPolygon': 1,
'GeometricApproximation': 1,
'Geometry': 1,
'Hider': 1,
'Hyperboloid': 1,
'Identity': 1,
'Illuminate': 1,
'Imager': 1,
'Interior': 1,
'LightSource': 1,
'MakeCubeFaceEnvironment': 1,
'MakeLatLongEnvironment': 1,
'MakeShadow': 1,
'MakeTexture': 1,
'Matte': 1,
'MotionBegin': 1,
'MotionEnd': 1,
'NuPatch': 1,
'ObjectBegin': 1,
'ObjectEnd': 1,
'ObjectInstance': 1,
'Opacity': 1,
'Option': 1,
'Orientation': 1,
'Paraboloid': 1,
'Patch': 1,
'PatchMesh': 1,
'Perspective': 1,
'PixelFilter': 1,
'PixelSamples': 1,
'PixelVariance': 1,
'Points': 1,
'PointsGeneralPolygons': 1,
'PointsPolygons': 1,
'Polygon': 1,
'Procedural': 1,
'Projection': 1,
'Quantize': 1,
'ReadArchive': 1,
'RelativeDetail': 1,
'ReverseOrientation': 1,
'Rotate': 1,
'Scale': 1,
'ScreenWindow': 1,
'ShadingInterpolation': 1,
'ShadingRate': 1,
'Shutter': 1,
'Sides': 1,
'Skew': 1,
'SolidBegin': 1,
'SolidEnd': 1,
'Sphere': 1,
'SubdivisionMesh': 1,
'Surface': 1,
'TextureCoordinates': 1,
'Torus': 1,
'Transform': 1,
'TransformBegin': 1,
'TransformEnd': 1,
'TransformPoints': 1,
'Translate': 1,
'TrimCurve': 1,
'WorldBegin': 1,
'WorldEnd': 1
}
},
illegal: '</',
contains: [
hljs.HASH_COMMENT_MODE,
hljs.C_NUMBER_MODE,
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE
]
}
};
hljs.LANGUAGES.rsl = {
defaultMode: {
keywords: {
'keyword': {'float': 1, 'color': 1, 'point': 1, 'normal': 1, 'vector': 1,
'matrix': 1, 'while': 1, 'for': 1, 'if': 1, 'do': 1,
'return': 1, 'else': 1, 'break': 1, 'extern': 1, 'continue': 1},
'built_in': {
'abs': 1,
'acos': 1,
'ambient': 1,
'area': 1,
'asin': 1,
'atan': 1,
'atmosphere': 1,
'attribute': 1,
'calculatenormal': 1,
'ceil': 1,
'cellnoise': 1,
'clamp': 1,
'comp': 1,
'concat': 1,
'cos': 1,
'degrees': 1,
'depth': 1,
'Deriv': 1,
'diffuse': 1,
'distance': 1,
'Du': 1,
'Dv': 1,
'environment': 1,
'exp': 1,
'faceforward': 1,
'filterstep': 1,
'floor': 1,
'format': 1,
'fresnel': 1,
'incident': 1,
'length': 1,
'lightsource': 1,
'log': 1,
'match': 1,
'max': 1,
'min': 1,
'mod': 1,
'noise': 1,
'normalize': 1,
'ntransform': 1,
'opposite': 1,
'option': 1,
'phong': 1,
'pnoise': 1,
'pow': 1,
'printf': 1,
'ptlined': 1,
'radians': 1,
'random': 1,
'reflect': 1,
'refract': 1,
'renderinfo': 1,
'round': 1,
'setcomp': 1,
'setxcomp': 1,
'setycomp': 1,
'setzcomp': 1,
'shadow': 1,
'sign': 1,
'sin': 1,
'smoothstep': 1,
'specular': 1,
'specularbrdf': 1,
'spline': 1,
'sqrt': 1,
'step': 1,
'tan': 1,
'texture': 1,
'textureinfo': 1,
'trace': 1,
'transform': 1,
'vtransform': 1,
'xcomp': 1,
'ycomp': 1,
'zcomp': 1
}
},
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '#', end: '$'
},
{
className: 'shader',
beginWithKeyword: true, end: '\\(',
keywords: {'surface': 1, 'displacement': 1, 'light': 1, 'volume': 1, 'imager': 1}
},
{
className: 'shading',
beginWithKeyword: true, end: '\\(',
keywords: {'illuminate': 1, 'illuminance': 1, 'gather': 1}
}
]
}
};
@@ -0,0 +1,253 @@
/*
Language: Ruby
Author: Anton Kovalyov <anton@kovalyov.net>
Contributors: Peter Leonov <gojpeg@yandex.ru>, Vasily Polovnyov <vast@whiteants.net>, Loren Segal <lsegal@soen.ca>
*/
hljs.LANGUAGES.ruby = function(){
var RUBY_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
var RUBY_KEYWORDS = {
'keyword': {
'and': 1, 'false': 1, 'then': 1, 'defined': 1, 'module': 1, 'in': 1, 'return': 1, 'redo': 1, 'if': 1,
'BEGIN': 1, 'retry': 1, 'end': 1, 'for': 1, 'true': 1, 'self': 1, 'when': 1, 'next': 1, 'until': 1, 'do': 1,
'begin': 1, 'unless': 1, 'END': 1, 'rescue': 1, 'nil': 1, 'else': 1, 'break': 1, 'undef': 1, 'not': 1,
'super': 1, 'class': 1, 'case': 1, 'require': 1, 'yield': 1, 'alias': 1, 'while': 1, 'ensure': 1,
'elsif': 1, 'or': 1, 'def': 1
},
'keymethods': {
'__id__': 1, '__send__': 1, 'abort': 1, 'abs': 1, 'all?': 1, 'allocate': 1, 'ancestors': 1, 'any?': 1,
'arity': 1, 'assoc': 1, 'at': 1, 'at_exit': 1, 'autoload': 1, 'autoload?': 1, 'between?': 1, 'binding': 1,
'binmode': 1, 'block_given?': 1, 'call': 1, 'callcc': 1, 'caller': 1, 'capitalize': 1, 'capitalize!': 1,
'casecmp': 1, 'catch': 1, 'ceil': 1, 'center': 1, 'chomp': 1, 'chomp!': 1, 'chop': 1, 'chop!': 1, 'chr': 1,
'class': 1, 'class_eval': 1, 'class_variable_defined?': 1, 'class_variables': 1, 'clear': 1, 'clone': 1,
'close': 1, 'close_read': 1, 'close_write': 1, 'closed?': 1, 'coerce': 1, 'collect': 1, 'collect!': 1,
'compact': 1, 'compact!': 1, 'concat': 1, 'const_defined?': 1, 'const_get': 1, 'const_missing': 1,
'const_set': 1, 'constants': 1, 'count': 1, 'crypt': 1, 'default': 1, 'default_proc': 1, 'delete': 1,
'delete!': 1, 'delete_at': 1, 'delete_if': 1, 'detect': 1, 'display': 1, 'div': 1, 'divmod': 1,
'downcase': 1, 'downcase!': 1, 'downto': 1, 'dump': 1, 'dup': 1, 'each': 1, 'each_byte': 1,
'each_index': 1, 'each_key': 1, 'each_line': 1, 'each_pair': 1, 'each_value': 1, 'each_with_index': 1,
'empty?': 1, 'entries': 1, 'eof': 1, 'eof?': 1, 'eql?': 1, 'equal?': 1, 'eval': 1, 'exec': 1, 'exit': 1,
'exit!': 1, 'extend': 1, 'fail': 1, 'fcntl': 1, 'fetch': 1, 'fileno': 1, 'fill': 1, 'find': 1, 'find_all': 1,
'first': 1, 'flatten': 1, 'flatten!': 1, 'floor': 1, 'flush': 1, 'for_fd': 1, 'foreach': 1, 'fork': 1,
'format': 1, 'freeze': 1, 'frozen?': 1, 'fsync': 1, 'getc': 1, 'gets': 1, 'global_variables': 1, 'grep': 1,
'gsub': 1, 'gsub!': 1, 'has_key?': 1, 'has_value?': 1, 'hash': 1, 'hex': 1, 'id': 1, 'include': 1,
'include?': 1, 'included_modules': 1, 'index': 1, 'indexes': 1, 'indices': 1, 'induced_from': 1,
'inject': 1, 'insert': 1, 'inspect': 1, 'instance_eval': 1, 'instance_method': 1, 'instance_methods': 1,
'instance_of?': 1, 'instance_variable_defined?': 1, 'instance_variable_get': 1, 'instance_variable_set': 1,
'instance_variables': 1, 'integer?': 1, 'intern': 1, 'invert': 1, 'ioctl': 1, 'is_a?': 1, 'isatty': 1,
'iterator?': 1, 'join': 1, 'key?': 1, 'keys': 1, 'kind_of?': 1, 'lambda': 1, 'last': 1, 'length': 1,
'lineno': 1, 'ljust': 1, 'load': 1, 'local_variables': 1, 'loop': 1, 'lstrip': 1, 'lstrip!': 1, 'map': 1,
'map!': 1, 'match': 1, 'max': 1, 'member?': 1, 'merge': 1, 'merge!': 1, 'method': 1, 'method_defined?': 1,
'method_missing': 1, 'methods': 1, 'min': 1, 'module_eval': 1, 'modulo': 1, 'name': 1, 'nesting': 1, 'new': 1,
'next': 1, 'next!': 1, 'nil?': 1, 'nitems': 1, 'nonzero?': 1, 'object_id': 1, 'oct': 1, 'open': 1, 'pack': 1,
'partition': 1, 'pid': 1, 'pipe': 1, 'pop': 1, 'popen': 1, 'pos': 1, 'prec': 1, 'prec_f': 1, 'prec_i': 1,
'print': 1, 'printf': 1, 'private_class_method': 1, 'private_instance_methods': 1, 'private_method_defined?': 1,
'private_methods': 1, 'proc': 1, 'protected_instance_methods': 1, 'protected_method_defined?': 1,
'protected_methods': 1, 'public_class_method': 1, 'public_instance_methods': 1, 'public_method_defined?': 1,
'public_methods': 1, 'push': 1, 'putc': 1, 'puts': 1, 'quo': 1, 'raise': 1, 'rand': 1, 'rassoc': 1, 'read': 1,
'read_nonblock': 1, 'readchar': 1, 'readline': 1, 'readlines': 1, 'readpartial': 1, 'rehash': 1, 'reject': 1,
'reject!': 1, 'remainder': 1, 'reopen': 1, 'replace': 1, 'require': 1, 'respond_to?': 1, 'reverse': 1,
'reverse!': 1, 'reverse_each': 1, 'rewind': 1, 'rindex': 1, 'rjust': 1, 'round': 1, 'rstrip': 1, 'rstrip!': 1,
'scan': 1, 'seek': 1, 'select': 1, 'send': 1, 'set_trace_func': 1, 'shift': 1, 'singleton_method_added': 1,
'singleton_methods': 1, 'size': 1, 'sleep': 1, 'slice': 1, 'slice!': 1, 'sort': 1, 'sort!': 1, 'sort_by': 1,
'split': 1, 'sprintf': 1, 'squeeze': 1, 'squeeze!': 1, 'srand': 1, 'stat': 1, 'step': 1, 'store': 1, 'strip': 1,
'strip!': 1, 'sub': 1, 'sub!': 1, 'succ': 1, 'succ!': 1, 'sum': 1, 'superclass': 1, 'swapcase': 1, 'swapcase!': 1,
'sync': 1, 'syscall': 1, 'sysopen': 1, 'sysread': 1, 'sysseek': 1, 'system': 1, 'syswrite': 1, 'taint': 1,
'tainted?': 1, 'tell': 1, 'test': 1, 'throw': 1, 'times': 1, 'to_a': 1, 'to_ary': 1, 'to_f': 1, 'to_hash': 1,
'to_i': 1, 'to_int': 1, 'to_io': 1, 'to_proc': 1, 'to_s': 1, 'to_str': 1, 'to_sym': 1, 'tr': 1, 'tr!': 1,
'tr_s': 1, 'tr_s!': 1, 'trace_var': 1, 'transpose': 1, 'trap': 1, 'truncate': 1, 'tty?': 1, 'type': 1,
'ungetc': 1, 'uniq': 1, 'uniq!': 1, 'unpack': 1, 'unshift': 1, 'untaint': 1, 'untrace_var': 1, 'upcase': 1,
'upcase!': 1, 'update': 1, 'upto': 1, 'value?': 1, 'values': 1, 'values_at': 1, 'warn': 1, 'write': 1,
'write_nonblock': 1, 'zero?': 1, 'zip': 1
}
};
var YARDOCTAG = {
className: 'yardoctag',
begin: '@[A-Za-z]+'
};
var COMMENTS = [
{
className: 'comment',
begin: '#', end: '$',
contains: [YARDOCTAG]
},
{
className: 'comment',
begin: '^\\=begin', end: '^\\=end',
contains: [YARDOCTAG],
relevance: 10
},
{
className: 'comment',
begin: '^__END__', end: '\\n$'
}
];
var SUBST = {
className: 'subst',
begin: '#\\{', end: '}',
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS
};
var STR_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST];
var STRINGS = [
{
className: 'string',
begin: '\'', end: '\'',
contains: STR_CONTAINS,
relevance: 0
},
{
className: 'string',
begin: '"', end: '"',
contains: STR_CONTAINS,
relevance: 0
},
{
className: 'string',
begin: '%[qw]?\\(', end: '\\)',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?\\[', end: '\\]',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?{', end: '}',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?<', end: '>',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?/', end: '/',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?%', end: '%',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?-', end: '-',
contains: STR_CONTAINS,
relevance: 10
},
{
className: 'string',
begin: '%[qw]?\\|', end: '\\|',
contains: STR_CONTAINS,
relevance: 10
}
];
var FUNCTION = {
className: 'function',
begin: '\\bdef\\s+', end: ' |$|;',
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS,
contains: [
{
className: 'title',
begin: RUBY_METHOD_RE,
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS
},
{
className: 'params',
begin: '\\(', end: '\\)',
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS
}
].concat(COMMENTS)
};
var IDENTIFIER = {
className: 'identifier',
begin: RUBY_IDENT_RE,
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS,
relevance: 0
};
var RUBY_DEFAULT_CONTAINS = COMMENTS.concat(STRINGS.concat([
{
className: 'class',
begin: '\\b(class|module)\\b', end: '$|;',
keywords: {'class': 1, 'module': 1},
contains: [
{
className: 'title',
begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?',
relevance: 0
},
{
className: 'inheritance',
begin: '<\\s*',
contains: [{
className: 'parent',
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE
}]
}
].concat(COMMENTS)
},
FUNCTION,
{
className: 'constant',
begin: '(::)?([A-Z]\\w*(::)?)+',
relevance: 0
},
{
className: 'symbol',
begin: ':',
contains: STRINGS.concat([IDENTIFIER]),
relevance: 0
},
{
className: 'number',
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
relevance: 0
},
{
className: 'number',
begin: '\\?\\w'
},
{
className: 'variable',
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))'
},
IDENTIFIER,
{ // regexp container
begin: '(' + hljs.RE_STARTERS_RE + ')\\s*',
contains: COMMENTS.concat([
{
className: 'regexp',
begin: '/', end: '/[a-z]*',
illegal: '\\n',
contains: [hljs.BACKSLASH_ESCAPE]
}
]),
relevance: 0
}
]));
SUBST.contains = RUBY_DEFAULT_CONTAINS;
FUNCTION.contains[1].contains = RUBY_DEFAULT_CONTAINS;
return {
defaultMode: {
lexems: RUBY_IDENT_RE,
keywords: RUBY_KEYWORDS,
contains: RUBY_DEFAULT_CONTAINS
}
};
}();
@@ -0,0 +1,77 @@
/*
Language: Rust
Author: Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
*/
hljs.LANGUAGES.rust = function() {
var TITLE = {
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
};
var QUOTE_STRING = {
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE],
relevance: 0
};
var NUMBER = {
className: 'number',
begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
relevance: 0
};
var KEYWORDS = {
'alt': 1, 'any': 1, 'as': 1, 'assert': 1,
'be': 1, 'bind': 1, 'block': 1, 'bool': 1, 'break': 1,
'char': 1, 'check': 1, 'claim': 1, 'const': 1, 'cont': 1,
'dir': 1, 'do': 1,
'else': 1, 'enum': 1, 'export': 1,
'f32': 1, 'f64': 1, 'fail': 1, 'false': 1, 'float': 1, 'fn': 10, 'for': 1,
'i16': 1, 'i32': 1, 'i64': 1, 'i8': 1, 'if': 1, 'iface': 10, 'impl': 10, 'import': 1, 'in': 1, 'int': 1,
'let': 1, 'log': 1,
'mod': 1, 'mutable': 1,
'native': 1, 'note': 1,
'of': 1,
'prove': 1, 'pure': 10,
'resource': 1, 'ret': 1,
'self': 1, 'str': 1, 'syntax': 1,
'true': 1, 'type': 1,
'u16': 1, 'u32': 1, 'u64': 1, 'u8': 1, 'uint': 1, 'unchecked': 1, 'unsafe': 1, 'use': 1,
'vec': 1,
'while': 1
};
return {
defaultMode: {
keywords: KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
QUOTE_STRING,
hljs.APOS_STRING_MODE,
NUMBER,
{
className: 'function',
beginWithKeyword: true, end: '(\\(|<)',
keywords: {'fn': 1},
contains: [TITLE]
},
{
className: 'preprocessor',
begin: '#\\[', end: '\\]'
},
{
beginWithKeyword: true, end: '(=|<)',
keywords: {'type': 1},
contains: [TITLE],
illegal: '\\S'
},
{
beginWithKeyword: true, end: '({|<)',
keywords: {'iface': 1, 'enum': 1},
contains: [TITLE],
illegal: '\\S'
}
]
}
};
}();
@@ -0,0 +1,66 @@
/*
Language: Scala
Author: Jan Berkel <jan.berkel@gmail.com>
*/
hljs.LANGUAGES.scala = function() {
var ANNOTATION = {
className: 'annotation', begin: '@[A-Za-z]+'
};
var STRING = {
className: 'string',
begin: 'u?r?"""', end: '"""',
relevance: 10
};
return {
defaultMode: {
keywords: {
'type': 1, 'yield': 1, 'lazy': 1, 'override': 1, 'def': 1, 'with': 1, 'val':1, 'var': 1, 'false': 1, 'true': 1,
'sealed': 1, 'abstract': 1, 'private': 1, 'trait': 1, 'object': 1, 'null': 1, 'if': 1, 'for': 1, 'while': 1,
'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'import': 1, 'final': 1, 'return': 1, 'else': 1,
'break': 1, 'new': 1, 'catch': 1, 'super': 1, 'class': 1, 'case': 1,'package': 1, 'default': 1, 'try': 1,
'this': 1, 'match': 1, 'continue': 1, 'throws': 1
},
contains: [
{
className: 'javadoc',
begin: '/\\*\\*', end: '\\*/',
contains: [{
className: 'javadoctag',
begin: '@[A-Za-z]+'
}],
relevance: 10
},
hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE,
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, STRING,
{
className: 'class',
begin: '((case )?class |object |trait )', end: '({|$)', // beginWithKeyword won't work because a single "case" shouldn't start this mode
illegal: ':',
keywords: {'case' : 1, 'class': 1, 'trait': 1, 'object': 1},
contains: [
{
beginWithKeyword: true,
keywords: {'extends': 1, 'with': 1},
relevance: 10
},
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
},
{
className: 'params',
begin: '\\(', end: '\\)',
contains: [
hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, STRING,
ANNOTATION
]
}
]
},
hljs.C_NUMBER_MODE,
ANNOTATION
]
}
};
}();
@@ -0,0 +1,55 @@
/*
Language: Smalltalk
Author: Vladimir Gubarkov <xonixx@gmail.com>
*/
hljs.LANGUAGES.smalltalk = function() {
var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
var CHAR = {
className: 'char',
begin: '\\$.{1}'
};
var SYMBOL = {
className: 'symbol',
begin: '#' + hljs.UNDERSCORE_IDENT_RE
};
return {
defaultMode: {
keywords: {'self': 1, 'super': 1, 'nil': 1, 'true': 1, 'false': 1, 'thisContext': 1}, // only 6
contains: [
{
className: 'comment',
begin: '"', end: '"',
relevance: 0
},
hljs.APOS_STRING_MODE,
{
className: 'class',
begin: '\\b[A-Z][A-Za-z0-9_]*',
relevance: 0
},
{
className: 'method',
begin: VAR_IDENT_RE + ':'
},
hljs.C_NUMBER_MODE,
SYMBOL,
CHAR,
{
className: 'localvars',
begin: '\\|\\s*((' + VAR_IDENT_RE + ')\\s*)+\\|'
},
{
className: 'array',
begin: '\\#\\(', end: '\\)',
contains: [
hljs.APOS_STRING_MODE,
CHAR,
hljs.C_NUMBER_MODE,
SYMBOL
]
}
]
}
};
}();
@@ -0,0 +1,89 @@
/*
Language: SQL
*/
hljs.LANGUAGES.sql = {
case_insensitive: true,
defaultMode: {
illegal: '[^\\s]',
contains: [
{
className: 'operator',
begin: '(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b', end: ';|' + hljs.EOF_RE,
keywords: {
'keyword': {
'all': 1, 'partial': 1, 'global': 1, 'month': 1,
'current_timestamp': 1, 'using': 1, 'go': 1, 'revoke': 1,
'smallint': 1, 'indicator': 1, 'end-exec': 1, 'disconnect': 1,
'zone': 1, 'with': 1, 'character': 1, 'assertion': 1, 'to': 1,
'add': 1, 'current_user': 1, 'usage': 1, 'input': 1, 'local': 1,
'alter': 1, 'match': 1, 'collate': 1, 'real': 1, 'then': 1,
'rollback': 1, 'get': 1, 'read': 1, 'timestamp': 1,
'session_user': 1, 'not': 1, 'integer': 1, 'bit': 1, 'unique': 1,
'day': 1, 'minute': 1, 'desc': 1, 'insert': 1, 'execute': 1,
'like': 1, 'ilike': 2, 'level': 1, 'decimal': 1, 'drop': 1,
'continue': 1, 'isolation': 1, 'found': 1, 'where': 1,
'constraints': 1, 'domain': 1, 'right': 1, 'national': 1, 'some': 1,
'module': 1, 'transaction': 1, 'relative': 1, 'second': 1,
'connect': 1, 'escape': 1, 'close': 1, 'system_user': 1, 'for': 1,
'deferred': 1, 'section': 1, 'cast': 1, 'current': 1, 'sqlstate': 1,
'allocate': 1, 'intersect': 1, 'deallocate': 1, 'numeric': 1,
'public': 1, 'preserve': 1, 'full': 1, 'goto': 1, 'initially': 1,
'asc': 1, 'no': 1, 'key': 1, 'output': 1, 'collation': 1, 'group': 1,
'by': 1, 'union': 1, 'session': 1, 'both': 1, 'last': 1,
'language': 1, 'constraint': 1, 'column': 1, 'of': 1, 'space': 1,
'foreign': 1, 'deferrable': 1, 'prior': 1, 'connection': 1,
'unknown': 1, 'action': 1, 'commit': 1, 'view': 1, 'or': 1,
'first': 1, 'into': 1, 'float': 1, 'year': 1, 'primary': 1,
'cascaded': 1, 'except': 1, 'restrict': 1, 'set': 1, 'references': 1,
'names': 1, 'table': 1, 'outer': 1, 'open': 1, 'select': 1,
'size': 1, 'are': 1, 'rows': 1, 'from': 1, 'prepare': 1,
'distinct': 1, 'leading': 1, 'create': 1, 'only': 1, 'next': 1,
'inner': 1, 'authorization': 1, 'schema': 1, 'corresponding': 1,
'option': 1, 'declare': 1, 'precision': 1, 'immediate': 1, 'else': 1,
'timezone_minute': 1, 'external': 1, 'varying': 1, 'translation': 1,
'true': 1, 'case': 1, 'exception': 1, 'join': 1, 'hour': 1,
'default': 1, 'double': 1, 'scroll': 1, 'value': 1, 'cursor': 1,
'descriptor': 1, 'values': 1, 'dec': 1, 'fetch': 1, 'procedure': 1,
'delete': 1, 'and': 1, 'false': 1, 'int': 1, 'is': 1, 'describe': 1,
'char': 1, 'as': 1, 'at': 1, 'in': 1, 'varchar': 1, 'null': 1,
'trailing': 1, 'any': 1, 'absolute': 1, 'current_time': 1, 'end': 1,
'grant': 1, 'privileges': 1, 'when': 1, 'cross': 1, 'check': 1,
'write': 1, 'current_date': 1, 'pad': 1, 'begin': 1, 'temporary': 1,
'exec': 1, 'time': 1, 'update': 1, 'catalog': 1, 'user': 1, 'sql': 1,
'date': 1, 'on': 1, 'identity': 1, 'timezone_hour': 1, 'natural': 1,
'whenever': 1, 'interval': 1, 'work': 1, 'order': 1, 'cascade': 1,
'diagnostics': 1, 'nchar': 1, 'having': 1, 'left': 1, 'call': 1,
'do': 1, 'handler': 1, 'load': 1, 'replace': 1, 'truncate': 1,
'start': 1, 'lock': 1, 'show': 1, 'pragma': 1},
'aggregate': {'count': 1, 'sum': 1, 'min': 1, 'max': 1, 'avg': 1}
},
contains: [
{
className: 'string',
begin: '\'', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
relevance: 0
},
{
className: 'string',
begin: '"', end: '"',
contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}],
relevance: 0
},
{
className: 'string',
begin: '`', end: '`',
contains: [hljs.BACKSLASH_ESCAPE]
},
hljs.C_NUMBER_MODE
]
},
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'comment',
begin: '--', end: '$'
}
]
}
};
@@ -0,0 +1,62 @@
/*
Language: TeX
Author: Vladimir Moskva <vladmos@gmail.com>
Website: http://fulc.ru/
*/
hljs.LANGUAGES.tex = function() {
var COMMAND1 = {
className: 'command',
begin: '\\\\[a-zA-Zа-яА-я]+[\\*]?',
relevance: 10
};
var COMMAND2 = {
className: 'command',
begin: '\\\\[^a-zA-Zа-яА-я0-9]',
relevance: 0
};
var SPECIAL = {
className: 'special',
begin: '[{}\\[\\]\\&#~]',
relevance: 0
};
return {
defaultMode: {
contains: [
{ // parameter
begin: '\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
returnBegin: true,
contains: [
COMMAND1, COMMAND2,
{
className: 'number',
begin: ' *=', end: '-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
excludeBegin: true
}
],
relevance: 10
},
COMMAND1, COMMAND2,
SPECIAL,
{
className: 'formula',
begin: '\\$\\$', end: '\\$\\$',
contains: [COMMAND1, COMMAND2, SPECIAL],
relevance: 0
},
{
className: 'formula',
begin: '\\$', end: '\\$',
contains: [COMMAND1, COMMAND2, SPECIAL],
relevance: 0
},
{
className: 'comment',
begin: '%', end: '$',
relevance: 0
}
]
}
};
}();
@@ -0,0 +1,74 @@
/*
Language: Vala
Author: Antono Vasiljev <antono.vasiljev@gmail.com>
Description: Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
*/
hljs.LANGUAGES.vala = {
defaultMode: {
keywords: {
keyword: {
// Value types
'char': 1, 'uchar': 1, 'unichar': 1,
'int': 1, 'uint': 1, 'long': 1, 'ulong': 1,
'short': 1, 'ushort': 1,
'int8': 1, 'int16': 1, 'int32': 1, 'int64': 1,
'uint8': 1, 'uint16': 1, 'uint32': 1, 'uint64': 1,
'float': 1, 'double': 1, 'bool': 1, 'struct': 1, 'enum': 1,
'string': 1, 'void': 1,
// Reference types
'weak': 5, 'unowned': 5, 'owned': 5,
// Modifiers
'async': 5, 'signal': 5, 'static': 1, 'abstract': 1, 'interface': 1, 'override': 1,
// Control Structures
'while': 1, 'do': 1, 'for': 1, 'foreach': 1, 'else': 1, 'switch': 1,
'case': 1, 'break': 1, 'default': 1, 'return': 1, 'try': 1, 'catch': 1,
// Visibility
'public': 1, 'private': 1, 'protected': 1, 'internal': 1,
// Other
'using': 1, 'new': 1, 'this': 1, 'get': 1, 'set': 1, 'const': 1,
'stdout': 1, 'stdin': 1, 'stderr': 1, 'var': 1,
// Builtins
'DBus': 2, 'GLib': 2, 'CCode': 10, 'Gee': 10, 'Object': 1
},
literal: { 'false': 1, 'true': 1, 'null': 1 }
},
contains: [
{
className: 'class',
beginWithKeyword: true, end: '{',
keywords: {'class': 1, 'interface': 1, 'delegate': 1, 'namespace': 1},
contains: [
{
beginWithKeyword: true,
keywords: {'extends': 1, 'implements': 1}
},
{
className: 'title',
begin: hljs.UNDERSCORE_IDENT_RE
}
]
},
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
{
className: 'string',
begin: '"""', end: '"""',
relevance: 5
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '^#', end: '$',
relevance: 2
},
{
className: 'constant',
begin: ' [A-Z_]+ ',
relevance: 0
}
]
}
};
@@ -0,0 +1,54 @@
/*
Language: VBScript
Author: Nikita Ledyaev <lenikita@yandex.ru>
Contributors: Michal Gabrukiewicz <mgabru@gmail.com>
*/
hljs.LANGUAGES.vbscript = {
case_insensitive: true,
defaultMode: {
keywords: {
'keyword': {
'call': 1, 'class': 1, 'const': 1, 'dim': 1, 'do': 1, 'loop': 1, 'erase': 1, 'execute': 1, 'executeglobal': 1,
'exit': 1, 'for': 1, 'each': 1, 'next': 1, 'function': 1, 'if': 1, 'then': 1, 'else': 1, 'on': 1, 'error': 1,
'option': 1, 'explicit': 1, 'new': 1, 'private': 1, 'property': 1, 'let': 1, 'get': 1, 'public': 1,
'randomize': 1, 'redim': 1, 'rem': 1, 'select': 1, 'case': 1, 'set': 1, 'stop': 1, 'sub': 1, 'while': 1,
'wend': 1, 'with': 1, 'end': 1, 'to': 1, 'elseif': 1, 'is': 1, 'or': 1, 'xor': 1, 'and': 1, 'not': 1,
'class_initialize': 1, 'class_terminate': 1, 'default': 1, 'preserve': 1, 'in': 1, 'me': 1, 'byval': 1,
'byref': 1, 'step': 1, 'resume': 1, 'goto': 1
},
'built_in': {
'lcase': 1, 'month': 1, 'vartype': 1, 'instrrev': 1, 'ubound': 1, 'setlocale': 1, 'getobject': 1,
'rgb': 1, 'getref': 1, 'string': 1, 'weekdayname': 1, 'rnd': 1, 'dateadd': 1, 'monthname': 1, 'now': 1,
'day': 1, 'minute': 1, 'isarray': 1, 'cbool': 1, 'round': 1, 'formatcurrency': 1, 'conversions': 1,
'csng': 1, 'timevalue': 1, 'second': 1, 'year': 1, 'space': 1, 'abs': 1, 'clng': 1, 'timeserial': 1,
'fixs': 1, 'len': 1, 'asc': 1, 'isempty': 1, 'maths': 1, 'dateserial': 1, 'atn': 1, 'timer': 1,
'isobject': 1, 'filter': 1, 'weekday': 1, 'datevalue': 1, 'ccur': 1, 'isdate': 1, 'instr': 1, 'datediff': 1,
'formatdatetime': 1, 'replace': 1, 'isnull': 1, 'right': 1, 'sgn': 1, 'array': 1, 'snumeric': 1, 'log': 1,
'cdbl': 1, 'hex': 1, 'chr': 1, 'lbound': 1, 'msgbox': 1, 'ucase': 1, 'getlocale': 1, 'cos': 1, 'cdate': 1,
'cbyte': 1, 'rtrim': 1, 'join': 1, 'hour': 1, 'oct': 1, 'typename': 1, 'trim': 1, 'strcomp': 1, 'int': 1,
'createobject': 1, 'loadpicture': 1, 'tan': 1, 'formatnumber': 1, 'mid': 1, 'scriptenginebuildversion': 1,
'scriptengine': 1, 'split': 1, 'scriptengineminorversion': 1, 'cint': 1, 'sin': 1, 'datepart': 1, 'ltrim': 1,
'sqr': 1, 'scriptenginemajorversion': 1, 'time': 1, 'derived': 1, 'eval': 1, 'date': 1, 'formatpercent': 1,
'exp': 1, 'inputbox': 1, 'left': 1, 'ascw': 1, 'chrw': 1, 'regexp': 1, 'server': 1, 'response': 1,
'request': 1, 'cstr': 1, 'err': 1
},
'literal': {'true': 1, 'false': 1, 'null': 1, 'nothing': 1, 'empty': 1}
},
illegal: '//',
contains: [
{ // can't use standard QUOTE_STRING_MODE since it's compiled with its own escape and doesn't use the local one
className: 'string',
begin: '"', end: '"',
illegal: '\\n',
contains: [{begin: '""'}],
relevance: 0
},
{
className: 'comment',
begin: '\'', end: '$'
},
hljs.C_NUMBER_MODE
]
}
};
@@ -0,0 +1,46 @@
/*
Language: VHDL
Description: VHDL is a hardware description language used in electronic design automation to describe digital and mixed-signal systems.
Author: Igor Kalnitsky <igor.kalnitsky@gmail.com>
Website: http://kalnitsky.org.ua/
*/
hljs.LANGUAGES.vhdl = {
case_insensitive: true,
defaultMode: {
keywords: {
'keyword': {
'abs': 1, 'access': 1, 'after': 1, 'alias': 1, 'all': 1, 'and': 1, 'architecture': 2, 'array': 1, 'assert': 1,
'attribute': 1, 'begin': 1, 'block': 1, 'body': 1, 'buffer': 1, 'bus': 1, 'case': 1, 'component': 2,
'configuration': 1, 'constant': 1, 'disconnect': 2, 'downto': 2, 'else': 1, 'elsif': 1, 'end': 1, 'entity': 2,
'exit': 1, 'file': 1, 'for': 1, 'function': 1, 'generate': 2, 'generic': 2, 'group': 1, 'guarded': 2, 'if': 0,
'impure': 2, 'in': 1, 'inertial': 1, 'inout': 1, 'is': 1, 'label': 1, 'library': 1, 'linkage': 1, 'literal': 1,
'loop': 1, 'map': 1, 'mod': 1, 'nand': 1, 'new': 1, 'next': 1, 'nor': 1, 'not': 1, 'null': 1, 'of': 1, 'on': 1,
'open': 1, 'or': 1, 'others': 1, 'out': 1, 'package': 1, 'port': 2, 'postponed': 1, 'procedure': 1,
'process': 1, 'pure': 2, 'range': 1, 'record': 1, 'register': 1, 'reject': 1, 'return': 1, 'rol': 1, 'ror': 1,
'select': 1, 'severity': 1, 'signal': 1, 'shared': 1, 'sla': 1, 'sli': 1, 'sra': 1, 'srl': 1, 'subtype': 2,
'then': 1, 'to': 1, 'transport': 1, 'type': 1, 'units': 1, 'until': 1, 'use': 1, 'variable': 1, 'wait': 1,
'when': 1, 'while': 1, 'with': 1, 'xnor': 1, 'xor': 1
},
'type': {
'boolean': 1, 'bit': 1, 'character': 1, 'severity_level': 2, 'integer': 1, 'time': 1, 'delay_length': 2,
'natural': 1, 'positive': 1, 'string': 1, 'bit_vector': 2, 'file_open_kind': 2, 'file_open_status': 2,
'std_ulogic': 2, 'std_ulogic_vector': 2, 'std_logic': 2, 'std_logic_vector': 2
}
},
illegal: '{',
contains: [
{
className: 'comment',
begin: '--', end: '$'
},
hljs.QUOTE_STRING_MODE,
hljs.C_NUMBER_MODE,
{
className: 'literal',
begin: '\'(U|X|0|1|Z|W|L|H|-)', end: '\'',
contains: [hljs.BACKSLASH_ESCAPE]
}
]
}
};
@@ -0,0 +1,110 @@
/*
Language: HTML, XML
*/
hljs.LANGUAGES.xml = function(){
var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
var TAG_INTERNALS = {
endsWithParent: true,
contains: [
{
className: 'attribute',
begin: XML_IDENT_RE,
relevance: 0
},
{
begin: '="', returnBegin: true, end: '"',
contains: [{
className: 'value',
begin: '"', endsWithParent: true
}]
},
{
begin: '=\'', returnBegin: true, end: '\'',
contains: [{
className: 'value',
begin: '\'', endsWithParent: true
}]
},
{
begin: '=',
contains: [{
className: 'value',
begin: '[^\\s/>]+'
}]
}
]
};
return {
case_insensitive: true,
defaultMode: {
contains: [
{
className: 'pi',
begin: '<\\?', end: '\\?>',
relevance: 10
},
{
className: 'doctype',
begin: '<!DOCTYPE', end: '>',
relevance: 10,
contains: [{begin: '\\[', end: '\\]'}]
},
{
className: 'comment',
begin: '<!--', end: '-->',
relevance: 10
},
{
className: 'cdata',
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
relevance: 10
},
{
className: 'tag',
/*
The lookahead pattern (?=...) ensures that 'begin' only matches
'<style' as a single word, followed by a whitespace or an
ending braket. The '$' is needed for the lexem to be recognized
by hljs.subMode() that tests lexems outside the stream.
*/
begin: '<style(?=\\s|>|$)', end: '>',
keywords: {'title': {'style': 1}},
contains: [TAG_INTERNALS],
starts: {
className: 'css',
end: '</style>', returnEnd: true,
subLanguage: 'css'
}
},
{
className: 'tag',
// See the comment in the <style tag about the lookahead pattern
begin: '<script(?=\\s|>|$)', end: '>',
keywords: {'title': {'script': 1}},
contains: [TAG_INTERNALS],
starts: {
className: 'javascript',
end: '</script>', returnEnd: true,
subLanguage: 'javascript'
}
},
{
className: 'vbscript',
begin: '<%', end: '%>',
subLanguage: 'vbscript'
},
{
className: 'tag',
begin: '</?', end: '/?>',
contains: [
{
className: 'title', begin: '[^ />]+'
},
TAG_INTERNALS
]
}
]
}
};
}();
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,108 @@
(function () {
var output, Converter;
if (typeof exports === "object" && typeof require === "function") { // we're in a CommonJS (e.g. Node.js) module
output = exports;
Converter = require("./Markdown.Converter").Converter;
} else {
output = window.Markdown;
Converter = output.Converter;
}
output.getSanitizingConverter = function () {
var converter = new Converter();
converter.hooks.chain("postConversion", sanitizeHtml);
converter.hooks.chain("postConversion", balanceTags);
return converter;
}
function sanitizeHtml(html) {
return html.replace(/<[^>]*>?/gi, sanitizeTag);
}
// (tags that can be opened/closed) | (tags that stand alone)
var basic_tag_whitelist = /^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i;
// <a href="url..." optional title>|</a>
var a_white = /^(<a\shref="((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+"(\stitle="[^"<>]+")?\s?>|<\/a>)$/i;
// <img src="url..." optional width optional height optional alt optional title
var img_white = /^(<img\ssrc="(https?:\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"<>]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i;
function sanitizeTag(tag) {
if (tag.match(basic_tag_whitelist) || tag.match(a_white) || tag.match(img_white))
return tag;
else
return "";
}
/// <summary>
/// attempt to balance HTML tags in the html string
/// by removing any unmatched opening or closing tags
/// IMPORTANT: we *assume* HTML has *already* been
/// sanitized and is safe/sane before balancing!
///
/// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593
/// </summary>
function balanceTags(html) {
if (html == "")
return "";
var re = /<\/?\w+[^>]*(\s|$|>)/g;
// convert everything to lower case; this makes
// our case insensitive comparisons easier
var tags = html.toLowerCase().match(re);
// no HTML tags present? nothing to do; exit now
var tagcount = (tags || []).length;
if (tagcount == 0)
return html;
var tagname, tag;
var ignoredtags = "<p><img><br><li><hr>";
var match;
var tagpaired = [];
var tagremove = [];
var needsRemoval = false;
// loop through matched tags in forward order
for (var ctag = 0; ctag < tagcount; ctag++) {
tagname = tags[ctag].replace(/<\/?(\w+).*/, "$1");
// skip any already paired tags
// and skip tags in our ignore list; assume they're self-closed
if (tagpaired[ctag] || ignoredtags.search("<" + tagname + ">") > -1)
continue;
tag = tags[ctag];
match = -1;
if (!/^<\//.test(tag)) {
// this is an opening tag
// search forwards (next tags), look for closing tags
for (var ntag = ctag + 1; ntag < tagcount; ntag++) {
if (!tagpaired[ntag] && tags[ntag] == "</" + tagname + ">") {
match = ntag;
break;
}
}
}
if (match == -1)
needsRemoval = tagremove[ctag] = true; // mark for removal
else
tagpaired[match] = true; // mark paired
}
if (!needsRemoval)
return html;
// delete all orphaned tags from the string
var ctag = 0;
html = html.replace(re, function (match) {
var res = tagremove[ctag] ? "" : match;
ctag++;
return res;
});
return html;
}
})();
@@ -0,0 +1,476 @@
Licensed under the tri-license MPL/LGPL/GPL.
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
@@ -0,0 +1,9 @@
Unless otherwise noted, the enhancements Bootstrap Online LLC has made to Gollum are released under the same license as Gollum itself (the MIT license).
Copyright (c) 2011 Bootstrap Online LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
(The MIT License)
Copyright (c) Tom Preston-Werner, Rick Olson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,57 @@
Syntax highlighting with language autodetection.
URL: http://softwaremaniacs.org/soft/highlight/en/
Original author and current maintainer:
Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors:
- Peter Leonov <gojpeg@gmail.com>
- Victor Karamzin <Victor.Karamzin@enterra-inc.com>
- Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
- Anton Kovalyov <anton@kovalyov.net>
- Nikita Ledyaev <lenikita@yandex.ru>
- Konstantin Evdokimenko <qewerty@gmail.com>
- Dmitri Roudakov <dmitri@roudakov.ru>
- Yuri Ivanov <ivanov@supersoft.ru>
- Vladimir Ermakov <vooon341@mail.ru>
- Vladimir Gubarkov <xonixx@gmail.com>
- Brian Beck <exogen@gmail.com>
- MajestiC <majestic2k@gmail.com>
- Vasily Polovnyov <vast@whiteants.net>
- Vladimir Epifanov <voldmar@voldmar.ru>
- Alexander Makarov (http://rmcreative.ru/)
- Vah <vahtenberg@gmail.com>
- Shuen-Huei Guan <drake.guan@gmail.com>
- Jason Diamond <jason@diamond.name>
- Michal Gabrukiewicz <mgabru@gmail.com>
- Ruslan Keba <rukeba@gmail.com>
- Sergey Baranov <segyrn@yandex.ru>
- Zaripov Yura <yur4ik7@ukr.net>
- Oleg Volchkov <oleg@volchkov.net>
- Vasily Mikhailitchenko <vaskas@programica.ru>
- Jan Berkel <jan.berkel@gmail.com>
- Vladimir Moskva <vladmos@gmail.com>
- Loren Segal <lsegal@soen.ca>
- Andrew Fedorov <dmmdrs@mail.ru>
- Igor Kalnitsky <igor.kalnitsky@gmail.com>
- Jeremy Hull <sourdrums@gmail.com>
- Valerii Hiora <valerii.hiora@gmail.com>
- Nikolay Zakharov <nikolay.desh@gmail.com>
- Dmitry Kovega <arhibot@gmail.com>
- Sergey Ignatov <sergey@ignatov.spb.su>
- Antono Vasiljev <self@antono.info>
- Stephan Kountso <steplg@gmail.com>
- pumbur <pumbur@pumbur.net>
- John Crepezzi <john.crepezzi@gmail.com>
- Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
- Alexander Myadzel <myadzel@gmail.com>
- Evgeny Stepanischev <imbolk@gmail.com>
- Dmytrii Nagirniak <dnagir@gmail.com>
- Oleg Efimov <efimovov@gmail.com>
- Luigi Maselli <grigio.org@gmail.com>
- Denis Bardadym <bardadymchik@gmail.com>
- Aahan Krish <geekpanth3r@gmail.com>
- Ilya Baryshev <baryshev@gmail.com>
- Aleksandar Ruzicic <aleksandar@ruzicic.info>
@@ -0,0 +1,57 @@
Подсветка синтаксиса с автоопределением языка.
URL: http://softwaremaniacs.org/soft/highlight/
Первоначальный автор и ведущий проекта:
Иван Сагалаев <maniac@softwaremaniacs.org>
Внесли свой вклад:
- Петр Леонов <gojpeg@gmail.com>
- Виктор Карамзин <Victor.Karamzin@enterra-inc.com>
- Всеволод Соловьёв <vsevolod.solovyov@gmail.com>
- Антон Ковалёв <anton@kovalyov.net>
- Никита Ледяев <lenikita@yandex.ru>
- Константин Евдокименко <qewerty@gmail.com>
- Дмитрий Рудаков <dmitri@roudakov.ru>
- Юрий Иванов <ivanov@supersoft.ru>
- Владимир Ермаков <vooon341@mail.ru>
- Владимир Губарьков <xonixx@gmail.com>
- Брайан Бек <exogen@gmail.com>
- MajestiC <majestic2k@gmail.com>
- Василий Половнёв <vast@whiteants.net>
- Владимир Епифанов <voldmar@voldmar.ru>
- Александр Макаров (http://rmcreative.ru/)
- Vah <vahtenberg@gmail.com>
- Шуэн-Хуэй Гуан <drake.guan@gmail.com>
- Джейсон Даймонд <jason@diamond.name>
- Михал Габрукевич <mgabru@gmail.com>
- Руслан Кеба <rukeba@gmail.com>
- Сергей Баранов <segyrn@yandex.ru>
- Зарипов Юра <yur4ik7@ukr.net>
- Олег Волчков <oleg@volchkov.net>
- Василий Михайличенко <vaskas@programica.ru>
- Ян Беркель <jan.berkel@gmail.com>
- Владимир Москва <vladmos@gmail.com>
- Лорен Сегал <lsegal@soen.ca>
- Андрей Фёдоров <dmmdrs@mail.ru>
- Игорь Кальницкий <igor.kalnitsky@gmail.com>
- Джереми Халл <sourdrums@gmail.com>
- Валерий Хиора <valerii.hiora@gmail.com>
- Николай Захаров <nikolay.desh@gmail.com>
- Дмитрий Ковега <arhibot@gmail.com>
- Сергей Игнатов <sergey@ignatov.spb.su>
- Антоно Васильев <self@antono.info>
- Степан Кунцьо <steplg@gmail.com>
- pumbur <pumbur@pumbur.net>
- Джон Крепецци <john.crepezzi@gmail.com>
- Андрей Власовских <andrey.vlasovskikh@gmail.com>
- Александр Мядзель <myadzel@gmail.com>
- Евгений Степанищев <imbolk@gmail.com>
- Дмитрий Нагирняк <dnagir@gmail.com>
- Олег Ефимов <efimovov@gmail.com>
- Луиджи Мазелли <grigio.org@gmail.com>
- Денис Бардадым <bardadymchik@gmail.com>
- Аахан Криш <geekpanth3r@gmail.com>
- Илья Барышев <baryshev@gmail.com>
- Александр Ружичич <aleksandar@ruzicic.info>
@@ -0,0 +1,24 @@
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,20 @@
Copyright (c) 2011 John Resig, http://jquery.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,59 @@
Ajaxorg Ace is used under the MPL
https://github.com/ajaxorg/ace/blob/master/LICENSE
https://github.com/ajaxorg/ace (build folder in master)
lib/gollum/frontend/public/src/*
---
Fivesixty Notepages (MIT license)
https://github.com/fivesixty/notepages/blob/master/LICENSE
---
Save icon from notepag.es repo originally from blog.twg.ca (lib/gollum/frontend/public/images/save_24.png)
CC BY-SA 3.0 Unported
http://blog.twg.ca/2010/11/retina-display-icon-set/
http://creativecommons.org/licenses/by-sa/3.0/legalcode.txt
lib/gollum/frontend/public/images/save_24.png
---
Gollum (MIT License)
https://github.com/github/gollum/blob/master/LICENSE
---
jQuery is used under the MIT License
http://jquery.org/license/
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
jQuery.com
lib/gollum/frontend/public/jquery-1.7.js
---
Sizzle is used under the MIT license
.
https://github.com/jquery/sizzle/blob/master/LICENSE
---
The following PNGs are based on Ubuntu 11.10 SVG files located in /usr/share/icons/unity-icon-theme/places/svg/
- group-folders.svg
- group-files.svg
- group-downloads.svg
lib/gollum/frontend/public/css/document.png
lib/gollum/frontend/public/css/folder-horizontal.png
lib/gollum/frontend/public/css/toggle-small-expand.png
lib/gollum/frontend/public/css/toggle-small.png
---
The css-tree-menu code is used under the MIT license.
http://www.thecssninja.com/css/css-tree-menu
http://www.thecssninja.com/demo/license.txt
lib/gollum/frontend/public/css/_styles.css
@@ -0,0 +1,19 @@
Copyright (C) 2011 by Chris Spencer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,32 @@
A javascript port of Markdown, as used on Stack Overflow
and the rest of Stack Exchange network.
Largely based on showdown.js by John Fraser (Attacklab).
Original Markdown Copyright (c) 2004-2005 John Gruber
<http://daringfireball.net/projects/markdown/>
Original Showdown code copyright (c) 2007 John Fraser
Modifications and bugfixes (c) 2009 Dana Robinson
Modifications and bugfixes (c) 2009-2011 Stack Exchange Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,359 @@
Creative Commons Legal Code
Attribution-ShareAlike 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and
other pre-existing works, such as a translation, adaptation,
derivative work, arrangement of music or other alterations of a
literary or artistic work, or phonogram or performance and includes
cinematographic adaptations or any other form in which the Work may be
recast, transformed, or adapted including in any form recognizably
derived from the original, except that a work that constitutes a
Collection will not be considered an Adaptation for the purpose of
this License. For the avoidance of doubt, where the Work is a musical
work, performance or phonogram, the synchronization of the Work in
timed-relation with a moving image ("synching") will be considered an
Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as
encyclopedias and anthologies, or performances, phonograms or
broadcasts, or other works or subject matter other than works listed
in Section 1(f) below, which, by reason of the selection and
arrangement of their contents, constitute intellectual creations, in
which the Work is included in its entirety in unmodified form along
with one or more other contributions, each constituting separate and
independent works in themselves, which together are assembled into a
collective whole. A work that constitutes a Collection will not be
considered an Adaptation (as defined below) for the purposes of this
License.
c. "Creative Commons Compatible License" means a license that is listed
at http://creativecommons.org/compatiblelicenses that has been
approved by Creative Commons as being essentially equivalent to this
License, including, at a minimum, because that license: (i) contains
terms that have the same purpose, meaning and effect as the License
Elements of this License; and, (ii) explicitly permits the relicensing
of adaptations of works made available under that license under this
License or a Creative Commons jurisdiction license with the same
License Elements as this License.
d. "Distribute" means to make available to the public the original and
copies of the Work or Adaptation, as appropriate, through sale or
other transfer of ownership.
e. "License Elements" means the following high-level license attributes
as selected by Licensor and indicated in the title of this License:
Attribution, ShareAlike.
f. "Licensor" means the individual, individuals, entity or entities that
offer(s) the Work under the terms of this License.
g. "Original Author" means, in the case of a literary or artistic work,
the individual, individuals, entity or entities who created the Work
or if no individual or entity can be identified, the publisher; and in
addition (i) in the case of a performance the actors, singers,
musicians, dancers, and other persons who act, sing, deliver, declaim,
play in, interpret or otherwise perform literary or artistic works or
expressions of folklore; (ii) in the case of a phonogram the producer
being the person or legal entity who first fixes the sounds of a
performance or other sounds; and, (iii) in the case of broadcasts, the
organization that transmits the broadcast.
h. "Work" means the literary and/or artistic work offered under the terms
of this License including without limitation any production in the
literary, scientific and artistic domain, whatever may be the mode or
form of its expression including digital form, such as a book,
pamphlet and other writing; a lecture, address, sermon or other work
of the same nature; a dramatic or dramatico-musical work; a
choreographic work or entertainment in dumb show; a musical
composition with or without words; a cinematographic work to which are
assimilated works expressed by a process analogous to cinematography;
a work of drawing, painting, architecture, sculpture, engraving or
lithography; a photographic work to which are assimilated works
expressed by a process analogous to photography; a work of applied
art; an illustration, map, plan, sketch or three-dimensional work
relative to geography, topography, architecture or science; a
performance; a broadcast; a phonogram; a compilation of data to the
extent it is protected as a copyrightable work; or a work performed by
a variety or circus performer to the extent it is not otherwise
considered a literary or artistic work.
i. "You" means an individual or entity exercising rights under this
License who has not previously violated the terms of this License with
respect to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
violation.
j. "Publicly Perform" means to perform public recitations of the Work and
to communicate to the public those public recitations, by any means or
process, including by wire or wireless means or public digital
performances; to make available to the public Works in such a way that
members of the public may access these Works from a place and at a
place individually chosen by them; to perform the Work to the public
by any means or process and the communication to the public of the
performances of the Work, including by public digital performance; to
broadcast and rebroadcast the Work by any means including signs,
sounds or images.
k. "Reproduce" means to make copies of the Work by any means including
without limitation by sound or visual recordings and the right of
fixation and reproducing fixations of the Work, including storage of a
protected performance or phonogram in digital form or other electronic
medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more
Collections, and to Reproduce the Work as incorporated in the
Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation,
including any translation in any medium, takes reasonable steps to
clearly label, demarcate or otherwise identify that changes were made
to the original Work. For example, a translation could be marked "The
original work was translated from English to Spanish," or a
modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated
in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme cannot be waived, the Licensor
reserves the exclusive right to collect such royalties for any
exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme can be waived, the Licensor waives the
exclusive right to collect such royalties for any exercise by You
of the rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right to
collect royalties, whether individually or, in the event that the
Licensor is a member of a collecting society that administers
voluntary licensing schemes, via that society, from any exercise
by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights in
other media and formats. Subject to Section 8(f), all rights not expressly
granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the terms
of this License. You must include a copy of, or the Uniform Resource
Identifier (URI) for, this License with every copy of the Work You
Distribute or Publicly Perform. You may not offer or impose any terms
on the Work that restrict the terms of this License or the ability of
the recipient of the Work to exercise the rights granted to that
recipient under the terms of the License. You may not sublicense the
Work. You must keep intact all notices that refer to this License and
to the disclaimer of warranties with every copy of the Work You
Distribute or Publicly Perform. When You Distribute or Publicly
Perform the Work, You may not impose any effective technological
measures on the Work that restrict the ability of a recipient of the
Work from You to exercise the rights granted to that recipient under
the terms of the License. This Section 4(a) applies to the Work as
incorporated in a Collection, but this does not require the Collection
apart from the Work itself to be made subject to the terms of this
License. If You create a Collection, upon notice from any Licensor You
must, to the extent practicable, remove from the Collection any credit
as required by Section 4(c), as requested. If You create an
Adaptation, upon notice from any Licensor You must, to the extent
practicable, remove from the Adaptation any credit as required by
Section 4(c), as requested.
b. You may Distribute or Publicly Perform an Adaptation only under the
terms of: (i) this License; (ii) a later version of this License with
the same License Elements as this License; (iii) a Creative Commons
jurisdiction license (either this or a later license version) that
contains the same License Elements as this License (e.g.,
Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible
License. If you license the Adaptation under one of the licenses
mentioned in (iv), you must comply with the terms of that license. If
you license the Adaptation under the terms of any of the licenses
mentioned in (i), (ii) or (iii) (the "Applicable License"), you must
comply with the terms of the Applicable License generally and the
following provisions: (I) You must include a copy of, or the URI for,
the Applicable License with every copy of each Adaptation You
Distribute or Publicly Perform; (II) You may not offer or impose any
terms on the Adaptation that restrict the terms of the Applicable
License or the ability of the recipient of the Adaptation to exercise
the rights granted to that recipient under the terms of the Applicable
License; (III) You must keep intact all notices that refer to the
Applicable License and to the disclaimer of warranties with every copy
of the Work as included in the Adaptation You Distribute or Publicly
Perform; (IV) when You Distribute or Publicly Perform the Adaptation,
You may not impose any effective technological measures on the
Adaptation that restrict the ability of a recipient of the Adaptation
from You to exercise the rights granted to that recipient under the
terms of the Applicable License. This Section 4(b) applies to the
Adaptation as incorporated in a Collection, but this does not require
the Collection apart from the Adaptation itself to be made subject to
the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
Collections, You must, unless a request has been made pursuant to
Section 4(a), keep intact all copyright notices for the Work and
provide, reasonable to the medium or means You are utilizing: (i) the
name of the Original Author (or pseudonym, if applicable) if supplied,
and/or if the Original Author and/or Licensor designate another party
or parties (e.g., a sponsor institute, publishing entity, journal) for
attribution ("Attribution Parties") in Licensor's copyright notice,
terms of service or by other reasonable means, the name of such party
or parties; (ii) the title of the Work if supplied; (iii) to the
extent reasonably practicable, the URI, if any, that Licensor
specifies to be associated with the Work, unless such URI does not
refer to the copyright notice or licensing information for the Work;
and (iv) , consistent with Ssection 3(b), in the case of an
Adaptation, a credit identifying the use of the Work in the Adaptation
(e.g., "French translation of the Work by Original Author," or
"Screenplay based on original Work by Original Author"). The credit
required by this Section 4(c) may be implemented in any reasonable
manner; provided, however, that in the case of a Adaptation or
Collection, at a minimum such credit will appear, if a credit for all
contributing authors of the Adaptation or Collection appears, then as
part of these credits and in a manner at least as prominent as the
credits for the other contributing authors. For the avoidance of
doubt, You may only use the credit required by this Section for the
purpose of attribution in the manner set out above and, by exercising
Your rights under this License, You may not implicitly or explicitly
assert or imply any connection with, sponsorship or endorsement by the
Original Author, Licensor and/or Attribution Parties, as appropriate,
of You or Your use of the Work, without the separate, express prior
written permission of the Original Author, Licensor and/or Attribution
Parties.
d. Except as otherwise agreed in writing by the Licensor or as may be
otherwise permitted by applicable law, if You Reproduce, Distribute or
Publicly Perform the Work either by itself or as part of any
Adaptations or Collections, You must not distort, mutilate, modify or
take other derogatory action in relation to the Work which would be
prejudicial to the Original Author's honor or reputation. Licensor
agrees that in those jurisdictions (e.g. Japan), in which any exercise
of the right granted in Section 3(b) of this License (the right to
make Adaptations) would be deemed to be a distortion, mutilation,
modification or other derogatory action prejudicial to the Original
Author's honor and reputation, the Licensor will waive or not assert,
as appropriate, this Section, to the fullest extent permitted by the
applicable national law, to enable You to reasonably exercise Your
right under Section 3(b) of this License (right to make Adaptations)
but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Adaptations or Collections
from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is
perpetual (for the duration of the applicable copyright in the Work).
Notwithstanding the above, Licensor reserves the right to release the
Work under different license terms or to stop distributing the Work at
any time; provided, however that any such election will not serve to
withdraw this License (or any other license that has been, or is
required to be, granted under the terms of this License), and this
License will continue in full force and effect unless terminated as
stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection,
the Licensor offers to the recipient a license to the Work on the same
terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
offers to the recipient a license to the original Work on the same
terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
the minimum extent necessary to make such provision valid and
enforceable.
d. No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in writing
and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with
respect to the Work licensed here. There are no understandings,
agreements or representations with respect to the Work not specified
here. Licensor shall not be bound by any additional provisions that
may appear in any communication from You. This License may not be
modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this
License were drafted utilizing the terminology of the Berne Convention
for the Protection of Literary and Artistic Works (as amended on
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
and the Universal Copyright Convention (as revised on July 24, 1971).
These rights and subject matter take effect in the relevant
jurisdiction in which the License terms are sought to be enforced
according to the corresponding provisions of the implementation of
those treaty provisions in the applicable national law. If the
standard suite of rights granted under applicable copyright law
includes additional rights not granted under this License, such
additional rights are deemed to be included in the License; this
License is not intended to restrict the license of any rights under
applicable law.
Creative Commons Notice
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, Creative Commons does not authorize
the use by either party of the trademark "Creative Commons" or any
related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in
compliance with Creative Commons' then-current trademark usage
guidelines, as may be published on its website or otherwise made
available upon request from time to time. For the avoidance of doubt,
this trademark restriction does not form part of the License.
Creative Commons may be contacted at http://creativecommons.org/.
@@ -0,0 +1,148 @@
Sizzle is released under three licenses: MIT, BSD, and GPL. You may pick the license that best suits your development needs. The text of all three licenses are provided below.
MIT License
----
Copyright (c) 2009 John Resig
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
BSD License
----
Copyright (c) 2009, John Resig
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY John Resig ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
GPL License
----
The GNU General Public License (GPL)
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,44 @@
Client side live preview of Markdown for Gollum with syntax highlighting.
[Click for demo](http://bootstraponline.github.com/livepreview/)
Uses code/assets from:
0. [ace](https://github.com/ajaxorg/ace)
0. [gollum](https://github.com/github/gollum)
0. [highlightjs](https://github.com/isagalaev/highlight.js)
0. [jquery](https://github.com/jquery/jquery)
0. [sizzle](https://github.com/jquery/sizzle)
0. [notepages](https://github.com/fivesixty/notepages)
0. [pagedown](https://code.google.com/p/pagedown/)
0. [retina_display_icon_set](http://blog.twg.ca/2010/11/retina-display-icon-set/)
See licenses folder for details.
# Dependency Notes
## Ace
Using master branch at `4905bd45c462eec14f552fbbd282eb1fd76b6aa4`. Download files to `/livepreview/js/ace/`.
wget https://raw.github.com/ajaxorg/ace/master/build/src/ace.js ;\
wget https://raw.github.com/ajaxorg/ace/master/build/src/mode-markdown.js ;\
wget https://raw.github.com/ajaxorg/ace/master/build/src/theme-twilight.js
## Building highlightjs
- Using master branch at `9a531974d3ebb3cd5c9c6c929fa7184a9852f560`.
- `isagalaev-highlight.js/tools$ python build.py`
- Copy highlight.pack.js and languages folder to `/livepreview/js/highlightjs/`
- Move `isagalaev-highlight.js/src/styles/github.css` to `/livepreview/css/highlightjs/`
- Note that github.css has been customized and should not be replaced when updating the highlightjs dependency.
## jQuery & Sizzle
Using v1.7.2
Download latest production version from http://jquery.com
## Pagedown
The Pagedown code used is from revision `44a4db795617`, Mar 2, 2012 (currently the newest version at the time of writing this document). Markdown.Converter.js has been enhanced to support Gollum style code highlighting.
`https://code.google.com/p/pagedown/source/detail?r=44a4db795617288ae9817c90735fb497891ede23`