├── .gitignore ├── bake.rb ├── config.ru ├── dist ├── base │ ├── jquery.syntax.brush.apache.css │ ├── jquery.syntax.brush.applescript.css │ ├── jquery.syntax.brush.assembly.css │ ├── jquery.syntax.brush.bash-script.css │ ├── jquery.syntax.brush.bash.css │ ├── jquery.syntax.brush.clang.css │ ├── jquery.syntax.brush.css.css │ ├── jquery.syntax.brush.diff.css │ ├── jquery.syntax.brush.html.css │ ├── jquery.syntax.brush.ocaml.css │ ├── jquery.syntax.brush.protobuf.css │ ├── jquery.syntax.brush.python.css │ ├── jquery.syntax.brush.ruby.css │ ├── jquery.syntax.brush.xml.css │ ├── jquery.syntax.core.css │ ├── jquery.syntax.editor.css │ └── theme.js ├── bright │ ├── jquery.syntax.core.css │ └── theme.js ├── jquery.syntax.brush.apache.js ├── jquery.syntax.brush.applescript.js ├── jquery.syntax.brush.assembly.js ├── jquery.syntax.brush.bash-script.js ├── jquery.syntax.brush.bash.js ├── jquery.syntax.brush.basic.js ├── jquery.syntax.brush.clang.js ├── jquery.syntax.brush.csharp.js ├── jquery.syntax.brush.css.js ├── jquery.syntax.brush.diff.js ├── jquery.syntax.brush.go.js ├── jquery.syntax.brush.haskell.js ├── jquery.syntax.brush.html.js ├── jquery.syntax.brush.io.js ├── jquery.syntax.brush.java.js ├── jquery.syntax.brush.javascript.js ├── jquery.syntax.brush.kai.js ├── jquery.syntax.brush.lisp.js ├── jquery.syntax.brush.lua.js ├── jquery.syntax.brush.nginx.js ├── jquery.syntax.brush.ocaml.js ├── jquery.syntax.brush.ooc.js ├── jquery.syntax.brush.pascal.js ├── jquery.syntax.brush.perl5.js ├── jquery.syntax.brush.php-script.js ├── jquery.syntax.brush.php.js ├── jquery.syntax.brush.plain.js ├── jquery.syntax.brush.protobuf.js ├── jquery.syntax.brush.python.js ├── jquery.syntax.brush.ruby.js ├── jquery.syntax.brush.scala.js ├── jquery.syntax.brush.smalltalk.js ├── jquery.syntax.brush.sql.js ├── jquery.syntax.brush.super-collider.js ├── jquery.syntax.brush.swift.js ├── jquery.syntax.brush.xml.js ├── jquery.syntax.brush.xrb.js ├── jquery.syntax.brush.yaml.js ├── jquery.syntax.cache.js ├── jquery.syntax.core.js ├── jquery.syntax.editor.js ├── jquery.syntax.js ├── jquery.syntax.min.js └── paper │ ├── jquery.syntax.core.css │ └── theme.js ├── examples ├── ex.applescript.html ├── ex.asm.html ├── ex.bash.html ├── ex.clang.html ├── ex.css.html ├── ex.diff.html ├── ex.editor.html ├── ex.html.html ├── ex.javascript.html ├── ex.ooc.html ├── ex.php.html ├── ex.python.html ├── ex.ruby.html ├── ex.swift.html ├── index.css ├── jquery-1.6.min.js ├── tests.html ├── wrapping-flex.html └── wrapping.html ├── ext └── theme.rb ├── gems.rb ├── install.yaml ├── package.json ├── readme.md ├── source ├── jquery.syntax.brush.apache.js ├── jquery.syntax.brush.applescript.js ├── jquery.syntax.brush.assembly.js ├── jquery.syntax.brush.bash-script.js ├── jquery.syntax.brush.bash.js ├── jquery.syntax.brush.basic.js ├── jquery.syntax.brush.clang.js ├── jquery.syntax.brush.csharp.js ├── jquery.syntax.brush.css.js ├── jquery.syntax.brush.diff.js ├── jquery.syntax.brush.go.js ├── jquery.syntax.brush.haskell.js ├── jquery.syntax.brush.html.js ├── jquery.syntax.brush.io.js ├── jquery.syntax.brush.java.js ├── jquery.syntax.brush.javascript.js ├── jquery.syntax.brush.kai.js ├── jquery.syntax.brush.lisp.js ├── jquery.syntax.brush.lua.js ├── jquery.syntax.brush.nginx.js ├── jquery.syntax.brush.ocaml.js ├── jquery.syntax.brush.ooc.js ├── jquery.syntax.brush.pascal.js ├── jquery.syntax.brush.perl5.js ├── jquery.syntax.brush.php-script.js ├── jquery.syntax.brush.php.js ├── jquery.syntax.brush.plain.js ├── jquery.syntax.brush.protobuf.js ├── jquery.syntax.brush.python.js ├── jquery.syntax.brush.ruby.js ├── jquery.syntax.brush.scala.js ├── jquery.syntax.brush.smalltalk.js ├── jquery.syntax.brush.sql.js ├── jquery.syntax.brush.super-collider.js ├── jquery.syntax.brush.swift.js ├── jquery.syntax.brush.xml.js ├── jquery.syntax.brush.xrb.js ├── jquery.syntax.brush.yaml.js ├── jquery.syntax.core.js ├── jquery.syntax.editor.js └── jquery.syntax.js └── themes ├── base ├── jquery.syntax.brush.apache.sass ├── jquery.syntax.brush.applescript.sass ├── jquery.syntax.brush.assembly.sass ├── jquery.syntax.brush.bash-script.sass ├── jquery.syntax.brush.bash.sass ├── jquery.syntax.brush.clang.sass ├── jquery.syntax.brush.css.sass ├── jquery.syntax.brush.diff.sass ├── jquery.syntax.brush.html.sass ├── jquery.syntax.brush.ocaml.sass ├── jquery.syntax.brush.protobuf.sass ├── jquery.syntax.brush.python.sass ├── jquery.syntax.brush.ruby.sass ├── jquery.syntax.brush.xml.sass ├── jquery.syntax.core.sass └── jquery.syntax.editor.sass ├── bright ├── _config.yaml └── jquery.syntax.core.sass └── paper ├── _config.yaml └── jquery.syntax.core.sass /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .sass-cache 3 | gems.locked 4 | -------------------------------------------------------------------------------- /bake.rb: -------------------------------------------------------------------------------- 1 | 2 | # This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 3 | # See for licensing details. 4 | # Copyright (c) 2011 Samuel G. D. Williams. 5 | 6 | require 'stringio' 7 | require 'fileutils' 8 | require 'tmpdir' 9 | require 'pathname' 10 | require 'yaml' 11 | 12 | require 'closure-compiler' 13 | 14 | require_relative 'ext/theme' 15 | 16 | CACHE_FILE = "jquery.syntax.cache.js" 17 | MINIFIED_FILE = "jquery.syntax.min.js" 18 | 19 | LICENSE = < ["/"], :root => "./" 5 | 6 | run lambda { |env| $stderr.puts("404 #{env['REQUEST_PATH']}"); [404, {}, []] } 7 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.apache.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .apache .tag { 2 | color: #00c; } 3 | .syntax-theme-base .apache .tag-name { 4 | color: #00f; } 5 | .syntax-theme-base .apache .tag-name { 6 | font-weight: bold; } 7 | 8 | @media (prefers-color-scheme: dark) { 9 | .syntax-theme-base .apache .tag { 10 | color: #6666ff; } 11 | .syntax-theme-base .apache .tag-name { 12 | color: #9999ff; } } 13 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.applescript.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .applescript { 2 | font-family: Geneva, Helvetica, sans-serif; } 3 | .syntax-theme-base .applescript .keyword { 4 | color: #00f; 5 | font-weight: bold; } 6 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.assembly.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .assembly .register { 2 | color: #3caa20; 3 | font-style: italic; } 4 | .syntax-theme-base .assembly .label { 5 | font-weight: bold; 6 | color: #2a85b3; } 7 | .syntax-theme-base .assembly .directive { 8 | color: #828a3d; } 9 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.bash-script.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .bash-script .option { 2 | color: #03f; } 3 | .syntax-theme-base .bash-script .env { 4 | font-style: italic; } 5 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.bash.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .bash .stderr { 2 | color: red; } 3 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.clang.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .preprocessor { 2 | color: #63381f; } 3 | 4 | @media (prefers-color-scheme: dark) { 5 | .syntax-theme-base .preprocessor { 6 | color: #c97e52; } } 7 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.css.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .css .selector { 2 | color: #458; 3 | font-weight: bold; } 4 | .syntax-theme-base .css .property { 5 | color: teal; } 6 | .syntax-theme-base .css .color-box { 7 | position: relative; } 8 | .syntax-theme-base .css .color-box .sample { 9 | border: 1px solid #000; 10 | position: absolute; 11 | left: 0.2em; 12 | right: 0.2em; 13 | top: 0.2em; 14 | bottom: 0.2em; } 15 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.diff.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .add { 2 | color: green; } 3 | .syntax-theme-base .del { 4 | color: red; } 5 | .syntax-theme-base .insert { 6 | color: green; } 7 | .syntax-theme-base .insert-line { 8 | background-color: #cfc !important; } 9 | .syntax-theme-base .remove { 10 | color: red; } 11 | .syntax-theme-base .remove-line { 12 | background-color: #fcc !important; } 13 | .syntax-theme-base .offset { 14 | color: blue; } 15 | .syntax-theme-base .offset-line { 16 | background-color: #ccf !important; } 17 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.html.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .html .doctype { 2 | font-weight: bold; 3 | color: #938; } 4 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.ocaml.css: -------------------------------------------------------------------------------- 1 | .syntax .ocaml .operator { 2 | color: #06C; 3 | font-weight: bold; } 4 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.protobuf.css: -------------------------------------------------------------------------------- 1 | .syntax .protobuf .variable { 2 | font-weight: bold; } 3 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.python.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .python .decorator { 2 | color: #ffb600; 3 | font-weight: bold; } 4 | .syntax-theme-base .python .builtin { 5 | color: #33f; 6 | font-style: italic; } 7 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.ruby.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .ruby .string .ruby { 2 | color: #808080; } 3 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.brush.xml.css: -------------------------------------------------------------------------------- 1 | .syntax-theme-base .xml .cdata-content { 2 | color: #046; 3 | border-radius: 0.5em; } 4 | .syntax-theme-base .xml .xml-tag, .syntax-theme-base .xml .cdata { 5 | color: #00c; } 6 | .syntax-theme-base .xml .tag-name, .syntax-theme-base .xml .cdata-tag { 7 | color: #00f; 8 | font-weight: bold; } 9 | .syntax-theme-base .xml .namespace { 10 | color: #00c; } 11 | .syntax-theme-base .xml .attribute { 12 | color: #00c; } 13 | .syntax-theme-base .xml .instruction { 14 | color: #00c; } 15 | .syntax-theme-base .xml .entity, .syntax-theme-base .xml .percent-escape { 16 | color: #666; 17 | background-color: #ddd; 18 | border-radius: 0.5em; } 19 | 20 | @media (prefers-color-scheme: dark) { 21 | .syntax-theme-base .xml .cdata-content { 22 | color: #a46; } 23 | .syntax-theme-base .xml .xml-tag, .syntax-theme-base .xml .cdata { 24 | color: #c59de7; } 25 | .syntax-theme-base .xml .tag-name, .syntax-theme-base .xml .cdata-tag { 26 | color: #9ae; } 27 | .syntax-theme-base .xml .namespace { 28 | color: #c59de7; } 29 | .syntax-theme-base .xml .attribute { 30 | color: #c59de7; } 31 | .syntax-theme-base .xml .instruction { 32 | color: #c59de7; } 33 | .syntax-theme-base .xml .entity, .syntax-theme-base .xml .percent-escape { 34 | color: #999; 35 | background-color: #333; } } 36 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.core.css: -------------------------------------------------------------------------------- 1 | pre code.syntax-theme-base { 2 | display: block; } 3 | pre code.syntax-theme-base > span { 4 | display: flex; } 5 | pre code.syntax-theme-base .indent { 6 | flex-grow: 0; 7 | flex-shrink: 0; } 8 | pre code.syntax-theme-base .text { 9 | white-space: pre-wrap; 10 | padding-left: 2ch; 11 | text-indent: -2ch; } 12 | 13 | .syntax-theme-base a { 14 | text-decoration: none; 15 | color: inherit; } 16 | .syntax-theme-base .function { 17 | color: #33f; } 18 | .syntax-theme-base .keyword, .syntax-theme-base .access, .syntax-theme-base .option { 19 | color: #7a0968; } 20 | .syntax-theme-base .type { 21 | color: #3239D6; } 22 | .syntax-theme-base .comment { 23 | color: #6ac; } 24 | .syntax-theme-base .constant { 25 | color: #1c00ce; } 26 | .syntax-theme-base .string, .syntax-theme-base .symbol { 27 | color: #c41a15; } 28 | .syntax-theme-base .string .escape { 29 | color: #f99; } 30 | .syntax-theme-base .operator { 31 | color: black; } 32 | .syntax-theme-base .href { 33 | color: #0e0eff; 34 | text-decoration: underline; } 35 | .syntax-theme-base .variable { 36 | color: #466997; } 37 | .syntax-theme-base .highlight { 38 | background-color: #fdfdba; } 39 | 40 | @media (prefers-color-scheme: dark) { 41 | .syntax-theme-base .operator { 42 | color: white; } 43 | .syntax-theme-base .function { 44 | color: #c59de7; } 45 | .syntax-theme-base .keyword, .syntax-theme-base .access, .syntax-theme-base .option { 46 | color: #328eff; } 47 | .syntax-theme-base .type { 48 | color: #37a4ff; } 49 | .syntax-theme-base .comment { 50 | color: #849fca; } 51 | .syntax-theme-base .constant { 52 | color: #c9a452; } 53 | .syntax-theme-base .string, .syntax-theme-base .symbol { 54 | color: #ed7f7d; } 55 | .syntax-theme-base .string .escape { 56 | color: #f99; } 57 | .syntax-theme-base .variable { 58 | color: #6e6dff; } } 59 | -------------------------------------------------------------------------------- /dist/base/jquery.syntax.editor.css: -------------------------------------------------------------------------------- 1 | .syntax-container.syntax-theme-base div.editor.syntax { 2 | padding: 0.2em !important; 3 | margin: 0 !important; 4 | white-space: pre; } 5 | .syntax-container.syntax-theme-base div.editor.syntax:focus { 6 | outline: none; } 7 | -------------------------------------------------------------------------------- /dist/base/theme.js: -------------------------------------------------------------------------------- 1 | Syntax.themes["base"] = [] 2 | -------------------------------------------------------------------------------- /dist/bright/jquery.syntax.core.css: -------------------------------------------------------------------------------- 1 | .syntax-container.syntax-theme-bright .syntax { 2 | font-family: Menlo, Monaco, Consolas, monospace; 3 | line-height: 1.5em; } 4 | .syntax-container.syntax-theme-bright .syntax .function { 5 | color: #33f; } 6 | .syntax-container.syntax-theme-bright .syntax .keyword { 7 | color: #3c3; } 8 | .syntax-container.syntax-theme-bright .syntax .access { 9 | color: #ffb600; 10 | font-weight: bold; } 11 | .syntax-container.syntax-theme-bright .syntax .type { 12 | color: #191; 13 | font-weight: bold; } 14 | .syntax-container.syntax-theme-bright .syntax .comment { 15 | color: #6ac; 16 | font-style: italic; } 17 | .syntax-container.syntax-theme-bright .syntax .string, .syntax-container.syntax-theme-bright .syntax .constant { 18 | color: #f33; } 19 | .syntax-container.syntax-theme-bright .syntax .string .escape { 20 | color: #f99; } 21 | .syntax-container.syntax-theme-bright .syntax .operator { 22 | color: #c00; } 23 | .syntax-container.syntax-theme-bright .syntax .href { 24 | color: #00f; 25 | text-decoration: underline; } 26 | .syntax-container.syntax-theme-bright .syntax .variable { 27 | color: #22c; } 28 | -------------------------------------------------------------------------------- /dist/bright/theme.js: -------------------------------------------------------------------------------- 1 | Syntax.themes["bright"] = ["base"] 2 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.apache.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("apache",function(a){a.push({pattern:/(<(\w+).*?>)/gi,matches:Syntax.extractMatches({klass:"tag",allow:["attribute","tag-name","string"]},{klass:"tag-name",process:Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive",!0)})});a.push({pattern:/(<\/(\w+).*?>)/gi,matches:Syntax.extractMatches({klass:"tag",allow:["tag-name"]},{klass:"tag-name"})});a.push({pattern:/^\s+([A-Z][\w]+)/gm,matches:Syntax.extractMatches({klass:"function",allow:["attribute"],process:Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive", 3 | !0)})});a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.webLink)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.applescript.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("applescript",function(a){a.push("after before beginning continue copy each end every from get global in local named of return set some that the then times to where whose with without".split(" "),{klass:"keyword"});a.push("first second third fourth fifth sixth seventh eighth ninth tenth last front back middle".split(" "),{klass:"keyword"});a.push("activate add alias AppleScript ask attachment boolean class constant delete duplicate empty exists false id integer list make message modal modified new no paragraph pi properties quit real record remove rest result reveal reverse run running save string true word yes".split(" "), 3 | {klass:"keyword"});var b=[/(\-\-|#).*$/gm,/\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm,Syntax.lib.perlStyleComment.pattern];a.push(Syntax.lib.webLink);a.push(b,{klass:"comment",allow:["href"]});a.push(Syntax.lib.doubleQuotedString);a.push([/\b\d+(st|nd|rd|th)\b/g,/(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g],{klass:"constant"});a.push({pattern:/&|\u00ac|=|\u2260|>|<|\u2265|>=|\u2264|<=|\*|\+|-|\/|\u00f7|\^/g,klass:"operator"});a.push({pattern:/\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, 4 | klass:"keyword"});a.push({pattern:/\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,klass:"keyword"});a.push({pattern:/\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, 5 | klass:"keyword"})}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.assembly.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("assembly",function(a){a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push({pattern:/\.[a-zA-Z_][a-zA-Z0-9_]*/gm,klass:"directive"});a.push({pattern:/^[a-zA-Z_][a-zA-Z0-9_]*:/gm,klass:"label"});a.push({pattern:/^\s*([a-zA-Z]+)/gm,matches:Syntax.extractMatches({klass:"function"})});a.push({pattern:/(-[0-9]+)|(\b[0-9]+)|(\$[0-9]+)/g,klass:"constant"});a.push({pattern:/(\-|\b|\$)(0x[0-9a-f]+|[0-9]+|[a-z0-9_]+)/gi,klass:"constant"});a.push({pattern:/%\w+/g,klass:"register"}); 3 | a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.webLink)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.bash-script.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("bash-script",function(a){a.push(["&&","|",";","{","}"],{klass:"operator"});a.push({pattern:/(?:^|\||;|&&)\s*((?:"([^"]|\\")+"|'([^']|\\')+'|\\\n|.|[ \t])+?)(?=$|\||;|&&)/gmi,matches:Syntax.extractMatches({brush:"bash-statement"})})}); 3 | Syntax.register("bash-statement",function(a){a.push("break case continue do done elif else eq fi for function ge gt if in le lt ne return then until while".split(" "),{klass:"keyword"});a.push("> < = ` -- { } ( ) [ ]".split(" "),{klass:"operator"});a.push({pattern:/\(\((.*?)\)\)/gmi,klass:"expression",allow:["variable","string","operator","constant"]});a.push({pattern:/`([\s\S]+?)`/gmi,matches:Syntax.extractMatches({brush:"bash-script",debug:!0})});a.push(Syntax.lib.perlStyleComment);a.push({pattern:/^\s*((?:\S+?=\$?(?:\[[^\]]+\]|\(\(.*?\)\)|"(?:[^"]|\\")+"|'(?:[^']|\\')+'|\S+)\s*)*)((?:(\\ |\S)+)?)/gmi, 4 | matches:Syntax.extractMatches({klass:"env",allow:["variable","string","operator","constant","expression"]},{klass:"function",allow:["variable","string"]})});a.push({pattern:/(\S+?)=/gmi,matches:Syntax.extractMatches({klass:"variable"}),only:["env"]});a.push({pattern:/\$\w+/g,klass:"variable"});a.push({pattern:/\s\-+[\w-]+/g,klass:"option"});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.webLink)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.bash.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.brushes.dependency("bash","bash-script");Syntax.register("bash",function(a){a.push({pattern:/^([\w@:~ ]*?[\$|#])\s+(.*?)$/gm,matches:Syntax.extractMatches({klass:"prompt"},{brush:"bash-script"})});a.push({pattern:/^\-\- .*$/gm,klass:"comment",allow:["href"]});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.webLink);a.push({klass:"stderr",allow:["string","comment","constant","href"]})}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.basic.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.lib.vbStyleComment={pattern:/' .*$/gm,klass:"comment",allow:["href"]}; 3 | Syntax.register("basic",function(a){var b="- & &= * *= / /= \\ = ^ ^= + += = -=".split(" ");b="+ - * / += -= *= /= = := == != ! % ? > < >= <= && || & | ^ . ~ .. >> << >>> <<< >>= <<= >>>= <<<= %= ^= @".split(" ");a.push("CBool CByte CChar CDate CDec CDbl Char CInt CLng CObj Const CShort CSng CStr CType Date Decimal Variant String Short Long Single Double Object Integer Boolean Byte Char".split(" "),{klass:"type"});a.push("AddHandler AddressOf Alias And AndAlso Ansi As Assembly Auto ByRef ByVal Call Case Catch Declare Default Delegate Dim DirectCast Do Each Else ElseIf End Enum Erase Error Event Exit Finally For Function Get GetType GoSub GoTo Handles If Implements Imports In Inherits Interface Is Let Lib Like Loop Mod Module MustOverride Namespace New Next Not On Option Optional Or OrElse Overloads Overridable Overrides ParamArray Preserve Property RaiseEvent ReadOnly ReDim REM RemoveHandler Resume Return Select Set Static Step Stop Structure Sub SyncLock Then Throw To Try TypeOf Unicode Until When While With WithEvents WriteOnly Xor ExternalSource Region Print Class".split(" "),{klass:"keyword", 4 | options:"gi"});a.push(b,{klass:"operator"});a.push("Public Protected Private Shared Friend Shadows MustInherit NotInheritable NotOverridable".split(" "),{klass:"access"});a.push(["Me","MyClass","MyBase","super","True","False","Nothing",/[A-Z][A-Z0-9_]+/g],{klass:"constant"});a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.vbStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.postprocess=function(a,b,c){jQuery(".function", 5 | b).each(function(){var a=jQuery(this).text();jQuery(this).replaceWith(jQuery("").attr("href","http://social.msdn.microsoft.com/Search/en-us?query="+encodeURIComponent(a)).text(a))});return b}}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.clang.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("clang",function(a){a.push("this true false NULL YES NO nil".split(" "),{klass:"constant"});a.push("mutable auto const register typename abstract".split(" "),{klass:"keyword"});a.push("double float int short char long signed unsigned bool void id".split(" "),{klass:"type"});a.push("@interface @implementation @protocol @end @try @throw @catch @finally @class @selector @encode @synchronized @property @synthesize @dynamic struct break continue else for switch case default enum goto register sizeof typedef volatile do extern if return static union while asm dynamic_cast namespace reinterpret_cast try explicit static_cast typeid catch operator template class const_cast inline throw virtual IBOutlet".split(" "), 3 | {klass:"keyword"});a.push("+ * / - & | ~ ! % < = > [ ] new delete in".split(" "),{klass:"operator"});a.push("@private @protected @public @required @optional private protected public friend using".split(" "),{klass:"access"});a.push({pattern:/@property\((.*)\)[^;]+;/gmi,klass:"objective-c-property",allow:"*"});a.push("getter setter readwrite readonly assign retain copy nonatomic".split(" "),{klass:"keyword",only:["objective-c-property"]});a.push({pattern:/@(?=")/g,klass:"string"});a.push(Syntax.lib.camelCaseType); 4 | a.push(Syntax.lib.cStyleType);a.push({pattern:/(?:class|struct|enum|namespace)\s+([^{;\s]+)/gmi,matches:Syntax.extractMatches({klass:"type"})});a.push({pattern:/#.*$/gmi,klass:"preprocessor",allow:["string"]});a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push({pattern:/\w+:(?=.*(\]|;|\{))(?!:)/g,klass:"function"});a.push({pattern:/[^:\[]\s+(\w+)(?=\])/g,matches:Syntax.extractMatches({klass:"function"})});a.push({pattern:/-\s*(\([^\)]+?\))?\s*(\w+)\s*\{/g, 5 | matches:Syntax.extractMatches({index:2,klass:"function"})});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.cStyleFunction)}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.csharp.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("csharp",function(a){a.push(["this","true","false","null"],{klass:"constant"});a.push("object bool byte fixed float uint char ulong ushort decimal int sbyte short void long string double".split(" "),{klass:"type"});a.push("abstract add alias ascending base break case catch class const continue default delegate descending do dynamic else enum event explicit extern finally for foreach from get global goto group if implicit in interface into join let lock namespace new operator orderby out override params partial readonly ref remove return sealed select set stackalloc static struct switch throw try unsafe using value var virtual volatile where while yield".split(" "), 3 | {klass:"keyword"});a.push("+ - * / % & | ^ ! ~ && || ++ -- << >> == != < > <= >= = ? new as is sizeof typeof checked unchecked".split(" "),{klass:"operator"});a.push(["public","private","internal","protected"],{klass:"access"});a.push(Syntax.lib.cStyleFunction);a.push({pattern:/(?:\.)([a-z_][a-z0-9_]+)/gi,matches:Syntax.extractMatches({klass:"function"})});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString); 4 | a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.css.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("css",function(a){var e=[].concat(jQuery.map("AliceBlue AntiqueWhite Aqua Aquamarine Azure Beige Bisque Black BlanchedAlmond Blue BlueViolet Brown BurlyWood CadetBlue Chartreuse Chocolate Coral CornflowerBlue Cornsilk Crimson Cyan DarkBlue DarkCyan DarkGoldenRod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen Darkorange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DimGray DodgerBlue FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite Gold GoldenRod Gray Green GreenYellow HoneyDew HotPink IndianRed Indigo Ivory Khaki Lavender LavenderBlush LawnGreen LemonChiffon LightBlue LightCoral LightCyan LightGoldenRodYellow LightGrey LightGreen LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linen Magenta Maroon MediumAquaMarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed MidnightBlue MintCream MistyRose Moccasin NavajoWhite Navy OldLace Olive OliveDrab Orange OrangeRed Orchid PaleGoldenRod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip PeachPuff Peru Pink Plum PowderBlue Purple Red RosyBrown RoyalBlue SaddleBrown Salmon SandyBrown SeaGreen SeaShell Sienna Silver SkyBlue SlateBlue SlateGray Snow SpringGreen SteelBlue Tan Teal Thistle Tomato Turquoise Violet Wheat White WhiteSmoke Yellow YellowGreen".split(" "), 3 | function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!0)+")"}),jQuery.map(["#[0-9a-f]{3,6}","rgba?\\(.+?\\)","hsla?\\(.+?\\)"],function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!1)+")"}));a.push({pattern:/\(.*?\)/g,allow:"*",disallow:["property"]});a.push({pattern:/\s*([:\.\[\]"'=\s\w#\.\-,]+)\s+\{/gm,matches:Syntax.extractMatches({klass:"selector",allow:["string"]})});a.push({pattern:new RegExp(e.join("|"),"gi"),klass:"color",process:function(a,d){d=Syntax.innerText(a); 4 | var c=document.createElement("span");c.className="colour-box";var b=document.createElement("span");b.className="sample";b.style.backgroundColor=d;b.appendChild(document.createTextNode(" "));c.appendChild(b);a.appendChild(c);return a}});a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.webLink);a.push({pattern:/\{(.|\n)*?\}/g,klass:"properties",allow:"*"});a.push({pattern:/:(.*?(?=\})|(.|\n)*?(?=(\}|;)))/g,matches:Syntax.extractMatches({klass:"value",allow:["color"],only:["properties"]})});a.push({pattern:/([\-\w]+):/g, 5 | matches:Syntax.extractMatches({klass:"property",process:Syntax.lib.webLinkProcess("http://cssdocs.org/")})});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.cStyleFunction)}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.diff.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("diff",function(a){a.push({pattern:/^\+\+\+.*$/gm,klass:"add"});a.push({pattern:/^\-\-\-.*$/gm,klass:"del"});a.push({pattern:/^@@.*@@/gm,klass:"offset"});a.push({pattern:/^\+[^\+]{1}.*$/gm,klass:"insert"});a.push({pattern:/^\-[^\-]{1}.*$/gm,klass:"remove"});a.postprocess=function(a,b,c){$(".insert",b).closest(".source").addClass("insert-line");$(".remove",b).closest(".source").addClass("remove-line");$(".offset",b).closest(".source").addClass("offset-line");return b}}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.go.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("go",function(a){a.push(["true","false","iota","nil"],{klass:"constant"});a.push([/u?int\d*/g,/float\d+/g,/complex\d+/g,"byte","uintptr","string"],{klass:"type"});a.push("break default func interface select case defer go map struct chan else goto package switch const fallthrough if range type continue for import return var".split(" "),{klass:"keyword"});a.push("+ & += &= && == != - | -= |= || < <= * ^ *= ^= <- > >= / << /= <<= ++ = := , ; % >> %= >>= -- ! ... . : &^ &^=".split(" "), 3 | {klass:"operator"});a.push("append cap close complex copy imag len make new panic print println real recover".split(" "),{klass:"function"});a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.haskell.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("haskell",function(a){a.push(["True","False"],{klass:"constant"});a.push("as;case;of;class;data;data family;data instance;default;deriving;deriving instance;do;forall;foreign;hiding;if;then;else;import;infix;infixl;infixr;instance;let;in;mdo;module;newtype;proc;qualified;rec;type;type family;type instance;where".split(";"),{klass:"keyword"});a.push("` | \\ - -< -<< -> * ? ?? # <- @ ! :: _ ~ > ; { }".split(" "),{klass:"operator"});a.push(Syntax.lib.camelCaseType);a.push({pattern:/\-\-.*$/gm, 3 | klass:"comment",allow:["href"]});a.push({pattern:/\{\-[\s\S]*?\-\}/gm,klass:"comment",allow:["href"]});a.push(Syntax.lib.webLink);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.html.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.brushes.dependency("html","xml");Syntax.brushes.dependency("html","javascript");Syntax.brushes.dependency("html","css");Syntax.brushes.dependency("html","php-script");Syntax.brushes.dependency("html","ruby"); 3 | Syntax.register("html",function(a){a.push({pattern:/((.|\n)*?)<\/script>/gmi,matches:Syntax.extractMatches({brush:"javascript"})});a.push({pattern:/((.|\n)*?)<\/style>/gmi,matches:Syntax.extractMatches({brush:"css"})});a.push({pattern:/((<\?php)([\s\S]*?)(\?>))/gm,matches:Syntax.extractMatches({klass:"php-tag",allow:["keyword","php-script"]},{klass:"keyword"},{brush:"php-script"},{klass:"keyword"})});a.push({pattern:/((<\?rb?)([\s\S]*?)(\?>))/gm, 4 | matches:Syntax.extractMatches({klass:"ruby-tag",allow:["keyword","ruby"]},{klass:"keyword"},{brush:"ruby"},{klass:"keyword"})});a.push({pattern:/<%=?(.*?)(%>)/g,klass:"instruction",allow:["string"]});a.push({pattern://g,matches:Syntax.extractMatches({klass:"doctype"})});a.push({pattern:/(%[0-9a-f]{2})/gi,klass:"percent-escape",only:["html"]});a.derives("xml")}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.io.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("io",function(a){a.push(Syntax.lib.cStyleFunction);a.push(["return"],{klass:"keywords"});a.push("::= := or and @ + * / - & | ~ ! % < = > [ ] new delete".split(" "),{klass:"operator"});a.push({pattern:/\b([ \t]+([a-z]+))/gi,matches:Syntax.extractMatches({index:2,klass:"function"})});a.push({pattern:/\)([ \t]+([a-z]+))/gi,matches:Syntax.extractMatches({index:2,klass:"function"})});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment); 3 | a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.java.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("java",function(a){a.push(["this","true","false","null"],{klass:"constant"});a.push("void byte short int long float double boolean char".split(" "),{klass:"type"});a.push("abstract continue for switch assert default goto synchronized do if break implements throw else import throws case enum return transient catch extends try final interface static class finally strictfp volatile const native super while".split(" "),{klass:"keyword"});a.push("++ -- ++ -- + - ~ ! * / % + - << >> >>> < > <= >= == != & ^ | && || ? = += -= *= /= %= &= ^= |= <<= >>= >>>= instanceof new delete".split(" "), 3 | {klass:"operator"});a.push(["private","protected","public","package"],{klass:"access"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.cStyleFunction);a.processes["function"]=Syntax.lib.webLinkProcess('java "Developer Documentation"', 4 | !0)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.javascript.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("javascript",function(a){a.push(["this","true","false","null"],{klass:"constant"});a.push("async await break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield".split(" "),{klass:"keyword"});a.push("+*/-&|~!%<=>".split(""),{klass:"operator"});a.push("implements package protected interface private public".split(" "),{klass:"access"});a.push(Syntax.lib.perlStyleRegularExpression); 3 | a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.cStyleFunction)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.kai.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("kai",function(a){a.push("()[]{}".split(""),{klass:"operator"});a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.webLink);a.push({pattern:/\(([^\s\(\)]+)/gi,matches:Syntax.extractMatches({klass:"function"})});a.push({pattern:/`[a-z]*/gi,klass:"constant"});a.push(Syntax.lib.multiLineDoubleQuotedString);a.push(Syntax.lib.stringEscape)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.lisp.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.lib.lispStyleComment={pattern:/(;+) .*$/gm,klass:"comment",allow:["href"]};Syntax.register("lisp",function(a){a.push(["(",")"],{klass:"operator"});a.push(Syntax.lib.lispStyleComment);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.webLink);a.push({pattern:/\(\s*([^\s\(\)]+)/gmi,matches:Syntax.extractMatches({klass:"function"})});a.push({pattern:/#[a-z]+/gi,klass:"constant"});a.push(Syntax.lib.multiLineDoubleQuotedString);a.push(Syntax.lib.stringEscape)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.lua.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("lua",function(a){a.push(["self","true","false","nil"],{klass:"constant"});a.push("and break do else elseif end false for function if in local nil not or repeat return then true until while".split(" "),{klass:"keyword"});a.push("+ - * / % ^ # .. = == ~= < > <= >= ? :".split(" "),{klass:"operator"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push({pattern:/\-\-.*$/gm,klass:"comment",allow:["href"]});a.push({pattern:/\-\-\[\[(\n|.)*?\]\]\-\-/gm,klass:"comment", 3 | allow:["href"]});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.webLink)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.nginx.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("nginx",function(a){a.push({pattern:/((\w+).*?);/g,matches:Syntax.extractMatches({klass:"directive",allow:"*"},{klass:"function",process:Syntax.lib.webLinkProcess("http://nginx.org/r/")})});a.push({pattern:/(\w+).*?{/g,matches:Syntax.extractMatches({klass:"keyword"})});a.push({pattern:/(\$)[\w]+/g,klass:"variable"});a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.webLink)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.ocaml.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("ocaml",function(a){a.push(["private","public"],{klass:"access"});a.push(["true","false"],{klass:"constant"});a.push(["bool","byte","sbyte",/\bu?int\d*\b/g,"nativeint","unativeint","char","string","decimal","unit","void","float32","single","float64","double","list","array","exn","format","fun","option","ref"],{klass:"type"});a.push("abstract and as assert begin class default delegate do done downcast downto elif else end exception extern finally for fun function if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override rec return static struct then to try type upcast use val when while with yield asr land lor lsl lsr lxor mod sig atomic break checked component const constraint constructor continue eager event external fixed functor global include method mixin object parallel process protected pure sealed trait virtual volatile val".split(" "), 3 | {klass:"keyword"});a.push("! <> % & * + - -> / :: := :> :? :?> < = > ? @ ^ _ ` | ~ ' [< >] <| |> [| |] (| |) (* *) in".split(" "),{klass:"operator"});a.push({pattern:/(?:open|new)\s+((?:\.?[a-z][a-z0-9]*)+)/gi,matches:Syntax.extractMatches({klass:"type"})});a.push({pattern:/(?:\.)([a-z_][a-z0-9_]+)/gi,matches:Syntax.extractMatches({klass:"function"})});a.push({pattern:/(?:\(|,)\s*(\w+\s*=)/g,matches:Syntax.extractMatches({klass:"keyword-argument"})});a.push({pattern:/([a-z_][a-z0-9_]*)\s*\((?!\*)/gi, 4 | matches:Syntax.extractMatches({klass:"function"})});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.webLink);a.push({pattern:/\(\*[\s\S]*?\*\)/g,klass:"comment"});a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.ooc.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("ooc",function(a){a.push(["this","super","true","false","null",/[A-Z][A-Z0-9_]+/g],{klass:"constant"});a.push("Int Int8 Int16 Int32 Int64 Int80 Int128 UInt UInt8 UInt16 UInt32 UInt64 UInt80 UInt128 Octet Short UShort Long ULong LLong ULLong Float Double LDouble Float32 Float64 Float128 Char UChar WChar String Void Pointer Bool SizeT This".split(" "),{klass:"type"});a.push("class interface implement abstract extends from const final static import use extern inline proto break continue fallthrough operator if else for while do switch case as in version return include cover func".split(" "), 3 | {klass:"keyword"});a.push("+ - * / += -= *= /= = := == != ! % ? > < >= <= && || & | ^ . ~ .. >> << >>> <<< >>= <<= >>>= <<<= %= ^= @".split(" "),{klass:"operator"});a.push({pattern:/0[xcb][0-9a-fA-F]+/g,klass:"constant"});a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString); 4 | a.push(Syntax.lib.stringEscape);a.processes["function"]=Syntax.lib.webLinkProcess("http://docs.ooc-lang.org/search.html?q=")}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.pascal.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("pascal",function(a){a.push(["true","false","nil"],{klass:"constant",options:"gi"});a.push("absolute abstract all and_then as asm asmname attribute begin bindable c c_language case class const constructor destructor dispose do downto else end except exit export exports external far file finalization finally for forward function goto if implementation import inherited initialization inline interface interrupt is keywords label library module name near new object of on only operator or_else otherwise packed pascal pow private procedure program property protected public published qualified raise record repeat resident restricted segment set then threadvar to try type unit until uses value var view virtual while with".split(" "), 3 | {klass:"keyword",options:"gi"});a.push("+ - * / div mod and or xor shl shr not = >= > <> <= < in :=".split(" "),{klass:"operator",options:"gi"});a.push(Syntax.lib.camelCaseType);a.push({pattern:/\{[\s\S]*?\}/gm,klass:"comment",allow:["href"]});a.push({pattern:/\(\*[\s\S]*?\*\)/gm,klass:"comment",allow:["href"]});a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber); 4 | a.push(Syntax.lib.cStyleFunction)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.perl5.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("perl5",function(a){a.push(["this","true","false"],{klass:"constant"});a.push("bless caller continue die do dump else elsif eval exit for foreach goto if import last local my next no our package redo ref require return sub tie tied unless untie until use wantarray while".split(" "),{klass:"keyword"});a.push("-> ++ -- ** ! ~ \\ + - =~ !~ * / % x + - . << >> < > <= >= lt gt le ge == != <=> eq ne cmp ~~ & | ^ && || // .. ... ?: = , => not and or xor".split(" "),{klass:"operator"});a.push("abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr chroot close closedir connect cos crypt defined delete each endgrent endhostent endnetent endprotoent endpwent endservent eof exec exists exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime grep hex index int ioctl join keys kill lc lcfirst length link listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd oct open opendir ord pack pipe pop pos print printf prototype push quotemeta rand read readdir readline readlink readpipe recv rename reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study substr symlink syscall sysopen sysread sysseek system syswrite tell telldir time times tr truncate uc ucfirst umask undef unlink unpack unshift utime values vec wait waitpid warn write".split(" "), 3 | {klass:"function"});a.push(Syntax.lib.perlStyleRegularExpression);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.webLink);a.push({pattern:/(\$|@|%)\w+/gi,klass:"variable"});a.push({pattern:/__END__[\s\S]*/gm,klass:"comment"});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.cStyleFunction)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.php-script.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("php-script",function(a){a.push(["this","true","false"],{klass:"constant"});a.push("abstract and as break case cfunction class const continue declare default die do echo else elseif enddeclare endfor endforeach endif endswitch endwhile extends extends for foreach function global if implements include include_once interface old_function or require require_once return static switch throw use var while xor".split(" "),{klass:"keyword"});a.push("+ * / - & | ~ ! % < = > [ ] new".split(" "), 3 | {klass:"operator"});a.push(["private","protected","public"],{klass:"access"});a.push({pattern:/\$[a-z_][a-z0-9]*/gi,klass:"variable"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber); 4 | a.processes["function"]=Syntax.lib.webLinkProcess("http://www.php.net/manual-lookup.php?pattern=")}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.php.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.brushes.dependency("php","php-script");Syntax.register("php",function(a){a.push({pattern:/(<\?(php)?)((.|\n)*?)(\?>)/gm,matches:Syntax.extractMatches({klass:"keyword"},null,{brush:"php-script"},null,{klass:"keyword"})})}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.plain.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("plain",function(a){a.push(Syntax.lib.webLink)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.protobuf.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("protobuf",function(a){a.push("enum extend extensions group import max message option package returns rpc service syntax to default".split(" "),{klass:"keyword"});a.push(["true","false"],{klass:"constant"});a.push("bool bytes double fixed32 fixed64 float int32 int64 sfixed32 sfixed64 sint32 sint64 string uint32 uint64".split(" "),{klass:"type"});a.push(["optional","required","repeated"],{klass:"access"});a.push(Syntax.lib.camelCaseType);a.push({pattern:/\s+(\w+)\s*=\s*\d+/g,matches:Syntax.extractMatches({klass:"variable"})}); 3 | a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.python.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("python",function(a){a.push({pattern:/^\s*@\w+/gm,klass:"decorator"});a.push(["self","True","False","None"],{klass:"constant"});a.push("and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield".split(" "),{klass:"keyword"});a.push("!= % %= & &= ( ) * ** **= *= + += , - -= . / // //= /= : ; < << <<= <= <> = == > >= >> >>= @ [ ] ^ ^= ` ` { | |= } ~".split(" "),{klass:"operator"}); 3 | a.push("abs all any basestring bin bool callable chr classmethod cmp compile complex delattr dict dir divmod enumerate eval execfile file filter float format frozenset getattr globals hasattr hash help hex id input int isinstance issubclass iter len list locals long map max min next object oct open ord pow print property range raw_input reduce reload repr reversed round set setattr slice sorted staticmethod str sum super tuple type type unichr unicode vars xrange zip __import__ apply buffer coerce intern".split(" "), 4 | {klass:"builtin"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.perlStyleComment);a.push({pattern:/(['"]{3})([^\1])*?\1/gm,klass:"comment"});a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.processes["function"]=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");a.processes.type=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q="); 5 | a.processes.builtin=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=")}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.ruby.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.lib.rubyStyleFunction={pattern:/(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi,matches:Syntax.extractMatches({klass:"function"})};Syntax.lib.rubyStyleSymbol={pattern:/([:]?):\w+/g,klass:"constant",matches:function(a,b){return""!=a[1]?[]:[new Syntax.Match(a.index,a[0].length,b,a[0])]}}; 3 | Syntax.register("ruby",function(a){a.push(["private","protected","public"],{klass:"access"});a.push(["self","super","true","false","nil"],{klass:"constant"});a.push({pattern:/(%[\S])(\{[\s\S]*?\})/g,matches:Syntax.extractMatches({klass:"function"},{klass:"constant"})});a.push({pattern:/`[^`]+`/g,klass:"string"});a.push({pattern:/#\{([^\}]*)\}/g,matches:Syntax.extractMatches({brush:"ruby",only:["string"]})});a.push(Syntax.lib.rubyStyleRegularExpression);a.push({pattern:/(@+|\$)[\w]+/g,klass:"variable"}); 4 | a.push(Syntax.lib.camelCaseType);a.push("alias and begin break case class def define_method defined? do else elsif end ensure false for if in module next not or raise redo rescue retry return then throw undef unless until when while yield block_given?".split(" "),{klass:"keyword"});a.push("+*/-&|~!%<=>".split(""),{klass:"operator"});a.push(Syntax.lib.rubyStyleSymbol);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString); 5 | a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.rubyStyleFunction);a.push(Syntax.lib.cStyleFunction)}); 6 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.scala.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.brushes.dependency("scala","xml"); 3 | Syntax.register("scala",function(a){a.push("abstract do finally import object return trait var case catch class else extends for forSome if lazy match new override package private sealed super try type while with yield def final implicit protected throw val".split(" "),{klass:"keyword"});a.push("_ : = => <- <: <% >: # @".split(" "),{klass:"operator"});a.push(["this","null","true","false"],{klass:"constant"});a.push({pattern:/"""[\s\S]*?"""/g,klass:"string"});a.push(Syntax.lib.doubleQuotedString); 4 | a.push({pattern:/(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi,matches:Syntax.extractMatches({klass:"function"})});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.derives("xml")}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.smalltalk.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("smalltalk",function(a){a.push(["self","super","true","false","nil"],{klass:"constant"});a.push(["[","]","|",":=","."],{klass:"operator"});a.push({pattern:/\w+:/g,klass:"function"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.sql.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.lib.sqlStyleComment={pattern:/-- .*$/gm,klass:"comment",allow:["href"]}; 3 | Syntax.register("sql",function(a){a.push("= != < > <= >= + - * / %".split(" "),{klass:"operator"});a.push(Syntax.lib.sqlStyleComment);a.push("A ABORT ABS ABSOLUTE ACCESS ACTION ADA ADD ADMIN AFTER AGGREGATE ALIAS ALL ALLOCATE ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARE ARRAY AS ASC ASENSITIVE ASSERTION ASSIGNMENT ASYMMETRIC AT ATOMIC ATTRIBUTE ATTRIBUTES AUDIT AUTHORIZATION AUTO_INCREMENT AVG AVG_ROW_LENGTH BACKUP BACKWARD BEFORE BEGIN BERNOULLI BETWEEN BIGINT BINARY BIT BIT_LENGTH BITVAR BLOB BOOL BOOLEAN BOTH BREADTH BREAK BROWSE BULK BY C CACHE CALL CALLED CARDINALITY CASCADE CASCADED CASE CAST CATALOG CATALOG_NAME CEIL CEILING CHAIN CHANGE CHAR CHAR_LENGTH CHARACTER CHARACTER_LENGTH CHARACTER_SET_CATALOG CHARACTER_SET_NAME CHARACTER_SET_SCHEMA CHARACTERISTICS CHARACTERS CHECK CHECKED CHECKPOINT CHECKSUM CLASS CLASS_ORIGIN CLOB CLOSE CLUSTER CLUSTERED COALESCE COBOL COLLATE COLLATION COLLATION_CATALOG COLLATION_NAME COLLATION_SCHEMA COLLECT COLUMN COLUMN_NAME COLUMNS COMMAND_FUNCTION COMMAND_FUNCTION_CODE COMMENT COMMIT COMMITTED COMPLETION COMPRESS COMPUTE CONDITION CONDITION_NUMBER CONNECT CONNECTION CONNECTION_NAME CONSTRAINT CONSTRAINT_CATALOG CONSTRAINT_NAME CONSTRAINT_SCHEMA CONSTRAINTS CONSTRUCTOR CONTAINS CONTAINSTABLE CONTINUE CONVERSION CONVERT COPY CORR CORRESPONDING COUNT COVAR_POP COVAR_SAMP CREATE CREATEDB CREATEROLE CREATEUSER CROSS CSV CUBE CUME_DIST CURRENT CURRENT_DATE CURRENT_DEFAULT_TRANSFORM_GROUP CURRENT_PATH CURRENT_ROLE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_TRANSFORM_GROUP_FOR_TYPE CURRENT_USER CURSOR CURSOR_NAME CYCLE DATA DATABASE DATABASES DATE DATETIME DATETIME_INTERVAL_CODE DATETIME_INTERVAL_PRECISION DAY DAY_HOUR DAY_MICROSECOND DAY_MINUTE DAY_SECOND DAYOFMONTH DAYOFWEEK DAYOFYEAR DBCC DEALLOCATE DEC DECIMAL DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED DEFINED DEFINER DEGREE DELAY_KEY_WRITE DELAYED DELETE DELIMITER DELIMITERS DENSE_RANK DENY DEPTH DEREF DERIVED DESC DESCRIBE DESCRIPTOR DESTROY DESTRUCTOR DETERMINISTIC DIAGNOSTICS DICTIONARY DISABLE DISCONNECT DISK DISPATCH DISTINCT DISTINCTROW DISTRIBUTED DIV DO DOMAIN DOUBLE DROP DUAL DUMMY DUMP DYNAMIC DYNAMIC_FUNCTION DYNAMIC_FUNCTION_CODE EACH ELEMENT ELSE ELSEIF ENABLE ENCLOSED ENCODING ENCRYPTED END END-EXEC ENUM EQUALS ERRLVL ESCAPE ESCAPED EVERY EXCEPT EXCEPTION EXCLUDE EXCLUDING EXCLUSIVE EXEC EXECUTE EXISTING EXISTS EXIT EXP EXPLAIN EXTERNAL EXTRACT FALSE FETCH FIELDS FILE FILLFACTOR FILTER FINAL FIRST FLOAT FLOAT4 FLOAT8 FLOOR FLUSH FOLLOWING FOR FORCE FOREIGN FORTRAN FORWARD FOUND FREE FREETEXT FREETEXTTABLE FREEZE FROM FULL FULLTEXT FUNCTION FUSION G GENERAL GENERATED GET GLOBAL GO GOTO GRANT GRANTED GRANTS GREATEST GROUP GROUPING HANDLER HAVING HEADER HEAP HIERARCHY HIGH_PRIORITY HOLD HOLDLOCK HOST HOSTS HOUR HOUR_MICROSECOND HOUR_MINUTE HOUR_SECOND IDENTIFIED IDENTITY IDENTITY_INSERT IDENTITYCOL IF IGNORE ILIKE IMMEDIATE IMMUTABLE IMPLEMENTATION IMPLICIT IN INCLUDE INCLUDING INCREMENT INDEX INDICATOR INFILE INFIX INHERIT INHERITS INITIAL INITIALIZE INITIALLY INNER INOUT INPUT INSENSITIVE INSERT INSERT_ID INSTANCE INSTANTIABLE INSTEAD INT INT1 INT2 INT3 INT4 INT8 INTEGER INTERSECT INTERSECTION INTERVAL INTO INVOKER IS ISAM ISNULL ISOLATION ITERATE JOIN K KEY KEY_MEMBER KEY_TYPE KEYS KILL LANCOMPILER LANGUAGE LARGE LAST LAST_INSERT_ID LATERAL LEADING LEAST LEAVE LEFT LENGTH LESS LEVEL LIKE LIMIT LINENO LINES LISTEN LN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION LOCATOR LOCK LOGIN LOGS LONG LONGBLOB LONGTEXT LOOP LOW_PRIORITY LOWER M MAP MATCH MATCHED MAX MAX_ROWS MAXEXTENTS MAXVALUE MEDIUMBLOB MEDIUMINT MEDIUMTEXT MEMBER MERGE MESSAGE_LENGTH MESSAGE_OCTET_LENGTH MESSAGE_TEXT METHOD MIDDLEINT MIN MIN_ROWS MINUS MINUTE MINUTE_MICROSECOND MINUTE_SECOND MINVALUE MLSLABEL MOD MODE MODIFIES MODIFY MODULE MONTH MONTHNAME MORE MOVE MULTISET MUMPS MYISAM NAMES NATIONAL NATURAL NCHAR NCLOB NESTING NEW NEXT NO NO_WRITE_TO_BINLOG NOAUDIT NOCHECK NOCOMPRESS NOCREATEDB NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN NONCLUSTERED NONE NORMALIZE NORMALIZED NOSUPERUSER NOT NOTHING NOTIFY NOTNULL NOWAIT NULL NULLABLE NULLIF NULLS NUMBER NUMERIC OBJECT OCTET_LENGTH OCTETS OF OFF OFFLINE OFFSET OFFSETS OIDS OLD ON ONLINE ONLY OPEN OPENDATASOURCE OPENQUERY OPENROWSET OPENXML OPERATION OPERATOR OPTIMIZE OPTION OPTIONALLY OPTIONS OR ORDER ORDERING ORDINALITY OTHERS OUT OUTER OUTFILE OUTPUT OVER OVERLAPS OVERLAY OVERRIDING OWNER PACK_KEYS PAD PARAMETER PARAMETER_MODE PARAMETER_NAME PARAMETER_ORDINAL_POSITION PARAMETER_SPECIFIC_CATALOG PARAMETER_SPECIFIC_NAME PARAMETER_SPECIFIC_SCHEMA PARAMETERS PARTIAL PARTITION PASCAL PASSWORD PATH PCTFREE PERCENT PERCENT_RANK PERCENTILE_CONT PERCENTILE_DISC PLACING PLAN PLI POSITION POSTFIX POWER PRECEDING PRECISION PREFIX PREORDER PREPARE PREPARED PRESERVE PRIMARY PRINT PRIOR PRIVILEGES PROC PROCEDURAL PROCEDURE PROCESS PROCESSLIST PUBLIC PURGE QUOTE RAID0 RAISERROR RANGE RANK RAW READ READS READTEXT REAL RECHECK RECONFIGURE RECURSIVE REF REFERENCES REFERENCING REGEXP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY REINDEX RELATIVE RELEASE RELOAD RENAME REPEAT REPEATABLE REPLACE REPLICATION REQUIRE RESET RESIGNAL RESOURCE RESTART RESTORE RESTRICT RESULT RETURN RETURNED_CARDINALITY RETURNED_LENGTH RETURNED_OCTET_LENGTH RETURNED_SQLSTATE RETURNS REVOKE RIGHT RLIKE ROLE ROLLBACK ROLLUP ROUTINE ROUTINE_CATALOG ROUTINE_NAME ROUTINE_SCHEMA ROW ROW_COUNT ROW_NUMBER ROWCOUNT ROWGUIDCOL ROWID ROWNUM ROWS RULE SAVE SAVEPOINT SCALE SCHEMA SCHEMA_NAME SCHEMAS SCOPE SCOPE_CATALOG SCOPE_NAME SCOPE_SCHEMA SCROLL SEARCH SECOND SECOND_MICROSECOND SECTION SECURITY SELECT SELF SENSITIVE SEPARATOR SEQUENCE SERIALIZABLE SERVER_NAME SESSION SESSION_USER SET SETOF SETS SETUSER SHARE SHOW SHUTDOWN SIGNAL SIMILAR SIMPLE SIZE SMALLINT SOME SONAME SOURCE SPACE SPATIAL SPECIFIC SPECIFIC_NAME SPECIFICTYPE SQL SQL_BIG_RESULT SQL_BIG_SELECTS SQL_BIG_TABLES SQL_CALC_FOUND_ROWS SQL_LOG_OFF SQL_LOG_UPDATE SQL_LOW_PRIORITY_UPDATES SQL_SELECT_LIMIT SQL_SMALL_RESULT SQL_WARNINGS SQLCA SQLCODE SQLERROR SQLEXCEPTION SQLSTATE SQLWARNING SQRT SSL STABLE START STARTING STATE STATEMENT STATIC STATISTICS STATUS STDDEV_POP STDDEV_SAMP STDIN STDOUT STORAGE STRAIGHT_JOIN STRICT STRING STRUCTURE STYLE SUBCLASS_ORIGIN SUBLIST SUBMULTISET SUBSTRING SUCCESSFUL SUM SUPERUSER SYMMETRIC SYNONYM SYSDATE SYSID SYSTEM SYSTEM_USER TABLE TABLE_NAME TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TERMINATE TERMINATED TEXT TEXTSIZE THAN THEN TIES TIME TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TINYBLOB TINYINT TINYTEXT TO TOAST TOP TOP_LEVEL_COUNT TRAILING TRAN TRANSACTION TRANSACTION_ACTIVE TRANSACTIONS_COMMITTED TRANSACTIONS_ROLLED_BACK TRANSFORM TRANSFORMS TRANSLATE TRANSLATION TREAT TRIGGER TRIGGER_CATALOG TRIGGER_NAME TRIGGER_SCHEMA TRIM TRUE TRUNCATE TRUSTED TSEQUAL TYPE UESCAPE UID UNBOUNDED UNCOMMITTED UNDER UNDO UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNLOCK UNNAMED UNNEST UNSIGNED UNTIL UPDATE UPDATETEXT UPPER USAGE USE USER USER_DEFINED_TYPE_CATALOG USER_DEFINED_TYPE_CODE USER_DEFINED_TYPE_NAME USER_DEFINED_TYPE_SCHEMA USING UTC_DATE UTC_TIME UTC_TIMESTAMP VACUUM VALID VALIDATE VALIDATOR VALUE VALUES VAR_POP VAR_SAMP VARBINARY VARCHAR VARCHAR2 VARCHARACTER VARIABLE VARIABLES VARYING VERBOSE VIEW VOLATILE WAITFOR WHEN WHENEVER WHERE WHILE WIDTH_BUCKET WINDOW WITH WITHIN WITHOUT WORK WRITE WRITETEXT X509 XOR YEAR YEAR_MONTH ZEROFILL ZONE".split(" "),{klass:"keyword", 4 | options:"gi"});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.webLink)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.super-collider.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("super-collider",function(a){a.push(["const","arg","classvar","var"],{klass:"keyword"});a.push("`+@:*/-&|~!%<=>".split(""),{klass:"operator"});a.push("thisFunctionDef thisFunction thisMethod thisProcess thisThread this super true false nil inf".split(" "),{klass:"constant"});a.push(Syntax.lib.camelCaseType);a.push({pattern:/\$(\\)?./g,klass:"constant"});a.push({pattern:/\\[a-z_][a-z0-9_]*/gi,klass:"symbol"});a.push({pattern:/'[^']+'/g,klass:"symbol"});a.push(Syntax.lib.cStyleComment); 3 | a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push({pattern:/(?:\.)([a-z_][a-z0-9_]*)/gi,matches:Syntax.extractMatches({klass:"function"})});a.push(Syntax.lib.cStyleFunction)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.swift.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("swift",function(a){a.push(["fileprivate","open","private","public"],{klass:"access"});a.push(["self","super","true","false","nil"],{klass:"constant"});a.push({pattern:/`[^`]+`/g,klass:"identifier"});a.push({pattern:/\\\(([^)]*)\)/g,matches:Syntax.extractMatches({brush:"swift",only:["string"]})});a.push(Syntax.lib.camelCaseType);a.push("associatedtype class deinit enum extension fileprivate func import init inout internal let operator private protocol static struct subscript typealias var break case continue default defer do else fallthrough for guard if in repeat return switch where while as catch is rethrows throw throws try _ #available #colorLiteral #column #else #elseif #endif #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation associativity convenience dynamic didSet final get infix indirect lazy left mutating none nonmutating optional override postfix precedence prefix Protocol required right set Type unowned weak willSet".split(" "), 3 | {klass:"keyword"});a.push("+ * / - & | ~ ! % < = > ( ) { } [ ] . , : ; = @ # -> ` ? !".split(" "),{klass:"operator"});a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.cppStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.cStyleFunction)}); 4 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.xml.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.lib.xmlEntity={pattern:/&\w+;/g,klass:"entity"};Syntax.lib.xmlPercentEscape={pattern:/(%[0-9a-f]{2})/gi,klass:"percent-escape",only:["string"]}; 3 | Syntax.register("xml-tag",function(a){a.push({pattern:/<\/?((?:[^:\s>]+:)?)([^\s>]+)(\s[^>]*)?\/?>/g,matches:Syntax.extractMatches({klass:"namespace"},{klass:"tag-name"})});a.push({pattern:/([^=\s]+)=(".*?"|'.*?'|[^\s>]+)/g,matches:Syntax.extractMatches({klass:"attribute",only:["tag"]},{klass:"string",only:["tag"]})});a.push(Syntax.lib.xmlEntity);a.push(Syntax.lib.xmlPercentEscape);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString)}); 4 | Syntax.register("xml",function(a){a.push({pattern:/()/gm,matches:Syntax.extractMatches({klass:"cdata",allow:["cdata-content","cdata-tag"]},{klass:"cdata-tag"},{klass:"cdata-content"},{klass:"cdata-tag"})});a.push(Syntax.lib.xmlComment);a.push({pattern:/<[^>\-\s]([^>'"!\/;\?@\[\]^`\{\}\|]|"[^"]*"|'[^']')*[\/?]?>/g,brush:"xml-tag"});a.push(Syntax.lib.xmlEntity);a.push(Syntax.lib.xmlPercentEscape);a.push(Syntax.lib.webLink)}); 5 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.xrb.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.brushes.dependency("xrb","xml");Syntax.brushes.dependency("xrb","ruby");Syntax.register("xrb",function(a){a.push({pattern:/((<\?r)([\s\S]*?)(\?>))/gm,matches:Syntax.extractMatches({klass:"ruby-tag",allow:["keyword","ruby"]},{klass:"keyword"},{brush:"ruby"},{klass:"keyword"})});a.push({pattern:/((#{)([\s\S]*?)(}))/gm,matches:Syntax.extractMatches({klass:"ruby-tag",allow:["keyword","ruby"]},{klass:"keyword"},{brush:"ruby"},{klass:"keyword"})});a.derives("xml")}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.brush.yaml.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.register("yaml",function(a){a.push({pattern:/^\s*#.*$/gm,klass:"comment",allow:["href"]});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push({pattern:/(&|\*)[a-z0-9]+/gi,klass:"constant"});a.push({pattern:/(.*?):/gi,matches:Syntax.extractMatches({klass:"keyword"})});a.push(Syntax.lib.webLink)}); 3 | -------------------------------------------------------------------------------- /dist/jquery.syntax.cache.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.alias("apache",[]);Syntax.alias("applescript",[]);Syntax.alias("assembly",["asm"]);Syntax.alias("bash-script",[]);Syntax.alias("bash",[]);Syntax.alias("basic",["vb"]);Syntax.alias("clang",["cpp","c++","c","objective-c"]);Syntax.alias("csharp",["c-sharp","c#"]);Syntax.alias("css",[]);Syntax.alias("diff",["patch"]);Syntax.alias("go",[]);Syntax.alias("haskell",[]);Syntax.alias("html",[]);Syntax.alias("io",[]);Syntax.alias("java",[]);Syntax.alias("javascript",["js","actionscript"]); 3 | Syntax.alias("kai",[]);Syntax.alias("lisp",["scheme","clojure"]);Syntax.alias("lua",[]);Syntax.alias("nginx",[]);Syntax.alias("ocaml",["ml","sml","fsharp"]);Syntax.alias("ooc",[]);Syntax.alias("pascal",["delphi"]);Syntax.alias("perl5",[]);Syntax.alias("php-script",[]);Syntax.alias("php",[]);Syntax.alias("plain",["text"]);Syntax.alias("protobuf",[]);Syntax.alias("python",[]);Syntax.alias("ruby",[]);Syntax.alias("scala",[]);Syntax.alias("smalltalk",[]);Syntax.alias("sql",[]); 4 | Syntax.alias("super-collider",["sc"]);Syntax.alias("swift",[]);Syntax.alias("xml",[]);Syntax.alias("xrb",["trenni"]);Syntax.alias("yaml",[]);Syntax.styles["jquery.syntax.brush.apache"]=["base/jquery.syntax.brush.apache.css"];Syntax.styles["jquery.syntax.brush.applescript"]=["base/jquery.syntax.brush.applescript.css"];Syntax.styles["jquery.syntax.brush.assembly"]=["base/jquery.syntax.brush.assembly.css"];Syntax.styles["jquery.syntax.brush.bash-script"]=["base/jquery.syntax.brush.bash-script.css"]; 5 | Syntax.styles["jquery.syntax.brush.bash"]=["base/jquery.syntax.brush.bash.css"];Syntax.styles["jquery.syntax.brush.clang"]=["base/jquery.syntax.brush.clang.css"];Syntax.styles["jquery.syntax.brush.css"]=["base/jquery.syntax.brush.css.css"];Syntax.styles["jquery.syntax.brush.diff"]=["base/jquery.syntax.brush.diff.css"];Syntax.styles["jquery.syntax.brush.html"]=["base/jquery.syntax.brush.html.css"];Syntax.styles["jquery.syntax.brush.ocaml"]=["base/jquery.syntax.brush.ocaml.css"]; 6 | Syntax.styles["jquery.syntax.brush.protobuf"]=["base/jquery.syntax.brush.protobuf.css"];Syntax.styles["jquery.syntax.brush.python"]=["base/jquery.syntax.brush.python.css"];Syntax.styles["jquery.syntax.brush.ruby"]=["base/jquery.syntax.brush.ruby.css"];Syntax.styles["jquery.syntax.brush.xml"]=["base/jquery.syntax.brush.xml.css"];Syntax.styles["jquery.syntax.core"]=["base/jquery.syntax.core.css","bright/jquery.syntax.core.css","paper/jquery.syntax.core.css"];Syntax.styles["jquery.syntax.editor"]=["base/jquery.syntax.editor.css"]; 7 | Syntax.themes.base=[];Syntax.themes.bright=["base"];Syntax.themes.paper=["base"]; 8 | -------------------------------------------------------------------------------- /dist/jquery.syntax.editor.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Syntax.Editor=function(a,b){this.container=a;this.current=this.getLines()};Syntax.Editor.prototype.getLines=function(){for(var a=this.container.childNodes,b=[],c=[],d="",f=0,e=0;ea.start&&d>a.start;)if(this.current.lines[c-1]==b.lines[d-1])--c,--d;else break;a.end=d;a.originalEnd=c;for(a.difference=b.lines.length-this.current.lines.length;0');c.append(b.children());var d=new Syntax.Editor(c.get(0)),f=function(b){var c=d.getClientState(),e=d.updateChangedLines();0>e.difference&&0').append(c)}; 12 | -------------------------------------------------------------------------------- /dist/jquery.syntax.js: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | Function.prototype.bind||(Function.prototype.bind=function(a){var b=Array.prototype.slice.call(arguments,1),c=this;return function(){return c.apply(a,b)}});function ResourceLoader(a){this.dependencies={};this.loading={};this.loader=a}ResourceLoader.prototype._finish=function(a){var b=this.dependencies[a];if(b){a=this._loaded.bind(this,a);for(var c=0;c");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet", 6 | type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet", 6 | type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d span:nth-child(odd) { 31 | background-color: rgba(0, 0, 0, 0.05); } 32 | -------------------------------------------------------------------------------- /dist/paper/theme.js: -------------------------------------------------------------------------------- 1 | Syntax.themes["paper"] = ["base"] 2 | -------------------------------------------------------------------------------- /examples/ex.applescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |

Syntax: AppleScript

19 | 20 |

Hello World & Mode-line Support

21 | 22 |
(*
 23 | Copyright (C) 2009 Orion Transfer Ltd. All Rights Reserved. See http://www.oriontransfer.co.nz/ for more information.
 24 | Drop files on top of this application to produce a zip archive on the desktop containing compressed JPEGs at a maximum size of 800px.
 25 | *)
 26 | 
 27 | on open some_items
 28 | 	-- If we drop a single folder onto the icon, we pull the name from the folder name
 29 | 	set target_name to "Images"
 30 | 
 31 | 	if (count of some_items) = 1 then
 32 | 		set first_item to get item 1 of some_items
 33 | 
 34 | 		tell application "System Events"
 35 | 			set target_item to disk item (first_item as string)
 36 | 
 37 | 			if class of target_item is folder then
 38 | 				set target_name to name of first_item
 39 | 			end if
 40 | 		end tell
 41 | 	end if
 42 | 
 43 | 	display dialog "Name of Archive" default answer target_name buttons {"OK"} default button 1
 44 | 	set target_name to text returned of the result
 45 | 
 46 | 	tell application "Finder"
 47 | 		set desktop_path to folder "Desktop" of home
 48 | 
 49 | 		make new folder at desktop_path with properties {name:target_name}
 50 | 
 51 | 		set destination to (folder target_name of desktop_path) as alias
 52 | 		set archive_path to (POSIX path of (desktop_path as text)) & target_name & ".zip"
 53 | 	end tell
 54 | 
 55 | 	repeat with this_item in some_items
 56 | 		tell application "System Events"
 57 | 			set source_item to disk item (this_item as string)
 58 | 		end tell
 59 | 
 60 | 		process_path(source_item, destination)
 61 | 	end repeat
 62 | 
 63 | 	set archive_command to "/usr/bin/ditto -c -k -rsrc " & quoted form of (POSIX path of destination) & " " & quoted form of archive_path
 64 | 
 65 | 	do shell script archive_command
 66 | 
 67 | 	tell application "Finder"
 68 | 		activate
 69 | 
 70 | 		delete folder target_name of desktop_path
 71 | 
 72 | 		reveal file (target_name & ".zip") of desktop_path
 73 | 	end tell
 74 | end open
 75 | 
 76 | to process_path(source, destination)
 77 | 	-- Figure out if it is a file or folder, and recurse appropriately
 78 | 	tell application "System Events"
 79 | 		set is_folder to class of source is folder
 80 | 		if is_folder then
 81 | 			set sub_items to items in source
 82 | 		end if
 83 | 	end tell
 84 | 
 85 | 	if is_folder then
 86 | 		repeat with this_item in sub_items
 87 | 			process_path(this_item, destination)
 88 | 		end repeat
 89 | 	else
 90 | 		tell application "System Events"
 91 | 			set source_alias to (path of source) as alias
 92 | 		end tell
 93 | 
 94 | 		resize_and_save(source_alias, destination)
 95 | 	end if
 96 | end process_path
 97 | 
 98 | to resize_and_save(image_alias, destination_alias)
 99 | 	tell application "Image Events"
100 | 		launch
101 | 
102 | 		set opened_image to open image_alias
103 | 
104 | 		if class of opened_image is image and not dimensions of opened_image = {} then
105 | 			set dim to dimensions of opened_image
106 | 
107 | 			-- We only resize if the dimension is bigger than 800
108 | 			if (first item of dim > 800 or second item of dim > 800) then
109 | 				scale opened_image to size 800
110 | 			end if
111 | 
112 | 			save opened_image in destination_alias as JPEG with compression level medium
113 | 
114 | 			close opened_image
115 | 		end if
116 | 	end tell
117 | end resize_and_save
118 | 
119 | 120 | -------------------------------------------------------------------------------- /examples/ex.asm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |

Syntax: Assembler

19 | 20 |

21 | .text
22 | 	.global _start
23 | 
24 | _start:
25 | 	# ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count)
26 | 	movl  $len, %edx    # size_t count
27 | 	movl  $msg, %ecx    # const char __user * buf
28 | 	movl  $1,   %ebx    # unsigned int fd
29 | 	movl  $4,   %eax    # system call number (sys_write)
30 | 	int   $0x80         # call kernel
31 | 
32 | 	# void _exit(int status);
33 | 	movl  $0,   %ebx    # int status
34 | 	movl  $1,   %eax    # system call number (sys_exit)
35 | 	int   $0x80         # call kernel
36 | 
37 | .data
38 | 
39 | msg:
40 | 	.ascii "Hello, world!\n"
41 | 	len = . - msg
42 | 43 | -------------------------------------------------------------------------------- /examples/ex.bash.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |

Syntax: Bash

19 | 20 |

Bash is context-sensitive - a script could mean different things depending on what is defined in the environment. Thus, to present Bash code clearly, you will need to use inline markup, such as the last example on this page.

21 | 22 |
#!/bin/bash
 23 | # Counting to 11 in 10 different ways.
 24 | 
 25 | n=1; echo -n "$n "
 26 | 
 27 | let "n = $n + 1"   # let "n = n + 1"  also works.
 28 | echo -n "$n "
 29 | 
 30 | 
 31 | : $((n = $n + 1))
 32 | #  ":" necessary because otherwise Bash attempts
 33 | #+ to interpret "$((n = $n + 1))" as a command.
 34 | echo -n "$n "
 35 | 
 36 | (( n = n + 1 ))
 37 | #  A simpler alternative to the method above.
 38 | #  Thanks, David Lombard, for pointing this out.
 39 | echo -n "$n "
 40 | 
 41 | n=$(($n + 1))
 42 | echo -n "$n "
 43 | 
 44 | : $[ n = $n + 1 ]
 45 | #  ":" necessary because otherwise Bash attempts
 46 | #+ to interpret "$[ n = $n + 1 ]" as a command.
 47 | #  Works even if "n" was initialized as a string.
 48 | echo -n "$n "
 49 | 
 50 | n=$[ $n + 1 ]
 51 | #  Works even if "n" was initialized as a string.
 52 | #* Avoid this type of construct, since it is obsolete and nonportable.
 53 | #  Thanks, Stephane Chazelas.
 54 | echo -n "$n "
 55 | 
 56 | # Now for C-style increment operators.
 57 | # Thanks, Frank Wang, for pointing this out.
 58 | 
 59 | let "n++"          # let "++n"  also works.
 60 | echo -n "$n "
 61 | 
 62 | (( n++ ))          # (( ++n )  also works.
 63 | echo -n "$n "
 64 | 
 65 | : $(( n++ ))       # : $(( ++n )) also works.
 66 | echo -n "$n "
 67 | 
 68 | : $[ n++ ]         # : $[ ++n ]] also works
 69 | echo -n "$n "
 70 | 
 71 | echo
 72 | 
 73 | exit 0
74 | 75 |

76 | 77 |

#!/bin/bash
 78 | 
 79 | svc_cluster_ip=10.0.0.10
 80 | svc_priv_dsa=~/.ssh/id_dsa
 81 | 
 82 | if [ ! -f $svc_priv_dsa ] ; then
 83 | 	echo " ${0##*/} is missing the SSH DSA private key"
 84 | 	echo "                         needed to access the SAN Volume controller."
 85 | 	echo " Please specify the correct path!"
 86 | fi
 87 | 
 88 | if [ -z $1 ] ; then
 89 | 	echo
 90 | 	echo " ${0##*/} [ WWPN ]"
 91 | 	echo
 92 | 	echo "  WWPN    - WWPN, or part of WWPN that is being searched."
 93 | 	echo "            Should be entered in continous format (ie. no dash (-) or colon (:))!"
 94 | 	echo
 95 | 	exit 1;
 96 | fi
 97 | 
 98 | WWPN=$1
 99 | 
100 | list_wwpn_by_host() {
101 | 	local _host=$1
102 | 
103 | 	if [ ! -z $_host ] ; then
104 | 		ssh -i $svc_priv_dsa admin@$svc_cluster_ip svcinfo lshost \
105 | 		-delim : $_host | grep ^WWPN | sed "s,WWPN:,,"
106 | 	fi
107 | }
108 | 
109 | #set -x
110 | 
111 | HOST_LIST="$( ssh -i $svc_priv_dsa admin@$svc_cluster_ip svcinfo lshost -delim : -nohdr | cut -d: -f2 )"
112 | 
113 | for HOST in $HOST_LIST; do
114 | 	echo -n "$HOST: "
115 | 	echo `list_wwpn_by_host $HOST`
116 | done | grep $WWPN
117 | 
118 | #set +x
119 | 
120 | 121 |

This next example uses inline HTML to markup and highlight rd-resolve-test bob.

122 | 123 |
samuel@ayako:~$ which git
124 | /usr/bin/git
125 | samuel@ayako:~$ ls -lah
126 | getconf     getent      getopt      getopts     gettext     gettext.sh  gettextize  
127 | samuel@ayako:~# sudo rd-resolve-test bob
128 | /home/samuel
129 | 130 |

Here is the HTML of the above <pre>:

131 | 132 |

133 | 
134 | 
137 | 
138 | 	
139 | 


--------------------------------------------------------------------------------
/examples/ex.css.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 	
 4 | 		
 5 | 
 6 | 		
 7 | 		
 8 | 		
 9 | 
10 | 		
15 | 
16 | 	
17 | 	
18 | 		

Syntax: CSS

19 | 20 |

Special Example

21 | 22 |

This example extracts definitions and creates example elements on the right hand side.

23 | 24 |

25 | p {
26 | 	background-color: #ccc;
27 | 	border: 1px solid black;
28 | }
29 | 
30 | /* The way this information is extracted isn't that great, but as long as the CSS is kept simple, it is fine for demonstration purposes */
31 | 
32 | h1 {
33 | 	color: #cfcfcf;
34 | 	background-color: red;
35 | 	border: 1px solid green;
36 | 	
37 | 	padding: 10px;
38 | }
39 | 
40 | h2 {
41 | 	color: PaleGoldenRod;
42 | 	text-shadow: 0.1em 0.1em 5px #333;
43 | 	
44 | 	border-color:#ff0000 #0000ff;
45 | }
46 | 		
47 | 48 | -------------------------------------------------------------------------------- /examples/ex.editor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |

Syntax Editor

19 | 20 |

Ruby Editor

21 | 22 |
/* Foo Bar */
23 | namespace x {
24 | 
25 | }
26 | 
27 | 28 | -------------------------------------------------------------------------------- /examples/ex.html.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 22 | 23 | 30 | 31 | 32 | 33 |

Syntax: HTML / XML

34 | 35 |

HTML Example

36 | 37 |

 38 | 		
 39 | 		
40 | You can't see me...... or maybe you can? 41 |
42 | 43 |

Here is another example of using a mode-line. The mode-line must be on line 1 or 2 for it to be recognized:

44 | 45 |
 46 | <!DOCTYPE html>
 47 | <!--*- mode: html; tab-width: 4; -*-->
 48 | 
 49 | <html lang="en">
 50 | <head>
 51 | 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 52 | 	<title>My Website</title>
 53 | </head>
 54 | <body>
 55 | 	<p>Hello <?= "World" ?></p>
 56 | </body>
 57 | </html>
 58 | 
59 | 60 |

Here is an example of embedded instructions:

61 | 62 |
<!DOCTYPE html>
 63 | 
 64 | <html lang="en">
 65 | <head>
 66 | 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 67 | 	<title>My Website</title>
 68 | </head>
 69 | <body>
 70 | 	<p>Hello <?= h("World") ?>
 71 | 	
 72 | 	<p>Hello <%= h("ASP...!? WTF???") %>
 73 | 	
 74 | 	<?php
 75 | 		// This will print Hello World!
 76 | 		echo "Hello World!";
 77 | 		setEndOfWorld("tomorrow");
 78 | 	?>
 79 | 	
 80 | 	
 81 | 	<?r if request[:bob] ?>
 82 | 		<p>Hello Bob</p>
 83 | 	<?r end ?>
 84 | </body>
 85 | </html>
 86 | 	
87 | 88 |

CDATA sections

89 | 90 |

 91 | <description><![CDATA[
 92 | 	<h1>Television</h1>
 93 | 
 94 | 	<p>Brainwashing the masses.</p>
 95 | ]]></description>
 96 | 	
97 | 98 |

Apache Configuration (not quite HTML, but similar)

99 | 100 |

101 | <VirtualHost *>
102 | 	# ... standard configuration ...
103 | 	# ServerName, DocumentRoot, etc
104 | 
105 | 	# Root DAV which requires authentication to access:
106 | 	<Location "/MyFiles/">
107 | 		DAV on
108 | 		AuthType Digest
109 | 		AuthName "Digest Realm"
110 | 		AuthUserFile /etc/apache2/users/myfiles.htdigest
111 | 		Require user me
112 | 
113 | 		<LimitExcept GET HEAD OPTIONS REPORT PROPFIND>
114 | 			Require user me
115 | 		</LimitExcept>
116 | 	</Location>
117 | 
118 | 	# Specific folder which can be accessed anonymously (read-only)
119 | 	<Location "/MyFiles/Public/">
120 | 		<Limit GET HEAD OPTIONS REPORT PROPFIND>
121 | 			Allow from all
122 | 			Satisfy any
123 | 		</Limit>
124 | 	</Location>
125 | 
126 | 	# Specific folder which can be accessed anonymously (read/write)
127 | 	<Location "/MyFiles/DropBox/">
128 | 		Allow from all
129 | 		Satisfy any
130 | 	</Location>
131 | </VirtualHost>
132 | 	
133 | 134 | -------------------------------------------------------------------------------- /examples/ex.ooc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 |

Syntax: OOC

18 | 19 |

 20 | include stdint, stdlib, memory, ./myheader // C includes, "./" means relative
 21 | use gtk, yajit // .use files define include paths, libraries, sourcepath extensions
 22 | import rock/middle/[FunctionCall, VariableAccess, Expression], gtk/Button // import other ooc files
 23 | 
 24 | Representable: interface {
 25 |     toString: func -> String
 26 | }
 27 | 
 28 | String: cover from Char* implements Representable {
 29 |     length: extern(strlen) func -> Int
 30 |     toString: func -> String { this } // implicit return
 31 | }
 32 | 
 33 | /**
 34 |  * Dereference is actually a node used in rock (ooc compiler in ooc)
 35 |  * You generate html docs with rock+sonofaj+sphinx, see http://docs.ooc-lang.org
 36 |  * @author nddrylliog
 37 |  */
 38 | Dereference: class extends Expression implements Representable {
 39 | 
 40 |     expr: Expression
 41 |     count := 0
 42 | 
 43 |     /* ~ is a suffix, =expr is an Assign-arg, .token is a Member-arg */
 44 |     init: func ~addressOf (=expr, .token) {
 45 |         super(token)
 46 |     }
 47 | 
 48 |     accept: func (visitor: Visitor) {
 49 |         visitor visitDereference(this)
 50 |     }
 51 | 
 52 |     getType: func -> Type { expr getType() ? expr getType() dereference() : null }
 53 | 
 54 |     toString: func -> String {
 55 |         return expr toString() + "@"
 56 |     }
 57 | 
 58 |     /**
 59 |      * @return Responses OK if the node is resolved now, Responses LOOP otherwise
 60 |      */
 61 |     resolve: func (trail: Trail, res: Resolver) -> Response {
 62 | 
 63 |         trail push(this)
 64 |         {
 65 |             response := expr resolve(trail, res)
 66 |             if(!response ok()) {
 67 |                 trail pop(this)
 68 |                 return response
 69 |             }
 70 |         }
 71 |         trail pop(this)
 72 | 
 73 |         return Responses OK
 74 | 
 75 |     }
 76 | 
 77 |     replace: func (oldie, kiddo: Node) -> Bool {
 78 |         // here the match is used implicitly for the returne xception
 79 |         match oldie {
 80 |             case expr => expr = kiddo; true
 81 |             case      => false
 82 |         }
 83 |     }
 84 | 
 85 | }
 86 | 
 87 | pointerFiddling: func (p: Int*) -> Float* {
 88 |     printf("%d, %d, %d\n", p@, (p+1)@, (p+2)@)
 89 |     // qualifiers are okay in decl-assigns, casting is done with 'as'
 90 |     i := static const 42 as Float
 91 |     return i&
 92 | }
 93 | 
 94 | reference: func (i: Int@) {
 95 |     i = 4
 96 | }
 97 | 
 98 | main: func {
 99 |     Dereference new(expr, token)
100 |     a := 3
101 |     reference(a&)
102 |     "a = %d" format(a) println()
103 | }
104 | 
105 | List: class <T> extends Enumerable<T> {
106 | 
107 |     data: T*
108 | 
109 |     get: func (i: Int) -> T {
110 |         data[i]
111 |     }
112 | 
113 | }
114 | 
115 | "Bye world!" println()
116 | 		
117 | 118 | 119 | -------------------------------------------------------------------------------- /examples/ex.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 |

Syntax: PHP

19 | 20 |
<?php
21 |     $curl = curl_init();
22 |     $options = array(CURLOPT_URL => 'http://api.twitter.com/1/statuses/public_timeline.json', CURLOPT_RETURNTRANSFER => true);            
23 |     curl_setopt_array($curl, $options);
24 |     $json = curl_exec($curl);
25 |     $obj = json_decode($json);
26 |     $val5 = trim($_GET['val5']);
27 |     $val10 = trim($_GET['val10']);
28 |     $val20 = trim($_GET['val20']);
29 |     $count = -1;
30 |     if($val5){$count = 4;} 
31 |     if($val10){$count = 9;}		
32 |     if($val20){$count = 19;}
33 |     if($val1){$count = -1;}
34 |     if($count<0){
35 |     	echo "<img class='twitter-bird' src='twitter-bird.png' width='490px' height='315px' />";
36 |     } else {
37 |     	if($obj){
38 |     		foreach($obj as $var => $value)
39 |     		{    
40 |     			if($var<=$count){
41 |     					echo "<div id='user-tweets-container'>";
42 |     					echo "<a class='a-img' href='http://www.twitter.com/" . $obj[$var]->user->screen_name . "' target='_blank'><img src='" . $obj[$var]->user->profile_image_url . "' width='48px' height='48px'/></a>";
43 |     					echo "<p class='text'><a class='screen_name' href='http://www.twitter.com/" . $obj[$var]->user->screen_name . "' target='_blank'>" . $obj[$var]->user->screen_name . "</a>&nbsp;";        
44 |     					echo $obj[$var]->text . "</p><br/>";        
45 |     					echo "</div>";
46 |     			}
47 |     		}
48 |     	}else{
49 |     		echo "<p class='text'><br>Not able to retrieve Tweets... Please try again later...</p><br/>";        
50 |     	}
51 |     }
52 |     ?>
53 | 54 | -------------------------------------------------------------------------------- /examples/ex.swift.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 |

Syntax: Python

18 | 19 |
//
20 | //  TTKeyboardViewController.swift
21 | //  Truth Tables
22 | //
23 | //  Created by Samuel Williams on 16/10/16.
24 | //  Copyright © 2016 Orion Transfer Ltd. All rights reserved.
25 | //
26 | 
27 | import UIKit
28 | 
29 | class TTKeyboardViewController: UIInputViewController {
30 | 	var nextKeyboardButton : UIButton?
31 | 
32 | 	required init?(coder aDecoder: NSCoder) {
33 | 		super.init(coder: aDecoder)
34 | 	}
35 | 
36 | 	init() {
37 | 		super.init(nibName: "TTKeyboardView", bundle: nil)
38 | 	}
39 | 
40 | 	override func loadView() {
41 | 		super.loadView()
42 | 
43 | 		self.view.translatesAutoresizingMaskIntoConstraints = false
44 | 	}
45 | 
46 | 	override func viewDidLoad() {
47 | 		super.viewDidLoad()
48 | 
49 | 		self.view.backgroundColor = UIColor.init(patternImage: UIImage.init(named: "Background.jpg")!)
50 | 
51 | 		// Perform custom UI setup here
52 | //		self.nextKeyboardButton = UIButton.init(type: .system)
53 | //
54 | //		self.nextKeyboardButton?.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), for: .normal)
55 | //		self.nextKeyboardButton?.sizeToFit()
56 | //		self.nextKeyboardButton?.translatesAutoresizingMaskIntoConstraints = false
57 | //
58 | //		self.nextKeyboardButton?.addTarget(self, action: #selector(self.handleInputModeList(from:with:)), for: .allTouchEvents)
59 | //
60 | //		self.view.addSubview(self.nextKeyboardButton!)
61 | //
62 | //		self.nextKeyboardButton?.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
63 | //		self.nextKeyboardButton?.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
64 | 	}
65 | 
66 | 	@IBAction func inputPressed(_ sender: AnyObject?) {
67 | 		if let button = sender as? UIButton! {
68 | 			if let priorText = self.textDocumentProxy.documentContextBeforeInput {
69 | 				if let lastCharacter = priorText.characters.last {
70 | 					if lastCharacter != " " {
71 | 						self.textDocumentProxy.insertText(" ")
72 | 					}
73 | 				}
74 | 			}
75 | 
76 | 			self.textDocumentProxy.insertText(button.currentTitle!)
77 | 		}
78 | 	}
79 | 
80 | 	@IBAction func deletePressed(_ sender: AnyObject?) {
81 | 		self.textDocumentProxy.deleteBackward()
82 | 	}
83 | 
84 | 	@IBAction func donePressed(_ sender: AnyObject?) {
85 | 		self.textDocumentProxy.insertText("\n")
86 | 	}
87 | }
88 | 
89 | 90 | -------------------------------------------------------------------------------- /examples/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 80%; 3 | font-family: sans-serif; 4 | padding: 1em 3em 1em; 5 | } 6 | 7 | div.title { 8 | text-align: center; 9 | } 10 | 11 | h1 { 12 | background-color: #eee; 13 | border-bottom: 2px solid black; 14 | border-top: 2px solid black; 15 | padding: 10px; 16 | 17 | text-align: center; 18 | } 19 | -------------------------------------------------------------------------------- /examples/tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 62 | 63 | 64 |

jQuery.Syntax Unit Tests

65 |

66 |
67 |

68 |
    69 |
    test markup, will be hidden
    70 | 71 | -------------------------------------------------------------------------------- /examples/wrapping-flex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 36 | 37 | 63 | 64 | 65 |

    sally

    66 |
    			foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar foo = bar
    67 | 			apples = 10
    68 | 
    69 |

    bob

    70 | 71 | -------------------------------------------------------------------------------- /ext/theme.rb: -------------------------------------------------------------------------------- 1 | 2 | class Theme 3 | def initialize(dst_dir, root = nil) 4 | @destination = dst_dir 5 | 6 | @includes = [] 7 | @root = root 8 | 9 | @extends = {} 10 | 11 | @depends = [] 12 | end 13 | 14 | attr :includes 15 | 16 | def load_theme(theme_dir, top = true) 17 | theme_dir = File.join(@root, theme_dir) 18 | theme_name = File.basename(theme_dir) 19 | 20 | master = Dir.glob(File.join(theme_dir, "master.{sass,scss}")) 21 | if master.size > 0 22 | @includes += master 23 | end 24 | 25 | unless File.directory?(theme_dir) 26 | raise StandardError.new("Could not find theme #{theme_dir}!") 27 | end 28 | 29 | $stderr.puts "Loading theme from #{theme_dir}..." 30 | theme_config_path = File.join(theme_dir, "_config.yaml") 31 | config = {} 32 | 33 | # Is there a configuration file? 34 | if File.exist? theme_config_path 35 | config = YAML::load_file(theme_config_path) || {} 36 | end 37 | 38 | # Load any dependencies recursively - if you have bad configuration this might 39 | # give you visions of infinity. 40 | if config['depends'] 41 | @depends += config['depends'] 42 | config['depends'].each {|name| load_theme(name, false)} 43 | end 44 | 45 | # Remove any files/directories that have been excluded 46 | if config['exclude'] 47 | config['exclude'].each do |name| 48 | FileUtils.rm_rf(File.join(@destination, name)) 49 | end 50 | end 51 | 52 | if config['extends'] 53 | config['extends'].each {|name,extension| @extends[name] = extension} 54 | end 55 | 56 | if config['includes'] 57 | @includes.concat(config['includes']) 58 | end 59 | 60 | if top 61 | # Copy all the theme files 62 | $stderr.puts "Copying #{theme_dir + "/*"} to #{@destination.inspect}" 63 | 64 | theme_files = Dir.glob(File.join(theme_dir, "*")) 65 | FileUtils.cp_r(theme_files, @destination) 66 | 67 | File.open(File.join(@destination, "theme.js"), "w") do |theme_js| 68 | theme_js.puts "Syntax.themes[#{theme_name.inspect}] = #{@depends.inspect}" 69 | end 70 | end 71 | end 72 | 73 | def includes_for(path, place) 74 | case place 75 | when :prepend 76 | return @includes 77 | when :append 78 | if extension = @extends[File.basename(path)] 79 | return extension 80 | end 81 | end 82 | 83 | return [] 84 | end 85 | end 86 | -------------------------------------------------------------------------------- /gems.rb: -------------------------------------------------------------------------------- 1 | # A sample Gemfile 2 | source "https://rubygems.org" 3 | 4 | gem "bake" 5 | gem "sass" 6 | 7 | gem "closure-compiler" 8 | 9 | gem "rack" 10 | gem "falcon" 11 | -------------------------------------------------------------------------------- /install.yaml: -------------------------------------------------------------------------------- 1 | # The path to install the code - this directory should NOT contain any other files as they will be erased during the install process. 2 | prefix: "dist" 3 | # The options for the stylesheet generation 4 | themes: 5 | - base 6 | - bright 7 | - paper 8 | # Enable minification 9 | minify: true 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-syntax", 3 | "version": "4.4.0", 4 | "title": "jQuery.Syntax", 5 | "author": { 6 | "name": "Samuel Williams", 7 | "email": "samuel@codeotaku.com", 8 | "url": "https://www.codeotaku.com" 9 | }, 10 | "license": "MIT", 11 | "repository": "https://github.com/ioquatix/jquery-syntax", 12 | "dependencies": { 13 | "jquery": ">=1.4.1" 14 | }, 15 | "description": "jQuery.Syntax is an extremely fast and lightweight syntax highlighter written in JavaScript. It has dynamic loading of syntax source files and integrates cleanly using CSS or modelines.", 16 | "keywords": [ 17 | "syntax", 18 | "highlighting", 19 | "highlighter", 20 | "source", 21 | "code", 22 | "formatting", 23 | "jquery-plugin", 24 | "ecosystem:jquery" 25 | ], 26 | "homepage": "https://github.com/ioquatix/jquery-syntax" 27 | } 28 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # jQuery.Syntax 2 | 3 | jQuery.Syntax is a light-weight client-side syntax highlighter, which dynamically loads external dependencies (JavaScript & CSS) when required. It uses jQuery to make it cross-browser compatible and to simplify integration and integration with other systems. 4 | 5 | ## Motivation 6 | 7 | jQuery.Syntax was built at a time when syntax highlighting on the web was a bit of a mess - browser incompatibilities and limitations made it hard to do the right thing consistently. Rather than a single definition of "good", presenting code nicely in a browser was dictated by a set of trade-offs. 8 | 9 | At the time, syntax highlighters were often all-or-nothing - this made it cumbersome for sites that only had a few pages with code on them. jQuery.Syntax was designed from the ground up to use dynamic loading of assets when required. On top of that, the implementation was built using a profiler and is fairly efficient. 10 | 11 | It's a good library and it's fast, that's why I continue to maintain and develop it. 12 | 13 | ### Isn't jQuery big? 14 | 15 | Your right, small is pretty subjective. 16 | 17 | jQuery as a dependency is based on a design from 2012. When browsers were a bit less "compatible", this was a good trade-off. These days, it could probably be removed, but it isn't worth the effort and for me personally it's a zero-cost dependency since I use it anyway on most of my sites. 18 | 19 | The library is modular and only loads exactly the CSS and JS required. The minimised and gzipped library is 1.6Kbytes, this provide the top-level API and the dynamic loading functionality. 20 | 21 | To highlight anything, you need to load the core parser and renderer code. It's 4.1Kbytes minified and gzipped. The CSS and Script files are tiny, most less < 1Kbyte, per language. 22 | 23 | ### Compared to xyz? 24 | 25 | All syntax highlighters are pretty good these days. But, there are some key differences worth considering: 26 | 27 | - How much does it load by default, even when not highlighting anything? 28 | - How efficient/fast is it when highlighting code? 29 | - How does line wrapping work? 30 | - Can you embed `` and `` elements? 31 | - Can it handle embedded code (e.g. JavaScript inside HTML)? 32 | - Is it easy to install? 33 | - Is it easy to customize? 34 | 35 | ## Installation 36 | 37 | jQuery.Syntax is easily installed using `yarn`. 38 | 39 | $ yarn install jquery-syntax 40 | 41 | It has a `dist/` directory which follows standard conventions. 42 | 43 | ### Advanced Configuration 44 | 45 | jQuery.Syntax compiles and minifies it's code using uses [`bake`](https://github.com/ioquatix/bake) (Ruby) and [Sass](http://sass-lang.com). Please review the included `bake.rb` and `install.yaml` for more details. 46 | 47 | ## Usage 48 | 49 | jQuery.Syntax is typically used to highlight both block code elements and inline code elements. To highlight code, you first need to include several scripts in the `` of your page: 50 | 51 | 52 | 53 | 54 | 55 | 61 | 62 | 63 |
    puts "Hello World"
    64 | 65 | ### Stylesheet Compatibility 66 | 67 | The following stylesheet sets some useful defaults and enables responsive tab-size indentation. 68 | 69 | ```css 70 | html { 71 | font-size: 16px; 72 | 73 | /* Fix odd text-size in `display: flex` elements on Safari iOS */ 74 | text-size-adjust: 100%; 75 | -webkit-text-size-adjust: 100%; 76 | } 77 | 78 | @media (min-width: 40em) { 79 | html { 80 | font-size: 18px; 81 | --tab-size: 4; 82 | } 83 | } 84 | 85 | @media (min-width: 80em) { 86 | html { 87 | font-size: 20px; 88 | --tab-size: 4; 89 | } 90 | } 91 | 92 | pre { 93 | /* -moz-tab-size is still required by Firefox */ 94 | --tab-size: 2; 95 | tab-size: var(--tab-size); 96 | -moz-tab-size: var(--tab-size); 97 | } 98 | ``` 99 | 100 | ## Contributing 101 | 102 | 1. Fork it 103 | 2. Create your feature branch (`git checkout -b my-new-feature`) 104 | 3. Commit your changes (`git commit -am 'Add some feature'`) 105 | 4. Push to the branch (`git push origin my-new-feature`) 106 | 5. Create new Pull Request 107 | 108 | ## License 109 | 110 | Released under the MIT license. 111 | 112 | Copyright, 2011-2020, by [Samuel G. D. Williams](https://www.codeotaku.com/). 113 | 114 | Permission is hereby granted, free of charge, to any person obtaining a copy 115 | of this software and associated documentation files (the "Software"), to deal 116 | in the Software without restriction, including without limitation the rights 117 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 118 | copies of the Software, and to permit persons to whom the Software is 119 | furnished to do so, subject to the following conditions: 120 | 121 | The above copyright notice and this permission notice shall be included in 122 | all copies or substantial portions of the Software. 123 | 124 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 125 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 126 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 127 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 128 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 129 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 130 | THE SOFTWARE. 131 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.apache.js: -------------------------------------------------------------------------------- 1 | // brush: "apache" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('apache', function(brush) { 8 | brush.push({ 9 | pattern: /(<(\w+).*?>)/gi, 10 | matches: Syntax.extractMatches( 11 | { 12 | klass: 'tag', 13 | allow: ['attribute', 'tag-name', 'string'] 14 | }, 15 | { 16 | klass: 'tag-name', 17 | process: Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive", true) 18 | }) 19 | }); 20 | 21 | brush.push({ 22 | pattern: /(<\/(\w+).*?>)/gi, 23 | matches: Syntax.extractMatches({klass: 'tag', allow: ['tag-name']}, {klass: 'tag-name'}) 24 | }); 25 | 26 | brush.push({ 27 | pattern: /^\s+([A-Z][\w]+)/gm, 28 | matches: Syntax.extractMatches({ 29 | klass: 'function', 30 | allow: ['attribute'], 31 | process: Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive", true) 32 | }) 33 | }); 34 | 35 | brush.push(Syntax.lib.perlStyleComment); 36 | brush.push(Syntax.lib.singleQuotedString); 37 | brush.push(Syntax.lib.doubleQuotedString); 38 | 39 | brush.push(Syntax.lib.webLink); 40 | }); 41 | 42 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.assembly.js: -------------------------------------------------------------------------------- 1 | // brush: "assembly" aliases: ["asm"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('assembly', function(brush) { 8 | brush.push(Syntax.lib.cStyleComment); 9 | brush.push(Syntax.lib.cppStyleComment); 10 | 11 | brush.push({pattern: /\.[a-zA-Z_][a-zA-Z0-9_]*/gm, klass: 'directive'}); 12 | 13 | brush.push({pattern: /^[a-zA-Z_][a-zA-Z0-9_]*:/gm, klass: 'label'}); 14 | 15 | brush.push({ 16 | pattern: /^\s*([a-zA-Z]+)/gm, 17 | matches: Syntax.extractMatches({klass: 'function'}) 18 | }); 19 | 20 | brush.push({pattern: /(-[0-9]+)|(\b[0-9]+)|(\$[0-9]+)/g, klass: 'constant'}); 21 | brush.push({pattern: /(\-|\b|\$)(0x[0-9a-f]+|[0-9]+|[a-z0-9_]+)/gi, klass: 'constant'}); 22 | 23 | brush.push({pattern: /%\w+/g, klass: 'register'}); 24 | 25 | // Strings 26 | brush.push(Syntax.lib.singleQuotedString); 27 | brush.push(Syntax.lib.doubleQuotedString); 28 | brush.push(Syntax.lib.stringEscape); 29 | 30 | // Numbers 31 | brush.push(Syntax.lib.decimalNumber); 32 | brush.push(Syntax.lib.hexNumber); 33 | 34 | // Comments 35 | brush.push(Syntax.lib.perlStyleComment); 36 | brush.push(Syntax.lib.webLink); 37 | }); 38 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.bash-script.js: -------------------------------------------------------------------------------- 1 | // brush: "bash-script" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('bash-script', function(brush) { 8 | var operators = ["&&", "|", ";", "{", "}"]; 9 | brush.push(operators, {klass: 'operator'}); 10 | 11 | brush.push({ 12 | pattern: /(?:^|\||;|&&)\s*((?:"([^"]|\\")+"|'([^']|\\')+'|\\\n|.|[ \t])+?)(?=$|\||;|&&)/gmi, 13 | matches: Syntax.extractMatches({brush: 'bash-statement'}) 14 | }); 15 | }); 16 | 17 | Syntax.register('bash-statement', function(brush) { 18 | var keywords = ["break", "case", "continue", "do", "done", "elif", "else", "eq", "fi", "for", "function", "ge", "gt", "if", "in", "le", "lt", "ne", "return", "then", "until", "while"]; 19 | brush.push(keywords, {klass: 'keyword'}); 20 | 21 | var operators = [">", "<", "=", "`", "--", "{", "}", "(", ")", "[", "]"]; 22 | brush.push(operators, {klass: 'operator'}); 23 | 24 | brush.push({ 25 | pattern: /\(\((.*?)\)\)/gmi, 26 | klass: 'expression', 27 | allow: ['variable', 'string', 'operator', 'constant'] 28 | }); 29 | 30 | brush.push({ 31 | pattern: /`([\s\S]+?)`/gmi, 32 | matches: Syntax.extractMatches({brush: 'bash-script', debug: true}) 33 | }); 34 | 35 | brush.push(Syntax.lib.perlStyleComment); 36 | 37 | // Probably need to write a real parser here rather than using regular expressions, it is too fragile 38 | // and misses lots of edge cases (e.g. nested brackets, delimiters). 39 | brush.push({ 40 | pattern: /^\s*((?:\S+?=\$?(?:\[[^\]]+\]|\(\(.*?\)\)|"(?:[^"]|\\")+"|'(?:[^']|\\')+'|\S+)\s*)*)((?:(\\ |\S)+)?)/gmi, 41 | matches: Syntax.extractMatches( 42 | {klass: 'env', allow: ['variable', 'string', 'operator', 'constant', 'expression']}, 43 | {klass: 'function', allow: ['variable', 'string']} 44 | ) 45 | }); 46 | 47 | brush.push({ 48 | pattern: /(\S+?)=/gmi, 49 | matches: Syntax.extractMatches({klass: 'variable'}), 50 | only: ['env'] 51 | }); 52 | 53 | brush.push({ 54 | pattern: /\$\w+/g, 55 | klass: 'variable' 56 | }); 57 | 58 | brush.push({pattern: /\s\-+[\w-]+/g, klass: 'option'}) 59 | 60 | brush.push(Syntax.lib.singleQuotedString); 61 | brush.push(Syntax.lib.doubleQuotedString); 62 | 63 | brush.push(Syntax.lib.decimalNumber); 64 | brush.push(Syntax.lib.hexNumber); 65 | 66 | brush.push(Syntax.lib.webLink); 67 | }); 68 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.bash.js: -------------------------------------------------------------------------------- 1 | // brush: "bash" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.brushes.dependency('bash', 'bash-script'); 8 | 9 | Syntax.register('bash', function(brush) { 10 | brush.push({ 11 | pattern: /^([\w@:~ ]*?[\$|\#])\s+(.*?)$/gm, 12 | matches: Syntax.extractMatches({klass: 'prompt'}, {brush: 'bash-script'}) 13 | }); 14 | 15 | brush.push({ 16 | pattern: /^\-\- .*$/gm, 17 | klass: 'comment', 18 | allow: ['href'] 19 | }); 20 | 21 | // Strings 22 | brush.push(Syntax.lib.singleQuotedString); 23 | brush.push(Syntax.lib.doubleQuotedString); 24 | brush.push(Syntax.lib.stringEscape); 25 | 26 | // Numbers 27 | brush.push(Syntax.lib.webLink); 28 | 29 | brush.push({ 30 | klass: 'stderr', 31 | allow: ['string', 'comment', 'constant', 'href'] 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.basic.js: -------------------------------------------------------------------------------- 1 | // brush: "basic" aliases: ['vb'] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.lib.vbStyleComment = {pattern: /' .*$/gm, klass: 'comment', allow: ['href']}; 8 | 9 | Syntax.register('basic', function(brush) { 10 | var keywords = ["AddHandler", "AddressOf", "Alias", "And", "AndAlso", "Ansi", "As", "Assembly", "Auto", "ByRef", "ByVal", "Call", "Case", "Catch", "Declare", "Default", "Delegate", "Dim", "DirectCast", "Do", "Each", "Else", "ElseIf", "End", "Enum", "Erase", "Error", "Event", "Exit", "Finally", "For", "Function", "Get", "GetType", "GoSub", "GoTo", "Handles", "If", "Implements", "Imports", "In", "Inherits", "Interface", "Is", "Let", "Lib", "Like", "Loop", "Mod", "Module", "MustOverride", "Namespace", "New", "Next", "Not", "On", "Option", "Optional", "Or", "OrElse", "Overloads", "Overridable", "Overrides", "ParamArray", "Preserve", "Property", "RaiseEvent", "ReadOnly", "ReDim", "REM", "RemoveHandler", "Resume", "Return", "Select", "Set", "Static", "Step", "Stop", "Structure", "Sub", "SyncLock", "Then", "Throw", "To", "Try", "TypeOf", "Unicode", "Until", "When", "While", "With", "WithEvents", "WriteOnly", "Xor", "ExternalSource", "Region", "Print", "Class"]; 11 | 12 | var operators = ["-", "&", "&=", "*", "*=", "/", "/=", "\\", "\=", "^", "^=", "+", "+=", "=", "-="]; 13 | 14 | var types = ["CBool", "CByte", "CChar", "CDate", "CDec", "CDbl", "Char", "CInt", "CLng", "CObj", "Const", "CShort", "CSng", "CStr", "CType", "Date", "Decimal", "Variant", "String", "Short", "Long", "Single", "Double", "Object", "Integer", "Boolean", "Byte", "Char"]; 15 | 16 | var operators = ["+", "-", "*", "/", "+=", "-=", "*=", "/=", "=", ":=", "==", "!=", "!", "%", "?", ">", "<", ">=", "<=", "&&", "||", "&", "|", "^", ".", "~", "..", ">>", "<<", ">>>", "<<<", ">>=", "<<=", ">>>=", "<<<=", "%=", "^=", "@"]; 17 | 18 | var values = ["Me", "MyClass", "MyBase", "super", "True", "False", "Nothing", /[A-Z][A-Z0-9_]+/g]; 19 | 20 | var access = ["Public", "Protected", "Private", "Shared", "Friend", "Shadows", "MustInherit", "NotInheritable", "NotOverridable"]; 21 | 22 | brush.push(types, {klass: 'type'}); 23 | brush.push(keywords, {klass: 'keyword', options: 'gi'}); 24 | brush.push(operators, {klass: 'operator'}); 25 | brush.push(access, {klass: 'access'}); 26 | brush.push(values, {klass: 'constant'}); 27 | 28 | brush.push(Syntax.lib.decimalNumber); 29 | 30 | // ClassNames (CamelCase) 31 | brush.push(Syntax.lib.camelCaseType); 32 | 33 | brush.push(Syntax.lib.vbStyleComment); 34 | 35 | brush.push(Syntax.lib.webLink); 36 | 37 | // Strings 38 | brush.push(Syntax.lib.doubleQuotedString); 39 | brush.push(Syntax.lib.stringEscape); 40 | 41 | brush.postprocess = function (options, html, container) { 42 | var queryURI = "http://social.msdn.microsoft.com/Search/en-us?query="; 43 | 44 | jQuery('.function', html).each(function() { 45 | var text = jQuery(this).text(); 46 | jQuery(this).replaceWith(jQuery('
    ').attr('href', queryURI + encodeURIComponent(text)).text(text)); 47 | }); 48 | 49 | return html; 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.clang.js: -------------------------------------------------------------------------------- 1 | // brush: "clang" aliases: ["cpp", "c++", "c", "objective-c"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('clang', function(brush) { 8 | var keywords = ["@interface", "@implementation", "@protocol", "@end", "@try", "@throw", "@catch", "@finally", "@class", "@selector", "@encode", "@synchronized", "@property", "@synthesize", "@dynamic", "struct", "break", "continue", "else", "for", "switch", "case", "default", "enum", "goto", "register", "sizeof", "typedef", "volatile", "do", "extern", "if", "return", "static", "union", "while", "asm", "dynamic_cast", "namespace", "reinterpret_cast", "try", "explicit", "static_cast", "typeid", "catch", "operator", "template", "class", "const_cast", "inline", "throw", "virtual", "IBOutlet"]; 9 | 10 | var access = ["@private", "@protected", "@public", "@required", "@optional", "private", "protected", "public", "friend", "using"]; 11 | 12 | var typeModifiers = ["mutable", "auto", "const", "register", "typename", "abstract"]; 13 | var types = ["double", "float", "int", "short", "char", "long", "signed", "unsigned", "bool", "void", "id"]; 14 | 15 | var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new", "delete", "in"]; 16 | 17 | var values = ["this", "true", "false", "NULL", "YES", "NO", "nil"]; 18 | 19 | brush.push(values, {klass: 'constant'}); 20 | brush.push(typeModifiers, {klass: 'keyword'}) 21 | brush.push(types, {klass: 'type'}); 22 | brush.push(keywords, {klass: 'keyword'}); 23 | brush.push(operators, {klass: 'operator'}); 24 | brush.push(access, {klass: 'access'}); 25 | 26 | // Objective-C properties 27 | brush.push({ 28 | pattern: /@property\((.*)\)[^;]+;/gmi, 29 | klass: 'objective-c-property', 30 | allow: '*' 31 | }); 32 | 33 | var propertyAttributes = ["getter", "setter", "readwrite", "readonly", "assign", "retain", "copy", "nonatomic"]; 34 | 35 | brush.push(propertyAttributes, { 36 | klass: 'keyword', 37 | only: ['objective-c-property'] 38 | }); 39 | 40 | // Objective-C strings 41 | 42 | brush.push({ 43 | pattern: /@(?=")/g, 44 | klass: 'string' 45 | }); 46 | 47 | // Objective-C classes, C++ classes, C types, etc. 48 | brush.push(Syntax.lib.camelCaseType); 49 | brush.push(Syntax.lib.cStyleType); 50 | brush.push({ 51 | pattern: /(?:class|struct|enum|namespace)\s+([^{;\s]+)/gmi, 52 | matches: Syntax.extractMatches({klass: 'type'}) 53 | }); 54 | 55 | brush.push({ 56 | pattern: /#.*$/gmi, 57 | klass: 'preprocessor', 58 | allow: ['string'] 59 | }); 60 | 61 | brush.push(Syntax.lib.cStyleComment); 62 | brush.push(Syntax.lib.cppStyleComment); 63 | brush.push(Syntax.lib.webLink); 64 | 65 | // Objective-C style functions 66 | brush.push({pattern: /\w+:(?=.*(\]|;|\{))(?!:)/g, klass: 'function'}); 67 | 68 | brush.push({ 69 | pattern: /[^:\[]\s+(\w+)(?=\])/g, 70 | matches: Syntax.extractMatches({klass: 'function'}) 71 | }); 72 | 73 | brush.push({ 74 | pattern: /-\s*(\([^\)]+?\))?\s*(\w+)\s*\{/g, 75 | matches: Syntax.extractMatches({index: 2, klass: 'function'}) 76 | }); 77 | 78 | // Strings 79 | brush.push(Syntax.lib.singleQuotedString); 80 | brush.push(Syntax.lib.doubleQuotedString); 81 | brush.push(Syntax.lib.stringEscape); 82 | 83 | // Numbers 84 | brush.push(Syntax.lib.decimalNumber); 85 | brush.push(Syntax.lib.hexNumber); 86 | 87 | brush.push(Syntax.lib.cStyleFunction); 88 | }); 89 | 90 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.csharp.js: -------------------------------------------------------------------------------- 1 | // brush: "csharp" aliases: ["c-sharp", "c#"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('csharp', function(brush) { 8 | var keywords = ["abstract", "add", "alias", "ascending", "base", "break", "case", "catch", "class", "const", "continue", "default", "delegate", "descending", "do", "dynamic", "else", "enum", "event", "explicit", "extern", "finally", "for", "foreach", "from", "get", "global", "goto", "group", "if", "implicit", "in", "interface", "into", "join", "let", "lock", "namespace", "new", "operator", "orderby", "out", "override", "params", "partial", "readonly", "ref", "remove", "return", "sealed", "select", "set", "stackalloc", "static", "struct", "switch", "throw", "try", "unsafe", "using", "value", "var", "virtual", "volatile", "where", "while", "yield"]; 9 | 10 | var access = ["public", "private", "internal", "protected"]; 11 | 12 | var types = ["object", "bool", "byte", "fixed", "float", "uint", "char", "ulong", "ushort", "decimal", "int", "sbyte", "short", "void", "long", "string", "double"]; 13 | 14 | var operators = ["+", "-", "*", "/", "%", "&", "|", "^", "!", "~", "&&", "||", "++", "--", "<<", ">>", "==", "!=", "<", ">", "<=", ">=", "=", "?", "new", "as", "is", "sizeof", "typeof", "checked", "unchecked"]; 15 | 16 | var values = ["this", "true", "false", "null"]; 17 | 18 | brush.push(values, {klass: 'constant'}); 19 | brush.push(types, {klass: 'type'}); 20 | brush.push(keywords, {klass: 'keyword'}); 21 | brush.push(operators, {klass: 'operator'}); 22 | brush.push(access, {klass: 'access'}); 23 | 24 | // Functions 25 | brush.push(Syntax.lib.cStyleFunction); 26 | brush.push({ 27 | pattern: /(?:\.)([a-z_][a-z0-9_]+)/gi, 28 | matches: Syntax.extractMatches({klass: 'function'}) 29 | }); 30 | 31 | // Camel Case Types 32 | brush.push(Syntax.lib.camelCaseType); 33 | 34 | // Comments 35 | brush.push(Syntax.lib.cStyleComment); 36 | brush.push(Syntax.lib.cppStyleComment); 37 | brush.push(Syntax.lib.webLink); 38 | 39 | // Strings 40 | brush.push(Syntax.lib.singleQuotedString); 41 | brush.push(Syntax.lib.doubleQuotedString); 42 | brush.push(Syntax.lib.stringEscape); 43 | 44 | brush.push(Syntax.lib.decimalNumber); 45 | brush.push(Syntax.lib.hexNumber); 46 | }); 47 | 48 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.css.js: -------------------------------------------------------------------------------- 1 | // brush: "css" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('css', function(brush) { 8 | var colorNames = ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenRod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "Darkorange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"]; 9 | 10 | var colorPatterns = ["#[0-9a-f]{3,6}", "rgba?\\(.+?\\)", "hsla?\\(.+?\\)"]; 11 | 12 | var colorMatcher = [].concat( 13 | jQuery.map(colorNames, function(pattern) { 14 | return "(" + Syntax.Brush.convertStringToTokenPattern(pattern, true) + ")"; 15 | }), 16 | jQuery.map(colorPatterns, function(pattern) { 17 | return "(" + Syntax.Brush.convertStringToTokenPattern(pattern, false) + ")"; 18 | }) 19 | ); 20 | 21 | brush.push({ 22 | pattern: /\(.*?\)/g, 23 | allow: '*', 24 | disallow: ['property'] 25 | }); 26 | 27 | brush.push({ 28 | pattern: /\s*([\:\.\[\]\"\'\=\s\w#\.\-,]+)\s+\{/gm, 29 | matches: Syntax.extractMatches({klass: 'selector', allow: ['string']}) 30 | }); 31 | 32 | brush.push({ 33 | pattern: new RegExp(colorMatcher.join("|"), "gi"), 34 | klass: 'color', 35 | process: function (element, match) { 36 | var text = Syntax.innerText(element); 37 | var colourBox = document.createElement('span'); 38 | colourBox.className = 'colour-box'; 39 | 40 | var sampleColour = document.createElement('span'); 41 | sampleColour.className = 'sample'; 42 | sampleColour.style.backgroundColor = text; 43 | sampleColour.appendChild(document.createTextNode(' ')) 44 | colourBox.appendChild(sampleColour); 45 | 46 | element.appendChild(colourBox); 47 | return element; 48 | } 49 | }); 50 | 51 | brush.push(Syntax.lib.cStyleComment); 52 | brush.push(Syntax.lib.webLink); 53 | 54 | brush.push({ 55 | pattern: /\{(.|\n)*?\}/g, 56 | klass: 'properties', 57 | allow: '*' 58 | }); 59 | 60 | brush.push({ 61 | pattern: /\:(.*?(?=\})|(.|\n)*?(?=(\}|\;)))/g, 62 | matches: Syntax.extractMatches({klass: 'value', allow: ['color'], only: ['properties']}) 63 | }); 64 | 65 | brush.push({ 66 | pattern: /([\-\w]+):/g, 67 | matches: Syntax.extractMatches({ 68 | klass: 'property', 69 | process: Syntax.lib.webLinkProcess("http://cssdocs.org/") 70 | }) 71 | }); 72 | 73 | // Strings 74 | brush.push(Syntax.lib.singleQuotedString); 75 | brush.push(Syntax.lib.doubleQuotedString); 76 | brush.push(Syntax.lib.stringEscape); 77 | 78 | brush.push(Syntax.lib.cStyleFunction); 79 | }); 80 | 81 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.diff.js: -------------------------------------------------------------------------------- 1 | // brush: "diff" aliases: ["patch"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('diff', function(brush) { 8 | brush.push({pattern: /^\+\+\+.*$/gm, klass: 'add'}); 9 | brush.push({pattern: /^\-\-\-.*$/gm, klass: 'del'}); 10 | 11 | brush.push({pattern: /^@@.*@@/gm, klass: 'offset'}); 12 | 13 | brush.push({pattern: /^\+[^\+]{1}.*$/gm, klass: 'insert'}); 14 | brush.push({pattern: /^\-[^\-]{1}.*$/gm, klass: 'remove'}); 15 | 16 | brush.postprocess = function (options, html, container) { 17 | $('.insert', html).closest('.source').addClass('insert-line'); 18 | $('.remove', html).closest('.source').addClass('remove-line'); 19 | $('.offset', html).closest('.source').addClass('offset-line'); 20 | 21 | return html; 22 | }; 23 | }); 24 | 25 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.go.js: -------------------------------------------------------------------------------- 1 | // brush: "go" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('go', function(brush) { 8 | var keywords = ["break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var"]; 9 | 10 | var types = [ 11 | /u?int\d*/g, 12 | /float\d+/g, 13 | /complex\d+/g, 14 | "byte", 15 | "uintptr", 16 | "string" 17 | ]; 18 | 19 | var operators = ["+", "&", "+=", "&=", "&&", "==", "!=", "-", "|", "-=", "|=", "||", "<", "<=", "*", "^", "*=", "^=", "<-", ">", ">=", "/", "<<", "/=", "<<=", "++", "=", ":=", ",", ";", "%", ">>", "%=", ">>=", "--", "!", "...", ".", ":", "&^", "&^="]; 20 | 21 | var values = ["true", "false", "iota", "nil"]; 22 | 23 | var functions = ["append", "cap", "close", "complex", "copy", "imag", "len", "make", "new", "panic", "print", "println", "real", "recover"]; 24 | 25 | brush.push(values, {klass: 'constant'}); 26 | brush.push(types, {klass: 'type'}); 27 | brush.push(keywords, {klass: 'keyword'}); 28 | brush.push(operators, {klass: 'operator'}); 29 | brush.push(functions, {klass: 'function'}); 30 | 31 | brush.push(Syntax.lib.cStyleFunction); 32 | 33 | brush.push(Syntax.lib.camelCaseType); 34 | 35 | brush.push(Syntax.lib.cStyleComment); 36 | brush.push(Syntax.lib.cppStyleComment); 37 | brush.push(Syntax.lib.webLink); 38 | 39 | // Strings 40 | brush.push(Syntax.lib.singleQuotedString); 41 | brush.push(Syntax.lib.doubleQuotedString); 42 | brush.push(Syntax.lib.stringEscape); 43 | 44 | // Numbers 45 | brush.push(Syntax.lib.decimalNumber); 46 | brush.push(Syntax.lib.hexNumber); 47 | }); 48 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.haskell.js: -------------------------------------------------------------------------------- 1 | // brush: "haskell" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('haskell', function(brush) { 8 | var keywords = ["as", "case", "of", "class", "data", "data family", "data instance", "default", "deriving", "deriving instance", "do", "forall", "foreign", "hiding", "if", "then", "else", "import", "infix", "infixl", "infixr", "instance", "let", "in", "mdo", "module", "newtype", "proc", "qualified", "rec", "type", "type family", "type instance", "where"]; 9 | 10 | var operators = ["`", "|", "\\", "-", "-<", "-<<", "->", "*", "?", "??", "#", "<-", "@", "!", "::", "_", "~", ">", ";", "{", "}"]; 11 | 12 | var values = ["True", "False"]; 13 | 14 | brush.push(values, {klass: 'constant'}); 15 | brush.push(keywords, {klass: 'keyword'}); 16 | brush.push(operators, {klass: 'operator'}); 17 | 18 | // Camelcase Types 19 | brush.push(Syntax.lib.camelCaseType); 20 | 21 | // Comments 22 | brush.push({ 23 | pattern: /\-\-.*$/gm, 24 | klass: 'comment', 25 | allow: ['href'] 26 | }); 27 | 28 | brush.push({ 29 | pattern: /\{\-[\s\S]*?\-\}/gm, 30 | klass: 'comment', 31 | allow: ['href'] 32 | }); 33 | 34 | brush.push(Syntax.lib.webLink); 35 | 36 | // Numbers 37 | brush.push(Syntax.lib.decimalNumber); 38 | brush.push(Syntax.lib.hexNumber); 39 | 40 | // Strings 41 | brush.push(Syntax.lib.singleQuotedString); 42 | brush.push(Syntax.lib.doubleQuotedString); 43 | brush.push(Syntax.lib.stringEscape); 44 | }); 45 | 46 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.html.js: -------------------------------------------------------------------------------- 1 | // brush: "html" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.brushes.dependency('html', 'xml'); 8 | Syntax.brushes.dependency('html', 'javascript'); 9 | Syntax.brushes.dependency('html', 'css'); 10 | Syntax.brushes.dependency('html', 'php-script'); 11 | Syntax.brushes.dependency('html', 'ruby'); 12 | 13 | Syntax.register('html', function(brush) { 14 | brush.push({ 15 | pattern: /((.|\n)*?)<\/script>/gmi, 16 | matches: Syntax.extractMatches({brush: 'javascript'}) 17 | }); 18 | 19 | brush.push({ 20 | pattern: /((.|\n)*?)<\/style>/gmi, 21 | matches: Syntax.extractMatches({brush: 'css'}) 22 | }); 23 | 24 | brush.push({ 25 | pattern: /((<\?php)([\s\S]*?)(\?>))/gm, 26 | matches: Syntax.extractMatches( 27 | {klass: 'php-tag', allow: ['keyword', 'php-script']}, 28 | {klass: 'keyword'}, 29 | {brush: 'php-script'}, 30 | {klass: 'keyword'} 31 | ) 32 | }); 33 | 34 | brush.push({ 35 | pattern: /((<\?rb?)([\s\S]*?)(\?>))/gm, 36 | matches: Syntax.extractMatches( 37 | {klass: 'ruby-tag', allow: ['keyword', 'ruby']}, 38 | {klass: 'keyword'}, 39 | {brush: 'ruby'}, 40 | {klass: 'keyword'} 41 | ) 42 | }); 43 | 44 | brush.push({ 45 | pattern: /<%=?(.*?)(%>)/g, 46 | klass: 'instruction', 47 | allow: ['string'] 48 | }); 49 | 50 | brush.push({ 51 | pattern: /<\!(DOCTYPE(.*?))>/g, 52 | matches: Syntax.extractMatches({klass: 'doctype'}) 53 | }); 54 | 55 | // Is this rule still relevant? 56 | brush.push({ 57 | pattern: /(%[0-9a-f]{2})/gi, 58 | klass: 'percent-escape', 59 | only: ['html'] 60 | }); 61 | 62 | // The position of this statement is important - it determines at what point the rules of the parent are processed. 63 | // In this case, the rules for xml are processed after the rules for html. 64 | brush.derives('xml'); 65 | }); 66 | 67 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.io.js: -------------------------------------------------------------------------------- 1 | // brush: "io" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('io', function(brush) { 8 | brush.push(Syntax.lib.cStyleFunction); 9 | 10 | var keywords = ["return"]; 11 | 12 | var operators = ["::=", ":=", "or", "and", "@", "+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new", "delete"]; 13 | 14 | brush.push(keywords, {klass: 'keywords'}); 15 | brush.push(operators, {klass: 'operator'}); 16 | 17 | // Extract space delimited method invocations 18 | brush.push({ 19 | pattern: /\b([ \t]+([a-z]+))/gi, 20 | matches: Syntax.extractMatches({index: 2, klass: 'function'}) 21 | }); 22 | 23 | brush.push({ 24 | pattern: /\)([ \t]+([a-z]+))/gi, 25 | matches: Syntax.extractMatches({index: 2, klass: 'function'}) 26 | }); 27 | 28 | // Objective-C classes 29 | brush.push(Syntax.lib.camelCaseType); 30 | 31 | brush.push(Syntax.lib.perlStyleComment); 32 | brush.push(Syntax.lib.cStyleComment); 33 | brush.push(Syntax.lib.cppStyleComment); 34 | brush.push(Syntax.lib.webLink); 35 | 36 | // Strings 37 | brush.push(Syntax.lib.singleQuotedString); 38 | brush.push(Syntax.lib.doubleQuotedString); 39 | brush.push(Syntax.lib.stringEscape); 40 | 41 | // Numbers 42 | brush.push(Syntax.lib.decimalNumber); 43 | brush.push(Syntax.lib.hexNumber); 44 | }); 45 | 46 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.java.js: -------------------------------------------------------------------------------- 1 | // brush: "java" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('java', function(brush) { 8 | var keywords = ["abstract", "continue", "for", "switch", "assert", "default", "goto", "synchronized", "do", "if", "break", "implements", "throw", "else", "import", "throws", "case", "enum", "return", "transient", "catch", "extends", "try", "final", "interface", "static", "class", "finally", "strictfp", "volatile", "const", "native", "super", "while"]; 9 | 10 | var access = ["private", "protected", "public", "package"]; 11 | 12 | var types = ["void", "byte", "short", "int", "long", "float", "double", "boolean", "char"]; 13 | 14 | var operators = ["++", "--", "++", "--", "+", "-", "~", "!", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", ">", "<=", ">=", "==", "!=", "&", "^", "|", "&&", "||", "?", "=", "+=", "-=", "*=", "/=", "%=", "&=", "^=", "|=", "<<=", ">>=", ">>>=", "instanceof", "new", "delete"]; 15 | 16 | var constants = ["this", "true", "false", "null"]; 17 | 18 | brush.push(constants, {klass: 'constant'}); 19 | brush.push(types, {klass: 'type'}); 20 | brush.push(keywords, {klass: 'keyword'}); 21 | brush.push(operators, {klass: 'operator'}); 22 | brush.push(access, {klass: 'access'}); 23 | 24 | // Camel Case Types 25 | brush.push(Syntax.lib.camelCaseType); 26 | 27 | // Comments 28 | brush.push(Syntax.lib.cStyleComment); 29 | brush.push(Syntax.lib.cppStyleComment); 30 | brush.push(Syntax.lib.webLink); 31 | 32 | // Numbers 33 | brush.push(Syntax.lib.decimalNumber); 34 | brush.push(Syntax.lib.hexNumber); 35 | 36 | // Strings 37 | brush.push(Syntax.lib.singleQuotedString); 38 | brush.push(Syntax.lib.doubleQuotedString); 39 | brush.push(Syntax.lib.stringEscape); 40 | 41 | brush.push(Syntax.lib.cStyleFunction); 42 | 43 | brush.processes['function'] = Syntax.lib.webLinkProcess('java "Developer Documentation"', true); 44 | }); 45 | 46 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.javascript.js: -------------------------------------------------------------------------------- 1 | // brush: "javascript" aliases: ["js", "actionscript"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2019 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('javascript', function(brush) { 8 | var keywords = ["async", "await", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "export", "extends", "finally", "for", "function", "if", "import", "in", "instanceof", "let", "new", "return", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "yield"]; 9 | 10 | var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"]; 11 | var values = ["this", "true", "false", "null"]; 12 | 13 | var access = ["implements", "package", "protected", "interface", "private", "public"]; 14 | 15 | brush.push(values, {klass: 'constant'}); 16 | brush.push(keywords, {klass: 'keyword'}); 17 | brush.push(operators, {klass: 'operator'}); 18 | brush.push(access, {klass: 'access'}); 19 | 20 | // Regular expressions 21 | brush.push(Syntax.lib.perlStyleRegularExpression); 22 | 23 | // Camel Case Types 24 | brush.push(Syntax.lib.camelCaseType); 25 | 26 | // Comments 27 | brush.push(Syntax.lib.cStyleComment); 28 | brush.push(Syntax.lib.cppStyleComment); 29 | brush.push(Syntax.lib.webLink); 30 | 31 | // Strings 32 | brush.push(Syntax.lib.singleQuotedString); 33 | brush.push(Syntax.lib.doubleQuotedString); 34 | brush.push(Syntax.lib.stringEscape); 35 | 36 | // Numbers 37 | brush.push(Syntax.lib.decimalNumber); 38 | brush.push(Syntax.lib.hexNumber); 39 | 40 | // Functions 41 | brush.push(Syntax.lib.cStyleFunction); 42 | }); 43 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.kai.js: -------------------------------------------------------------------------------- 1 | // brush: "kai" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('kai', function(brush) { 8 | brush.push(['(', ')', '[', ']', '{', '}'], {klass: 'operator'}); 9 | 10 | brush.push(Syntax.lib.perlStyleComment); 11 | 12 | brush.push(Syntax.lib.decimalNumber); 13 | brush.push(Syntax.lib.webLink); 14 | 15 | brush.push({ 16 | pattern: /\(([^\s\(\)]+)/gi, 17 | matches: Syntax.extractMatches({klass: 'function'}) 18 | }); 19 | 20 | brush.push({ 21 | pattern: /`[a-z]*/gi, 22 | klass: 'constant' 23 | }) 24 | 25 | // Strings 26 | brush.push(Syntax.lib.multiLineDoubleQuotedString); 27 | brush.push(Syntax.lib.stringEscape); 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.lisp.js: -------------------------------------------------------------------------------- 1 | // brush: "lisp" aliases: ['scheme', 'clojure'] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.lib.lispStyleComment = {pattern: /(;+) .*$/gm, klass: 'comment', allow: ['href']}; 8 | 9 | // This syntax is intentionally very sparse. This is because it is a general syntax for Lisp like languages. 10 | // It might be a good idea to make specific dialects (e.g. common lisp, scheme, clojure, etc) 11 | Syntax.register('lisp', function(brush) { 12 | brush.push(['(', ')'], {klass: 'operator'}); 13 | 14 | brush.push(Syntax.lib.lispStyleComment); 15 | 16 | brush.push(Syntax.lib.hexNumber); 17 | brush.push(Syntax.lib.decimalNumber); 18 | brush.push(Syntax.lib.webLink); 19 | 20 | brush.push({ 21 | pattern: /\(\s*([^\s\(\)]+)/gmi, 22 | matches: Syntax.extractMatches({klass: 'function'}) 23 | }); 24 | 25 | brush.push({ 26 | pattern: /#[a-z]+/gi, 27 | klass: 'constant' 28 | }) 29 | 30 | // Strings 31 | brush.push(Syntax.lib.multiLineDoubleQuotedString); 32 | brush.push(Syntax.lib.stringEscape); 33 | }); 34 | 35 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.lua.js: -------------------------------------------------------------------------------- 1 | // brush: "lua" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('lua', function(brush) { 8 | var keywords = ["and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while"]; 9 | 10 | var operators = ["+", "-", "*", "/", "%", "^", "#", "..", "=", "==", "~=", "<", ">", "<=", ">=", "?", ":"]; 11 | 12 | var values = ["self", "true", "false", "nil"]; 13 | 14 | brush.push(values, {klass: 'constant'}); 15 | brush.push(keywords, {klass: 'keyword'}); 16 | brush.push(operators, {klass: 'operator'}); 17 | 18 | // Camelcase Types 19 | brush.push(Syntax.lib.camelCaseType); 20 | brush.push(Syntax.lib.cStyleFunction); 21 | 22 | brush.push({ 23 | pattern: /\-\-.*$/gm, 24 | klass: 'comment', 25 | allow: ['href'] 26 | }); 27 | 28 | brush.push({ 29 | pattern: /\-\-\[\[(\n|.)*?\]\]\-\-/gm, 30 | klass: 'comment', 31 | allow: ['href'] 32 | }); 33 | 34 | // Strings 35 | brush.push(Syntax.lib.singleQuotedString); 36 | brush.push(Syntax.lib.doubleQuotedString); 37 | brush.push(Syntax.lib.stringEscape); 38 | 39 | brush.push(Syntax.lib.hexNumber); 40 | brush.push(Syntax.lib.decimalNumber); 41 | 42 | brush.push(Syntax.lib.webLink); 43 | }); 44 | 45 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.nginx.js: -------------------------------------------------------------------------------- 1 | // brush: "nginx" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('nginx', function(brush) { 8 | brush.push({ 9 | pattern: /((\w+).*?);/g, 10 | matches: Syntax.extractMatches( 11 | {klass: 'directive', allow: '*'}, 12 | {klass: 'function', process: Syntax.lib.webLinkProcess("http://nginx.org/r/")} 13 | ) 14 | }); 15 | 16 | brush.push({ 17 | pattern: /(\w+).*?{/g, 18 | matches: Syntax.extractMatches( 19 | {klass: 'keyword'} 20 | ) 21 | }); 22 | 23 | brush.push({pattern: /(\$)[\w]+/g, klass: 'variable'}); 24 | 25 | brush.push(Syntax.lib.perlStyleComment); 26 | brush.push(Syntax.lib.singleQuotedString); 27 | brush.push(Syntax.lib.doubleQuotedString); 28 | 29 | brush.push(Syntax.lib.webLink); 30 | }); 31 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.ocaml.js: -------------------------------------------------------------------------------- 1 | // brush: "ocaml" aliases: ["ml", "sml", "fsharp"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | // This brush is based loosely on the following documentation: 8 | // http://msdn.microsoft.com/en-us/library/dd233230.aspx 9 | 10 | Syntax.register('ocaml', function(brush) { 11 | var keywords = ["abstract", "and", "as", "assert", "begin", "class", "default", "delegate", "do", "done", "downcast", "downto", "elif", "else", "end", "exception", "extern", "finally", "for", "fun", "function", "if", "in", "inherit", "inline", "interface", "internal", "lazy", "let", "match", "member", "module", "mutable", "namespace", "new", "null", "of", "open", "or", "override", "rec", "return", "static", "struct", "then", "to", "try", "type", "upcast", "use", "val", "when", "while", "with", "yield", "asr", "land", "lor", "lsl", "lsr", "lxor", "mod", "sig", "atomic", "break", "checked", "component", "const", "constraint", "constructor", "continue", "eager", "event", "external", "fixed", "functor", "global", "include", "method", "mixin", "object", "parallel", "process", "protected", "pure", "sealed", "trait", "virtual", "volatile", "val"]; 12 | 13 | var types = ["bool", "byte", "sbyte", /\bu?int\d*\b/g, "nativeint", "unativeint", "char", "string", "decimal", "unit", "void", "float32", "single", "float64", "double", "list", "array", "exn", "format", "fun", "option", "ref"]; 14 | 15 | var operators = ["!", "<>", "%", "&", "*", "+", "-", "->", "/", "::", ":=", ":>", ":?", ":?>", "<", "=", ">", "?", "@", "^", "_", "`", "|", "~", "'", "[<", ">]", "<|", "|>", "[|", "|]", "(|", "|)", "(*", "*)", "in"]; 16 | 17 | var values = ["true", "false"]; 18 | 19 | var access = ["private", "public"]; 20 | 21 | brush.push(access, {klass: 'access'}); 22 | brush.push(values, {klass: 'constant'}); 23 | brush.push(types, {klass: 'type'}); 24 | brush.push(keywords, {klass: 'keyword'}); 25 | brush.push(operators, {klass: 'operator'}); 26 | 27 | // http://caml.inria.fr/pub/docs/manual-ocaml/manual011.html#module-path 28 | // open [module-path], new [type] 29 | brush.push({ 30 | pattern: /(?:open|new)\s+((?:\.?[a-z][a-z0-9]*)+)/gi, 31 | matches: Syntax.extractMatches({klass: 'type'}) 32 | }); 33 | 34 | // Functions 35 | brush.push({ 36 | pattern: /(?:\.)([a-z_][a-z0-9_]+)/gi, 37 | matches: Syntax.extractMatches({klass: 'function'}) 38 | }); 39 | 40 | // Avoid highlighting keyword arguments as camel-case types. 41 | brush.push({ 42 | pattern: /(?:\(|,)\s*(\w+\s*=)/g, 43 | matches: Syntax.extractMatches({ 44 | klass: 'keyword-argument' 45 | }) 46 | }); 47 | 48 | // We need to modify cStyleFunction because "(*" is a comment token. 49 | brush.push({ 50 | pattern: /([a-z_][a-z0-9_]*)\s*\((?!\*)/gi, 51 | matches: Syntax.extractMatches({klass: 'function'}) 52 | }); 53 | 54 | // Types 55 | brush.push(Syntax.lib.camelCaseType); 56 | 57 | // Web Links 58 | brush.push(Syntax.lib.webLink); 59 | 60 | // Comments 61 | brush.push({ 62 | pattern: /\(\*[\s\S]*?\*\)/g, 63 | klass: 'comment' 64 | }); 65 | 66 | // Strings 67 | brush.push(Syntax.lib.doubleQuotedString); 68 | brush.push(Syntax.lib.stringEscape); 69 | 70 | // Numbers 71 | brush.push(Syntax.lib.decimalNumber); 72 | brush.push(Syntax.lib.hexNumber); 73 | }); 74 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.ooc.js: -------------------------------------------------------------------------------- 1 | // brush: "ooc" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('ooc', function(brush) { 8 | var keywords = ["class", "interface", "implement", "abstract", "extends", "from", "const", "final", "static", "import", "use", "extern", "inline", "proto", "break", "continue", "fallthrough", "operator", "if", "else", "for", "while", "do", "switch", "case", "as", "in", "version", "return", "include", "cover", "func"]; 9 | 10 | var types = ["Int", "Int8", "Int16", "Int32", "Int64", "Int80", "Int128", "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "UInt80", "UInt128", "Octet", "Short", "UShort", "Long", "ULong", "LLong", "ULLong", "Float", "Double", "LDouble", "Float32", "Float64", "Float128", "Char", "UChar", "WChar", "String", "Void", "Pointer", "Bool", "SizeT", "This"]; 11 | 12 | var operators = ["+", "-", "*", "/", "+=", "-=", "*=", "/=", "=", ":=", "==", "!=", "!", "%", "?", ">", "<", ">=", "<=", "&&", "||", "&", "|", "^", ".", "~", "..", ">>", "<<", ">>>", "<<<", ">>=", "<<=", ">>>=", "<<<=", "%=", "^=", "@"]; 13 | 14 | var values = ["this", "super", "true", "false", "null", /[A-Z][A-Z0-9_]+/g]; 15 | 16 | brush.push(values, {klass: 'constant'}); 17 | brush.push(types, {klass: 'type'}); 18 | brush.push(keywords, {klass: 'keyword'}); 19 | brush.push(operators, {klass: 'operator'}); 20 | 21 | // Hex, Octal and Binary numbers :) 22 | brush.push({ 23 | pattern: /0[xcb][0-9a-fA-F]+/g, 24 | klass: 'constant' 25 | }); 26 | 27 | brush.push(Syntax.lib.decimalNumber); 28 | 29 | // ClassNames (CamelCase) 30 | brush.push(Syntax.lib.camelCaseType); 31 | brush.push(Syntax.lib.cStyleType); 32 | brush.push(Syntax.lib.cStyleFunction); 33 | 34 | brush.push(Syntax.lib.cStyleComment); 35 | brush.push(Syntax.lib.cppStyleComment); 36 | 37 | brush.push(Syntax.lib.webLink); 38 | 39 | // Strings 40 | brush.push(Syntax.lib.singleQuotedString); 41 | brush.push(Syntax.lib.doubleQuotedString); 42 | brush.push(Syntax.lib.stringEscape); 43 | 44 | brush.processes['function'] = Syntax.lib.webLinkProcess("http://docs.ooc-lang.org/search.html?q="); 45 | }); 46 | 47 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.pascal.js: -------------------------------------------------------------------------------- 1 | // brush: "pascal" aliases: ["delphi"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | // 7 | // Constructed using information from http://pascal.comsci.us/etymology/ 8 | // 9 | 10 | Syntax.register('pascal', function(brush) { 11 | var keywords = ["absolute", "abstract", "all", "and_then", "as", "asm", "asmname", "attribute", "begin", "bindable", "c", "c_language", "case", "class", "const", "constructor", "destructor", "dispose", "do", "downto", "else", "end", "except", "exit", "export", "exports", "external", "far", "file", "finalization", "finally", "for", "forward", "function", "goto", "if", "implementation", "import", "inherited", "initialization", "inline", "interface", "interrupt", "is", "keywords", "label", "library", "module", "name", "near", "new", "object", "of", "on", "only", "operator", "or_else", "otherwise", "packed", "pascal", "pow", "private", "procedure", "program", "property", "protected", "public", "published", "qualified", "raise", "record", "repeat", "resident", "restricted", "segment", "set", "then", "threadvar", "to", "try", "type", "unit", "until", "uses", "value", "var", "view", "virtual", "while", "with"]; 12 | 13 | var operators = ["+", "-", "*", "/", "div", "mod", "and", "or", "xor", "shl", "shr", "not", "=", ">=", ">", "<>", "<=", "<", "in", ":="]; 14 | 15 | var values = ["true", "false", "nil"]; 16 | 17 | // Keywords are case insensitive 18 | brush.push(values, {klass: 'constant', options: 'gi'}); 19 | brush.push(keywords, {klass: 'keyword', options: 'gi'}); 20 | brush.push(operators, {klass: 'operator', options: 'gi'}); 21 | 22 | brush.push(Syntax.lib.camelCaseType); 23 | 24 | // Pascal style comments 25 | brush.push({ 26 | pattern: /\{[\s\S]*?\}/gm, 27 | klass: 'comment', 28 | allow: ['href'] 29 | }); 30 | 31 | brush.push({ 32 | pattern: /\(\*[\s\S]*?\*\)/gm, 33 | klass: 'comment', 34 | allow: ['href'] 35 | }); 36 | 37 | brush.push(Syntax.lib.webLink); 38 | 39 | // Strings 40 | brush.push(Syntax.lib.singleQuotedString); 41 | brush.push(Syntax.lib.doubleQuotedString); 42 | brush.push(Syntax.lib.stringEscape); 43 | 44 | // Numbers 45 | brush.push(Syntax.lib.decimalNumber); 46 | brush.push(Syntax.lib.hexNumber); 47 | 48 | // Functions 49 | brush.push(Syntax.lib.cStyleFunction); 50 | }); 51 | 52 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.perl5.js: -------------------------------------------------------------------------------- 1 | // brush: "perl5" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('perl5', function(brush) { 8 | var builtins = ["abs", "accept", "alarm", "atan2", "bind", "binmode", "chdir", "chmod", "chomp", "chop", "chown", "chr", "chroot", "close", "closedir", "connect", "cos", "crypt", "defined", "delete", "each", "endgrent", "endhostent", "endnetent", "endprotoent", "endpwent", "endservent", "eof", "exec", "exists", "exp", "fcntl", "fileno", "flock", "fork", "format", "formline", "getc", "getgrent", "getgrgid", "getgrnam", "gethostbyaddr", "gethostbyname", "gethostent", "getlogin", "getnetbyaddr", "getnetbyname", "getnetent", "getpeername", "getpgrp", "getppid", "getpriority", "getprotobyname", "getprotobynumber", "getprotoent", "getpwent", "getpwnam", "getpwuid", "getservbyname", "getservbyport", "getservent", "getsockname", "getsockopt", "glob", "gmtime", "grep", "hex", "index", "int", "ioctl", "join", "keys", "kill", "lc", "lcfirst", "length", "link", "listen", "localtime", "lock", "log", "lstat", "map", "mkdir", "msgctl", "msgget", "msgrcv", "msgsnd", "oct", "open", "opendir", "ord", "pack", "pipe", "pop", "pos", "print", "printf", "prototype", "push", "quotemeta", "rand", "read", "readdir", "readline", "readlink", "readpipe", "recv", "rename", "reset", "reverse", "rewinddir", "rindex", "rmdir", "scalar", "seek", "seekdir", "select", "semctl", "semget", "semop", "send", "setgrent", "sethostent", "setnetent", "setpgrp", "setpriority", "setprotoent", "setpwent", "setservent", "setsockopt", "shift", "shmctl", "shmget", "shmread", "shmwrite", "shutdown", "sin", "sleep", "socket", "socketpair", "sort", "splice", "split", "sprintf", "sqrt", "srand", "stat", "study", "substr", "symlink", "syscall", "sysopen", "sysread", "sysseek", "system", "syswrite", "tell", "telldir", "time", "times", "tr", "truncate", "uc", "ucfirst", "umask", "undef", "unlink", "unpack", "unshift", "utime", "values", "vec", "wait", "waitpid", "warn", "write"]; 9 | 10 | var keywords = ["bless", "caller", "continue", "die", "do", "dump", "else", "elsif", "eval", "exit", "for", "foreach", "goto", "if", "import", "last", "local", "my", "next", "no", "our", "package", "redo", "ref", "require", "return", "sub", "tie", "tied", "unless", "untie", "until", "use", "wantarray", "while"]; 11 | 12 | var operators = ["->", "++", "--", "**", "!", "~", "\\", "+", "-", "=~", "!~", "*", "/", "%", "x", "+", "-", ".", "<<", ">>", "<", ">", "<=", ">=", "lt", "gt", "le", "ge", "==", "!=", "<=>", "eq", "ne", "cmp", "~~", "&", "|", "^", "&&", "||", "//", "..", "...", "?:", "=", ",", "=>", "not", "and", "or", "xor"]; 13 | 14 | var values = ["this", "true", "false"]; 15 | 16 | brush.push(values, {klass: 'constant'}); 17 | brush.push(keywords, {klass: 'keyword'}); 18 | brush.push(operators, {klass: 'operator'}); 19 | brush.push(builtins, {klass: 'function'}); 20 | 21 | // Regular expressions 22 | brush.push(Syntax.lib.perlStyleRegularExpression); 23 | 24 | // Comments 25 | brush.push(Syntax.lib.perlStyleComment); 26 | brush.push(Syntax.lib.webLink); 27 | 28 | // Variables 29 | brush.push({ 30 | pattern: /(\$|@|%)\w+/gi, 31 | klass: 'variable' 32 | }); 33 | 34 | // Enddoc 35 | brush.push({ 36 | pattern: /__END__[\s\S]*/gm, 37 | klass: 'comment' 38 | }); 39 | 40 | // Strings 41 | brush.push(Syntax.lib.singleQuotedString); 42 | brush.push(Syntax.lib.doubleQuotedString); 43 | brush.push(Syntax.lib.stringEscape); 44 | 45 | // Numbers 46 | brush.push(Syntax.lib.decimalNumber); 47 | brush.push(Syntax.lib.hexNumber); 48 | 49 | // Functions 50 | brush.push(Syntax.lib.cStyleFunction); 51 | }); 52 | 53 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.php-script.js: -------------------------------------------------------------------------------- 1 | // brush: "php-script" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('php-script', function(brush) { 8 | var keywords = ["abstract", "and", "as", "break", "case", "cfunction", "class", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "extends", "extends", "for", "foreach", "function", "global", "if", "implements", "include", "include_once", "interface", "old_function", "or", "require", "require_once", "return", "static", "switch", "throw", "use", "var", "while", "xor"]; 9 | 10 | var access = ["private", "protected", "public"]; 11 | 12 | var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new"]; 13 | 14 | var values = ["this", "true", "false"]; 15 | 16 | brush.push(values, {klass: 'constant'}); 17 | brush.push(keywords, {klass: 'keyword'}); 18 | brush.push(operators, {klass: 'operator'}); 19 | brush.push(access, {klass: 'access'}); 20 | 21 | // Variables 22 | brush.push({ 23 | pattern: /\$[a-z_][a-z0-9]*/gi, 24 | klass: 'variable' 25 | }); 26 | 27 | // ClassNames (CamelCase) 28 | brush.push(Syntax.lib.camelCaseType); 29 | brush.push(Syntax.lib.cStyleFunction); 30 | 31 | // Comments 32 | brush.push(Syntax.lib.cStyleComment); 33 | brush.push(Syntax.lib.cppStyleComment); 34 | brush.push(Syntax.lib.perlStyleComment); 35 | brush.push(Syntax.lib.webLink); 36 | 37 | // Strings 38 | brush.push(Syntax.lib.singleQuotedString); 39 | brush.push(Syntax.lib.doubleQuotedString); 40 | brush.push(Syntax.lib.stringEscape); 41 | 42 | // Numbers 43 | brush.push(Syntax.lib.decimalNumber); 44 | brush.push(Syntax.lib.hexNumber); 45 | 46 | brush.processes['function'] = Syntax.lib.webLinkProcess("http://www.php.net/manual-lookup.php?pattern="); 47 | }); 48 | 49 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.php.js: -------------------------------------------------------------------------------- 1 | // brush: "php" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.brushes.dependency('php', 'php-script'); 8 | 9 | Syntax.register('php', function(brush) { 10 | brush.push({ 11 | pattern: /(<\?(php)?)((.|\n)*?)(\?>)/gm, 12 | matches: Syntax.extractMatches({klass: 'keyword'}, null, {brush: 'php-script'}, null, {klass: 'keyword'}) 13 | }) 14 | }); 15 | 16 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.plain.js: -------------------------------------------------------------------------------- 1 | // brush: "plain" aliases: ["text"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('plain', function(brush) { 8 | brush.push(Syntax.lib.webLink); 9 | }); 10 | 11 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.protobuf.js: -------------------------------------------------------------------------------- 1 | // brush: "protobuf" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('protobuf', function(brush) { 8 | var keywords = ["enum", "extend", "extensions", "group", "import", "max", "message", "option", "package", "returns", "rpc", "service", "syntax", "to", "default"]; 9 | brush.push(keywords, {klass: 'keyword'}) 10 | 11 | var values = ["true", "false"]; 12 | brush.push(values, {klass: 'constant'}); 13 | 14 | var types = ["bool", "bytes", "double", "fixed32", "fixed64", "float", "int32", "int64", "sfixed32", "sfixed64", "sint32", "sint64", "string", "uint32", "uint64"]; 15 | brush.push(types, {klass: 'type'}); 16 | 17 | var access = ["optional", "required", "repeated"] 18 | brush.push(access, {klass: 'access'}); 19 | 20 | brush.push(Syntax.lib.camelCaseType); 21 | 22 | // Highlight names of fields 23 | brush.push({ 24 | pattern: /\s+(\w+)\s*=\s*\d+/g, 25 | matches: Syntax.extractMatches({ 26 | klass: 'variable' 27 | }) 28 | }); 29 | 30 | // Comments 31 | brush.push(Syntax.lib.cStyleComment); 32 | brush.push(Syntax.lib.webLink); 33 | 34 | // Strings 35 | brush.push(Syntax.lib.singleQuotedString); 36 | brush.push(Syntax.lib.doubleQuotedString); 37 | brush.push(Syntax.lib.stringEscape); 38 | 39 | // Numbers 40 | brush.push(Syntax.lib.decimalNumber); 41 | brush.push(Syntax.lib.hexNumber); 42 | }); 43 | 44 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.python.js: -------------------------------------------------------------------------------- 1 | // brush: "python" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('python', function(brush) { 8 | var keywords = ["and", "as", "assert", "break", "class", "continue", "def", "del", "elif", "else", "except", "exec", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "not", "or", "pass", "print", "raise", "return", "try", "while", "with", "yield"]; 9 | 10 | var operators = ["!=", "%", "%=", "&", "&=", "(", ")", "*", "**", "**=", "*=", "+", "+=", ",", "-", "-=", ".", "/", "//", "//=", "/=", ":", ";", "<", "<<", "<<=", "<=", "<>", "=", "==", ">", ">=", ">>", ">>=", "@", "[", "]", "^", "^=", "`", "`", "{", "|", "|=", "}", "~"]; 11 | 12 | // Extracted from http://docs.python.org/library/functions.html 13 | var builtinFunctions = ["abs", "all", "any", "basestring", "bin", "bool", "callable", "chr", "classmethod", "cmp", "compile", "complex", "delattr", "dict", "dir", "divmod", "enumerate", "eval", "execfile", "file", "filter", "float", "format", "frozenset", "getattr", "globals", "hasattr", "hash", "help", "hex", "id", "input", "int", "isinstance", "issubclass", "iter", "len", "list", "locals", "long", "map", "max", "min", "next", "object", "oct", "open", "ord", "pow", "print", "property", "range", "raw_input", "reduce", "reload", "repr", "reversed", "round", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", "tuple", "type", "type", "unichr", "unicode", "vars", "xrange", "zip", "__import__", "apply", "buffer", "coerce", "intern"]; 14 | 15 | var values = ["self", "True", "False", "None"]; 16 | 17 | brush.push({pattern: /^\s*@\w+/gm, klass: 'decorator'}); 18 | brush.push(values, {klass: 'constant'}); 19 | brush.push(keywords, {klass: 'keyword'}); 20 | brush.push(operators, {klass: 'operator'}); 21 | brush.push(builtinFunctions, {klass: 'builtin'}); 22 | 23 | // ClassNames (CamelCase) 24 | brush.push(Syntax.lib.camelCaseType); 25 | brush.push(Syntax.lib.cStyleFunction); 26 | 27 | brush.push(Syntax.lib.perlStyleComment); 28 | brush.push({pattern: /(['\"]{3})([^\1])*?\1/gm, klass: 'comment'}); 29 | brush.push(Syntax.lib.webLink); 30 | 31 | // Strings 32 | brush.push(Syntax.lib.singleQuotedString); 33 | brush.push(Syntax.lib.doubleQuotedString); 34 | brush.push(Syntax.lib.stringEscape); 35 | 36 | // Numbers 37 | brush.push(Syntax.lib.decimalNumber); 38 | brush.push(Syntax.lib.hexNumber); 39 | 40 | brush.processes['function'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q="); 41 | brush.processes['type'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q="); 42 | brush.processes['builtin'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q="); 43 | }); 44 | 45 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.ruby.js: -------------------------------------------------------------------------------- 1 | // brush: "ruby" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.lib.rubyStyleFunction = {pattern: /(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi, matches: Syntax.extractMatches({klass: 'function'})}; 8 | 9 | // We need to emulate negative lookbehind 10 | Syntax.lib.rubyStyleSymbol = {pattern: /([:]?):\w+/g, klass: 'constant', matches: function (match, expr) { 11 | if (match[1] != '') return []; 12 | 13 | return [new Syntax.Match(match.index, match[0].length, expr, match[0])]; 14 | }}; 15 | 16 | Syntax.register('ruby', function(brush) { 17 | var keywords = ["alias", "and", "begin", "break", "case", "class", "def", "define_method", "defined?", "do", "else", "elsif", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", "raise", "redo", "rescue", "retry", "return", "then", "throw", "undef", "unless", "until", "when", "while", "yield", "block_given?"]; 18 | 19 | var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"]; 20 | var values = ["self", "super", "true", "false", "nil"]; 21 | 22 | var access = ["private", "protected", "public"]; 23 | 24 | brush.push(access, {klass: 'access'}); 25 | brush.push(values, {klass: 'constant'}); 26 | 27 | // Percent operator statements 28 | brush.push({ 29 | pattern: /(\%[\S])(\{[\s\S]*?\})/g, 30 | matches: Syntax.extractMatches({klass: 'function'}, {klass: 'constant'}) 31 | }); 32 | 33 | brush.push({ 34 | pattern: /`[^`]+`/g, 35 | klass: 'string' 36 | }); 37 | 38 | brush.push({ 39 | pattern: /\#\{([^\}]*)\}/g, 40 | matches: Syntax.extractMatches({ 41 | brush: 'ruby', 42 | only: ['string'] 43 | }) 44 | }); 45 | 46 | // Regular expressions 47 | brush.push(Syntax.lib.rubyStyleRegularExpression); 48 | 49 | brush.push({pattern: /(@+|\$)[\w]+/g, klass: 'variable'}); 50 | 51 | brush.push(Syntax.lib.camelCaseType); 52 | brush.push(keywords, {klass: 'keyword'}); 53 | brush.push(operators, {klass: 'operator'}); 54 | 55 | brush.push(Syntax.lib.rubyStyleSymbol); 56 | 57 | // Comments 58 | brush.push(Syntax.lib.perlStyleComment); 59 | brush.push(Syntax.lib.webLink); 60 | 61 | // Strings 62 | brush.push(Syntax.lib.singleQuotedString); 63 | brush.push(Syntax.lib.doubleQuotedString); 64 | brush.push(Syntax.lib.stringEscape); 65 | 66 | // Numbers 67 | brush.push(Syntax.lib.decimalNumber); 68 | brush.push(Syntax.lib.hexNumber); 69 | 70 | // Functions 71 | brush.push(Syntax.lib.rubyStyleFunction); 72 | brush.push(Syntax.lib.cStyleFunction); 73 | 74 | // brush.processes['function'] = Syntax.lib.webLinkProcess("ruby", true); 75 | // brush.processes['type'] = Syntax.lib.webLinkProcess("ruby", true); 76 | }); 77 | 78 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.scala.js: -------------------------------------------------------------------------------- 1 | // brush: "scala" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.brushes.dependency('scala', 'xml'); 8 | 9 | Syntax.register('scala', function(brush) { 10 | var keywords = ["abstract", "do", "finally", "import", "object", "return", "trait", "var", "case", "catch", "class", "else", "extends", "for", "forSome", "if", "lazy", "match", "new", "override", "package", "private", "sealed", "super", "try", "type", "while", "with", "yield", "def", "final", "implicit", "protected", "throw", "val"]; 11 | brush.push(keywords, {klass: 'keyword'}); 12 | 13 | var operators = ["_", ":", "=", "=>", "<-", "<:", "<%", ">:", "#", "@"]; 14 | brush.push(operators, {klass: 'operator'}); 15 | 16 | var constants = ["this", "null", "true", "false"]; 17 | brush.push(constants, {klass: 'constant'}); 18 | 19 | // Strings 20 | brush.push({ 21 | pattern: /"""[\s\S]*?"""/g, 22 | klass: 'string' 23 | }); 24 | 25 | brush.push(Syntax.lib.doubleQuotedString); 26 | 27 | // Functions 28 | brush.push({ 29 | pattern: /(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi, 30 | matches: Syntax.extractMatches({klass: 'function'}) 31 | }); 32 | 33 | brush.push(Syntax.lib.camelCaseType); 34 | 35 | // Types 36 | brush.push(Syntax.lib.cStyleFunction); 37 | 38 | // Comments 39 | brush.push(Syntax.lib.cStyleComment); 40 | brush.push(Syntax.lib.cppStyleComment); 41 | 42 | brush.derives('xml'); 43 | }); 44 | 45 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.smalltalk.js: -------------------------------------------------------------------------------- 1 | // brush: "smalltalk" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('smalltalk', function(brush) { 8 | var operators = ["[", "]", "|", ":=", "."]; 9 | 10 | var values = ["self", "super", "true", "false", "nil"]; 11 | 12 | brush.push(values, {klass: 'constant'}); 13 | brush.push(operators, {klass: 'operator'}); 14 | 15 | // Objective-C style functions 16 | brush.push({pattern: /\w+:/g, klass: 'function'}); 17 | 18 | // Camelcase Types 19 | brush.push(Syntax.lib.camelCaseType); 20 | 21 | // Strings 22 | brush.push(Syntax.lib.singleQuotedString); 23 | brush.push(Syntax.lib.doubleQuotedString); 24 | brush.push(Syntax.lib.stringEscape); 25 | 26 | // Numbers 27 | brush.push(Syntax.lib.decimalNumber); 28 | brush.push(Syntax.lib.hexNumber); 29 | }); 30 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.super-collider.js: -------------------------------------------------------------------------------- 1 | // brush: "super-collider" aliases: ["sc"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('super-collider', function(brush) { 8 | var keywords = ["const", "arg", "classvar", "var"]; 9 | brush.push(keywords, {klass: 'keyword'}); 10 | 11 | var operators = ["`", "+", "@", ":", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"]; 12 | brush.push(operators, {klass: 'operator'}); 13 | 14 | var values = ["thisFunctionDef", "thisFunction", "thisMethod", "thisProcess", "thisThread", "this", "super", "true", "false", "nil", "inf"]; 15 | brush.push(values, {klass: 'constant'}); 16 | 17 | brush.push(Syntax.lib.camelCaseType); 18 | 19 | // Single Characters 20 | brush.push({ 21 | pattern: /\$(\\)?./g, 22 | klass: "constant" 23 | }); 24 | 25 | // Symbols 26 | brush.push({ 27 | pattern: /\\[a-z_][a-z0-9_]*/gi, 28 | klass: "symbol" 29 | }); 30 | 31 | brush.push({ 32 | pattern: /'[^']+'/g, 33 | klass: "symbol" 34 | }); 35 | 36 | // Comments 37 | brush.push(Syntax.lib.cStyleComment); 38 | brush.push(Syntax.lib.cppStyleComment); 39 | brush.push(Syntax.lib.webLink); 40 | 41 | // Strings 42 | brush.push(Syntax.lib.singleQuotedString); 43 | brush.push(Syntax.lib.doubleQuotedString); 44 | brush.push(Syntax.lib.stringEscape); 45 | 46 | // Numbers 47 | brush.push(Syntax.lib.decimalNumber); 48 | brush.push(Syntax.lib.hexNumber); 49 | 50 | // Functions 51 | brush.push({ 52 | pattern: /(?:\.)([a-z_][a-z0-9_]*)/gi, 53 | matches: Syntax.extractMatches({klass: 'function'}) 54 | }); 55 | 56 | brush.push(Syntax.lib.cStyleFunction); 57 | }); 58 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.swift.js: -------------------------------------------------------------------------------- 1 | // brush: "swift" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2016 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('swift', function(brush) { 8 | var keywords = [ 9 | "associatedtype", "class", "deinit", "enum", "extension", "fileprivate", "func", "import", "init", "inout", "internal", "let", "operator", "private", "protocol", "static", "struct", "subscript", "typealias", "var", "break", "case", "continue", "default", "defer", "do", "else", "fallthrough", "for", "guard", "if", "in", "repeat", "return", "switch", "where", "while", "as", "catch", "is", "rethrows", "throw", "throws", "try", "_", "#available", "#colorLiteral", "#column", "#else", "#elseif", "#endif", "#file", "#fileLiteral", "#function", "#if", "#imageLiteral", "#line", "#selector", "#sourceLocation", "associativity", "convenience", "dynamic", "didSet", "final", "get", "infix", "indirect", "lazy", "left", "mutating", "none", "nonmutating", "optional", "override", "postfix", "precedence", "prefix", "Protocol", "required", "right", "set", "Type", "unowned", "weak", "willSet"]; 10 | 11 | var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", 12 | "(", ")", "{", "}", "[", "]", ".", ",", ":", ";", "=", "@", "#", "->", "`", "?", "!"]; 13 | 14 | var values = ["self", "super", "true", "false", "nil"]; 15 | 16 | var access = ["fileprivate", "open", "private", "public"]; 17 | 18 | brush.push(access, {klass: 'access'}); 19 | brush.push(values, {klass: 'constant'}); 20 | 21 | brush.push({ 22 | pattern: /`[^`]+`/g, 23 | klass: 'identifier' 24 | }); 25 | 26 | brush.push({ 27 | pattern: /\\\(([^)]*)\)/g, 28 | matches: Syntax.extractMatches({ 29 | brush: 'swift', 30 | only: ['string'] 31 | }) 32 | }); 33 | 34 | brush.push(Syntax.lib.camelCaseType); 35 | brush.push(keywords, {klass: 'keyword'}); 36 | brush.push(operators, {klass: 'operator'}); 37 | 38 | // Comments 39 | brush.push(Syntax.lib.cStyleComment); 40 | brush.push(Syntax.lib.cppStyleComment); 41 | brush.push(Syntax.lib.webLink); 42 | 43 | // Strings 44 | brush.push(Syntax.lib.singleQuotedString); 45 | brush.push(Syntax.lib.doubleQuotedString); 46 | brush.push(Syntax.lib.stringEscape); 47 | 48 | // Numbers 49 | brush.push(Syntax.lib.decimalNumber); 50 | brush.push(Syntax.lib.hexNumber); 51 | 52 | // Functions 53 | brush.push(Syntax.lib.cStyleFunction); 54 | }); 55 | 56 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.xml.js: -------------------------------------------------------------------------------- 1 | // brush: "xml" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.lib.xmlEntity = {pattern: /&\w+;/g, klass: 'entity'}; 8 | Syntax.lib.xmlPercentEscape = {pattern: /(%[0-9a-f]{2})/gi, klass: 'percent-escape', only: ['string']}; 9 | 10 | Syntax.register('xml-tag', function(brush) { 11 | brush.push({ 12 | pattern: /<\/?((?:[^:\s>]+:)?)([^\s>]+)(\s[^>]*)?\/?>/g, 13 | matches: Syntax.extractMatches({klass: 'namespace'}, {klass: 'tag-name'}) 14 | }); 15 | 16 | brush.push({ 17 | pattern: /([^=\s]+)=(".*?"|'.*?'|[^\s>]+)/g, 18 | matches: Syntax.extractMatches({klass: 'attribute', only: ['tag']}, {klass: 'string', only: ['tag']}) 19 | }); 20 | 21 | brush.push(Syntax.lib.xmlEntity); 22 | brush.push(Syntax.lib.xmlPercentEscape); 23 | 24 | brush.push(Syntax.lib.singleQuotedString); 25 | brush.push(Syntax.lib.doubleQuotedString); 26 | }); 27 | 28 | Syntax.register('xml', function(brush) { 29 | brush.push({ 30 | pattern: /()/gm, 31 | matches: Syntax.extractMatches( 32 | {klass: 'cdata', allow: ['cdata-content', 'cdata-tag']}, 33 | {klass: 'cdata-tag'}, 34 | {klass: 'cdata-content'}, 35 | {klass: 'cdata-tag'} 36 | ) 37 | }); 38 | 39 | brush.push(Syntax.lib.xmlComment); 40 | 41 | brush.push({ 42 | pattern: /<[^>\-\s]([^>'"!\/;\?@\[\]^`\{\}\|]|"[^"]*"|'[^']')*[\/?]?>/g, 43 | brush: 'xml-tag' 44 | }); 45 | 46 | brush.push(Syntax.lib.xmlEntity); 47 | brush.push(Syntax.lib.xmlPercentEscape); 48 | 49 | brush.push(Syntax.lib.webLink); 50 | }); 51 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.xrb.js: -------------------------------------------------------------------------------- 1 | // brush: "xrb" aliases: ["trenni"] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.brushes.dependency('xrb', 'xml'); 8 | Syntax.brushes.dependency('xrb', 'ruby'); 9 | 10 | Syntax.register('xrb', function(brush) { 11 | brush.push({ 12 | pattern: /((<\?r)([\s\S]*?)(\?>))/gm, 13 | matches: Syntax.extractMatches( 14 | {klass: 'ruby-tag', allow: ['keyword', 'ruby']}, 15 | {klass: 'keyword'}, 16 | {brush: 'ruby'}, 17 | {klass: 'keyword'} 18 | ) 19 | }); 20 | 21 | brush.push({ 22 | pattern: /((#{)([\s\S]*?)(}))/gm, 23 | matches: Syntax.extractMatches( 24 | {klass: 'ruby-tag', allow: ['keyword', 'ruby']}, 25 | {klass: 'keyword'}, 26 | {brush: 'ruby'}, 27 | {klass: 'keyword'} 28 | ) 29 | }); 30 | 31 | // The position of this statement is important - it determines at what point the rules of the parent are processed. 32 | // In this case, the rules for xml are processed after the rules for html. 33 | brush.derives('xml'); 34 | }); 35 | 36 | -------------------------------------------------------------------------------- /source/jquery.syntax.brush.yaml.js: -------------------------------------------------------------------------------- 1 | // brush: "yaml" aliases: [] 2 | 3 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 4 | // Copyright (c) 2011 Samuel G. D. Williams. 5 | // See for licensing details. 6 | 7 | Syntax.register('yaml', function(brush) { 8 | brush.push({ 9 | pattern: /^\s*#.*$/gm, 10 | klass: 'comment', 11 | allow: ['href'] 12 | }); 13 | 14 | brush.push(Syntax.lib.singleQuotedString); 15 | brush.push(Syntax.lib.doubleQuotedString); 16 | 17 | brush.push({ 18 | pattern: /(&|\*)[a-z0-9]+/gi, 19 | klass: 'constant' 20 | }); 21 | 22 | brush.push({ 23 | pattern: /(.*?):/gi, 24 | matches: Syntax.extractMatches({klass: 'keyword'}) 25 | }); 26 | 27 | brush.push(Syntax.lib.webLink); 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /source/jquery.syntax.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 3 | For more information, please see http://www.oriontransfer.co.nz/software/jquery-syntax 4 | 5 | Copyright (c) 2011 Samuel G. D. Williams. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | /*global Function: true, ResourceLoader: true, Syntax: true, alert: false, jQuery: true */ 27 | 28 | // ECMAScript 5! Why wasn't this done before!? 29 | if (!Function.prototype.bind) { 30 | Function.prototype.bind = function (target) { 31 | var args = Array.prototype.slice.call(arguments, 1), fn = this; 32 | 33 | return function () { 34 | return fn.apply(target, args); 35 | }; 36 | }; 37 | } 38 | 39 | function ResourceLoader (loader) { 40 | this.dependencies = {}; 41 | this.loading = {}; 42 | this.loader = loader; 43 | } 44 | 45 | ResourceLoader.prototype._finish = function (name) { 46 | var deps = this.dependencies[name]; 47 | 48 | if (deps) { 49 | // I'm not sure if this makes me want to cry... or laugh... or kill!? 50 | var chain = this._loaded.bind(this, name); 51 | 52 | for (var i = 0; i < deps.length; i += 1) { 53 | chain = this.get.bind(this, deps[i], chain); 54 | } 55 | 56 | chain(); 57 | } else { 58 | this._loaded(name); 59 | } 60 | }; 61 | 62 | ResourceLoader.prototype._loaded = function (name) { 63 | // When the script has been succesfully loaded, we expect the script 64 | // to register with this loader (i.e. this[name]). 65 | var resource = this[name], loading = this.loading[name]; 66 | 67 | // Clear the loading list 68 | this.loading[name] = null; 69 | 70 | if (!resource) { 71 | alert("ResourceLoader: Could not load resource named " + name); 72 | } else { 73 | for (var i = 0; i < loading.length; i += 1) { 74 | loading[i](resource); 75 | } 76 | } 77 | }; 78 | 79 | // This function must ensure that current cannot be completely loaded until next 80 | // is completely loaded. 81 | ResourceLoader.prototype.dependency = function (current, next) { 82 | // If the resource has completely loaded, then we don't need to queue it 83 | // as a dependency 84 | if (this[next] && !this.loading[name]) { 85 | return; 86 | } 87 | 88 | if (this.dependencies[current]) { 89 | this.dependencies[current].push(next); 90 | } else { 91 | this.dependencies[current] = [next]; 92 | } 93 | }; 94 | 95 | // This function must be reentrant for the same name. Additionally, if name is undefined, the callback will be invoked but with no argument. 96 | ResourceLoader.prototype.get = function (name, callback) { 97 | if (name == undefined) { 98 | callback(); 99 | } else if (this.loading[name]) { 100 | this.loading[name].push(callback) 101 | } else if (this[name]) { 102 | callback(this[name]); 103 | } else { 104 | this.loading[name] = [callback]; 105 | this.loader(name, this._finish.bind(this, name)); 106 | } 107 | }; 108 | 109 | var Syntax = { 110 | root: null, 111 | aliases: {}, 112 | styles: {}, 113 | themes: {}, 114 | lib: {}, 115 | 116 | cacheScripts: true, 117 | cacheStyleSheets: true, 118 | codeSelector: 'code:not(.highlighted)', 119 | 120 | defaultOptions: { 121 | theme: "base", 122 | replace: true, 123 | linkify: true 124 | }, 125 | 126 | brushes: new ResourceLoader(function (name, callback) { 127 | name = Syntax.aliases[name] || name; 128 | 129 | Syntax.getResource('jquery.syntax.brush', name, callback); 130 | }), 131 | 132 | loader: new ResourceLoader(function (name, callback) { 133 | Syntax.getResource('jquery.syntax', name, callback); 134 | }), 135 | 136 | getStyles: function (path) { 137 | var link = jQuery(''); 138 | jQuery("head").append(link); 139 | 140 | if (!Syntax.cacheStyleSheets) { 141 | path = path + "?" + Math.random() 142 | } 143 | 144 | link.attr({ 145 | rel: "stylesheet", 146 | type: "text/css", 147 | href: path 148 | }); 149 | }, 150 | 151 | getScript: function (path, callback) { 152 | var script = document.createElement('script'); 153 | 154 | script.onload = callback; 155 | script.type = "text/javascript"; 156 | 157 | if (!Syntax.cacheScripts) 158 | path = path + '?' + Math.random() 159 | 160 | script.src = path; 161 | 162 | document.getElementsByTagName('head')[0].appendChild(script); 163 | }, 164 | 165 | getResource: function (prefix, name, callback) { 166 | Syntax.detectRoot(); 167 | 168 | var basename = prefix + "." + name; 169 | var styles = this.styles[basename]; 170 | 171 | if (styles) { 172 | for (var i = 0; i < styles.length; i += 1) { 173 | this.getStyles(this.root + styles[i]); 174 | } 175 | } 176 | 177 | Syntax.getScript(this.root + basename + '.js', callback); 178 | }, 179 | 180 | alias: function (name, aliases) { 181 | Syntax.aliases[name] = name; 182 | 183 | for (var i = 0; i < aliases.length; i += 1) { 184 | Syntax.aliases[aliases[i]] = name; 185 | } 186 | }, 187 | 188 | brushAliases: function (brush) { 189 | var aliases = []; 190 | 191 | for (var name in Syntax.aliases) { 192 | if (Syntax.aliases[name] === brush) { 193 | aliases.push(name); 194 | } 195 | } 196 | 197 | return aliases; 198 | }, 199 | 200 | brushNames: function () { 201 | var names = []; 202 | 203 | for (var name in Syntax.aliases) { 204 | if (name === Syntax.aliases[name]) { 205 | names.push(name); 206 | } 207 | } 208 | 209 | return names; 210 | }, 211 | 212 | detectRoot: function () { 213 | if (Syntax.root == null) { 214 | // Initialize root based on current script path. 215 | var scripts = jQuery('script').filter(function(){ 216 | return this.src.match(/jquery\.syntax/); 217 | }); 218 | 219 | var first = scripts.get(0); 220 | 221 | if (first) { 222 | // Calculate the basename for the given script src. 223 | var root = first.src.match(/.*\//); 224 | 225 | if (root) { 226 | Syntax.root = root[0]; 227 | } 228 | } 229 | } 230 | } 231 | }; 232 | 233 | jQuery.fn.syntax = function (options, callback) { 234 | if (this.length == 0) return; 235 | 236 | options = jQuery.extend(Syntax.defaultOptions, options) 237 | 238 | Syntax.loader.get('core', function (elements) { 239 | Syntax.highlight(this, options, callback); 240 | }.bind(this)); 241 | }; 242 | 243 | jQuery.syntax = function (options, callback) { 244 | var context = options ? options.context : null; 245 | 246 | jQuery(Syntax.codeSelector, context).syntax(options, callback); 247 | }; 248 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.apache.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .apache 7 | .tag 8 | color: #00c 9 | 10 | .tag-name 11 | color: #00f 12 | 13 | .tag-name 14 | font-weight: bold 15 | 16 | @media (prefers-color-scheme: dark) 17 | .syntax-theme-base 18 | .apache 19 | .tag 20 | color: lighten(#00c, 30%) 21 | 22 | .tag-name 23 | color: lighten(#00f, 30%) 24 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.applescript.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .applescript 7 | font-family: Geneva, Helvetica, sans-serif 8 | 9 | .keyword 10 | color: #00f 11 | font-weight: bold 12 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.assembly.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .assembly 7 | .register 8 | color: #3caa20 9 | font-style: italic 10 | 11 | .label 12 | font-weight: bold 13 | color: #2a85b3 14 | 15 | .directive 16 | color: #828a3d 17 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.bash-script.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .bash-script 7 | .option 8 | color: #03f 9 | 10 | .env 11 | font-style: italic -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.bash.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .bash 7 | .stderr 8 | color: red -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.clang.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .preprocessor 7 | color: #63381f 8 | 9 | @media (prefers-color-scheme: dark) 10 | .syntax-theme-base 11 | .preprocessor 12 | color: lighten(#63381f, 30%) 13 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.css.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .css 7 | .selector 8 | color: #458 9 | font-weight: bold 10 | 11 | .property 12 | color: teal 13 | 14 | .value 15 | 16 | .color-box 17 | position: relative 18 | 19 | .sample 20 | border: 1px solid #000 21 | position: absolute 22 | left: 0.2em 23 | right: 0.2em 24 | top: 0.2em 25 | bottom: 0.2em -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.diff.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .add 7 | color: green 8 | 9 | .del 10 | color: red 11 | 12 | .insert 13 | color: green 14 | .insert-line 15 | background-color: #cfc !important 16 | 17 | .remove 18 | color: red 19 | .remove-line 20 | background-color: #fcc !important 21 | 22 | .offset 23 | color: blue 24 | .offset-line 25 | background-color: #ccf !important -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.html.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .html 7 | .doctype 8 | font-weight: bold 9 | color: #938 10 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.ocaml.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax .ocaml 6 | .operator 7 | color: #06C 8 | font-weight: bold -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.protobuf.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax .protobuf 6 | .variable 7 | font-weight: bold -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.python.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .python 7 | .decorator 8 | color: #ffb600 9 | font-weight: bold 10 | .builtin 11 | color: #33f 12 | font-style: italic -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.ruby.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | // This small hack ensures that string interpolations are displayed correctly 6 | .syntax-theme-base 7 | .ruby 8 | .string .ruby 9 | color: #808080 10 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.brush.xml.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-theme-base 6 | .xml 7 | .cdata-content 8 | color: #046 9 | border-radius: 0.5em 10 | 11 | .xml-tag, .cdata 12 | color: #00c 13 | 14 | .tag-name, .cdata-tag 15 | color: #00f 16 | font-weight: bold 17 | 18 | .namespace 19 | color: #00c 20 | 21 | .attribute 22 | color: #00c 23 | 24 | .instruction 25 | color: #00c 26 | 27 | .entity, .percent-escape 28 | color: #666 29 | background-color: #ddd 30 | border-radius: 0.5em 31 | 32 | @media (prefers-color-scheme: dark) 33 | .syntax-theme-base 34 | .xml 35 | .cdata-content 36 | color: #a46 37 | 38 | .xml-tag, .cdata 39 | color: #c59de7 40 | 41 | .tag-name, .cdata-tag 42 | color: #9ae 43 | 44 | .namespace 45 | color: #c59de7 46 | 47 | .attribute 48 | color: #c59de7 49 | 50 | .instruction 51 | color: #c59de7 52 | 53 | .entity, .percent-escape 54 | color: #999 55 | background-color: #333 56 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.core.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | pre code.syntax-theme-base 6 | display: block 7 | 8 | > span 9 | display: flex 10 | 11 | .indent 12 | flex-grow: 0 13 | flex-shrink: 0 14 | 15 | .text 16 | white-space: pre-wrap 17 | padding-left: 2ch 18 | text-indent: -2ch 19 | 20 | .syntax-theme-base 21 | a 22 | text-decoration: none 23 | color: inherit 24 | 25 | .function 26 | color: #33f 27 | 28 | .keyword, .access, .option 29 | color: darken(#a90d91, 10%) 30 | 31 | .type 32 | color: #3239D6 33 | 34 | .comment 35 | color: #6ac 36 | 37 | .constant 38 | color: #1c00ce 39 | 40 | .string, .symbol 41 | color: #c41a15 42 | 43 | .string .escape 44 | color: #f99 45 | 46 | .operator 47 | color: black 48 | 49 | .href 50 | color: #0e0eff 51 | text-decoration: underline 52 | 53 | .variable 54 | color: #466997 55 | 56 | .highlight 57 | background-color: opacify(#fdfdba, 0.5) 58 | 59 | @media (prefers-color-scheme: dark) 60 | .syntax-theme-base 61 | .operator 62 | color: white 63 | 64 | .function 65 | color: #c59de7 66 | 67 | .keyword, .access, .option 68 | color: darken(#98c6ff, 20%) 69 | 70 | .type 71 | color: #37a4ff 72 | 73 | .comment 74 | color: #849fca 75 | 76 | .constant 77 | color: lighten(#9d7c31, 15%) 78 | 79 | .string, .symbol 80 | color: lighten(#e43c3a, 15%) 81 | 82 | .string .escape 83 | color: #f99 84 | 85 | .variable 86 | color: #6e6dff 87 | -------------------------------------------------------------------------------- /themes/base/jquery.syntax.editor.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-container.syntax-theme-base 6 | div.editor.syntax 7 | padding: 0.2em !important 8 | margin: 0 !important 9 | white-space: pre 10 | 11 | div.editor.syntax:focus 12 | outline: none -------------------------------------------------------------------------------- /themes/bright/_config.yaml: -------------------------------------------------------------------------------- 1 | depends: 2 | - base -------------------------------------------------------------------------------- /themes/bright/jquery.syntax.core.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | .syntax-container.syntax-theme-bright 6 | .syntax 7 | font-family: Menlo, Monaco, Consolas, monospace 8 | line-height: 1.5em 9 | 10 | .function 11 | color: #33f 12 | 13 | .keyword 14 | color: #3c3 15 | 16 | .access 17 | color: #ffb600 18 | font-weight: bold 19 | 20 | .type 21 | color: #191 22 | font-weight: bold 23 | 24 | .comment 25 | color: #6ac 26 | font-style: italic 27 | 28 | .string, .constant 29 | color: #f33 30 | 31 | .string .escape 32 | color: #f99 33 | 34 | .operator 35 | color: #c00 36 | 37 | .href 38 | color: #00f 39 | text-decoration: underline 40 | 41 | .variable 42 | color: #22c -------------------------------------------------------------------------------- /themes/paper/_config.yaml: -------------------------------------------------------------------------------- 1 | depends: 2 | - base -------------------------------------------------------------------------------- /themes/paper/jquery.syntax.core.sass: -------------------------------------------------------------------------------- 1 | // This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License. 2 | // Copyright (c) 2011 Samuel G. D. Williams. 3 | // See for licensing details. 4 | 5 | code.syntax-theme-paper 6 | font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace 7 | line-height: 1.5em 8 | 9 | .function 10 | color: #33f 11 | 12 | .keyword 13 | color: #cb4b16 14 | 15 | .access 16 | color: #ffb600 17 | font-weight: bold 18 | 19 | .type 20 | color: #268bd2 21 | 22 | .comment 23 | color: #998 24 | font-style: italic 25 | 26 | .string 27 | color: #2aa198 28 | 29 | .string .escape 30 | color: #2ab1a8 31 | 32 | .operator 33 | color: #268bd2 34 | 35 | .href 36 | color: #00f 37 | text-decoration: underline 38 | 39 | .variable 40 | color: #b58900 41 | 42 | .constant 43 | color: #099 44 | 45 | pre code.syntax-theme-paper 46 | > span:nth-child(odd) 47 | background-color: rgba(0, 0, 0, 0.05) 48 | --------------------------------------------------------------------------------