Skip to content

Commit

Permalink
Merge branch 'gh-pages' into prism-textile
Browse files Browse the repository at this point in the history
Conflicts:
	components.js
  • Loading branch information
Golmote committed Sep 6, 2015
2 parents 404dfb7 + 125e91f commit 9019fce
Show file tree
Hide file tree
Showing 599 changed files with 23,074 additions and 869 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto

# Test files should not have their line endings modified by git
/tests/languages/**/*.test binary
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hide-*.js
node_modules
.idea/
.idea/
.DS_Store
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js

node_js:
- "0.10"
- "0.12"

before_script:
- npm install -g gulp
- gulp

script: npm test
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Why another syntax highlighter?: http://lea.verou.me/2012/07/introducing-prism-a
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips:

- Read the [documentation](http://prismjs.com/extending.html). Prism was designed to be extensible.
- Do not edit prism.js, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the components/ folder. The minified files are also generated automatically.
- Currently the build system building prism.js and the minified files is just a bunch of local settings in CodeKit. If someone wants to help export them to a config file, please contact me by opening an issue.
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the components/ folder. The minified files are also generated automatically.
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. Having gulp installed, you just need to run the command `gulp`.
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
- Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult.
- My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected.
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition. Soon I plan to add usernames of project owners for themes, plugins and language definitions so this becomes more clear to users.
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.
- If you add a new language definition, theme or plugin, you need to add it to `components.js` as well, so that it becomes available to the download build page.

Thank you so much for contributing!!
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "prism",
"version": "0.0.1",
"main": [
"prism.js",
"themes/prism.css"
Expand All @@ -9,6 +8,10 @@
"authors": "Lea Verou",
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/PrismJS/prism.git"
},
"ignore": [
"**/.*",
"img",
Expand Down
57 changes: 55 additions & 2 deletions components.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var components = {
"meta": {
"path": "components/prism-{id}",
"noCSS": true,
"examplesPath": "examples/prism-{id}"
"examplesPath": "examples/prism-{id}",
"addCheckAll": true
},
"markup": {
"title": "Markup",
Expand All @@ -55,7 +56,7 @@ var components = {
"require": "clike"
},

// ---


"actionscript": {
"title": "ActionScript",
Expand All @@ -66,6 +67,10 @@ var components = {
"title": "Apache Configuration",
"owner": "GuiTeK"
},
"apl": {
"title": "APL",
"owner": "ngn"
},
"applescript": {
"title": "AppleScript",
"owner": "Golmote"
Expand All @@ -84,6 +89,10 @@ var components = {
"require": "clike",
"owner": "zeitgeist87"
},
"brainfuck": {
"title": "Brainfuck",
"owner": "Golmote"
},
"c": {
"title": "C",
"require": "clike",
Expand Down Expand Up @@ -114,10 +123,18 @@ var components = {
"require": "clike",
"owner": "Golmote"
},
"docker": {
"title": "Docker",
"owner": "JustinBeckwith"
},
"eiffel": {
"title": "Eiffel",
"owner": "Conaclos"
},
"elixir": {
"title": "Elixir",
"owner": "Golmote"
},
"erlang": {
"title": "Erlang",
"owner": "Golmote"
Expand Down Expand Up @@ -185,6 +202,10 @@ var components = {
"title": "Julia",
"owner": "cdagnino"
},
"keyman": {
"title": "Keyman",
"owner": "mcdurdin"
},
"latex": {
"title": "LaTeX",
"owner": "japborst"
Expand All @@ -198,6 +219,10 @@ var components = {
"title": "LOLCODE",
"owner": "Golmote"
},
"makefile": {
"title": "Makefile",
"owner": "Golmote"
},
"markdown": {
"title": "Markdown",
"require": "markup",
Expand Down Expand Up @@ -246,6 +271,11 @@ var components = {
"title": "Python",
"owner": "multipetros"
},
"qore": {
"title": "Qore",
"require": ["clike"],
"owner": "temnroegg"
},
"r": {
"title": "R",
"owner": "Golmote"
Expand Down Expand Up @@ -276,6 +306,11 @@ var components = {
"title": "SAS",
"owner": "Golmote"
},
"sass": {
"title": "Sass (Sass)",
"require": "css",
"owner": "Golmote"
},
"scss": {
"title": "Sass (Scss)",
"require": "css",
Expand Down Expand Up @@ -312,6 +347,10 @@ var components = {
"require": "clike",
"owner": "chrischares"
},
"tcl": {
"title": "Tcl",
"owner": "PeterChaplin"
},
"textile": {
"title": "Textile",
"require": "markup",
Expand All @@ -327,6 +366,10 @@ var components = {
"require": "javascript",
"owner": "vkbansal"
},
"vhdl": {
"title": "VHDL",
"owner": "a-rey"
},
"wiki": {
"title": "Wiki markup",
"require": "markup",
Expand Down Expand Up @@ -358,10 +401,20 @@ var components = {
"title": "Show Language",
"owner": "nauzilus"
},
"jsonp-highlight": {
"title": "JSONP Highlight",
"noCSS": true,
"owner": "nauzilus"
},
"highlight-keywords": {
"title": "Highlight Keywords",
"owner": "vkbansal",
"noCSS": true
},
"remove-initial-line-feed": {
"title": "Remove initial line feed",
"owner": "Golmote",
"noCSS": true
}
}
};
11 changes: 4 additions & 7 deletions components/prism-actionscript.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/* TODO
Fix XML highlighting
*/

Prism.languages.actionscript = Prism.languages.extend('javascript', {
'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,
'operator': /(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=)=?|[=~?@]/
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
});
Prism.languages.actionscript['class-name'].alias = 'function';

if (Prism.languages.markup) {
Prism.languages.insertBefore('actionscript', 'operator', {
Prism.languages.insertBefore('actionscript', 'string', {
'xml': {
pattern: /(^|[^.])<[\s\S]*>(?=\s*($|[\r\n,.;\]})<]))/,
pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,
lookbehind: true,
inside: {
rest: Prism.languages.markup
}
Expand Down
2 changes: 1 addition & 1 deletion components/prism-actionscript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion components/prism-apacheconf.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/prism-apacheconf.min.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions components/prism-apl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Prism.languages.apl = {
'comment': /(?:⍝|#[! ]).*$/m,
'string': /'(?:[^'\r\n]|'')*'/,
'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i,
'statement': /:[A-Z][a-z][A-Za-z]*\b/,
'system-function': {
pattern: /⎕[A-Z]+/i,
alias: 'function'
},
'constant': /[⍬⌾#⎕⍞]/,
'function': /[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
'monadic-operator': {
pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
alias: 'operator'
},
'dyadic-operator': {
pattern: /[.⍣⍠⍤∘⌸]/,
alias: 'operator'
},
'assignment': {
pattern: //,
alias: 'keyword'
},
'punctuation': /[\[;\]()◇⋄]/,
'dfn': {
pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
alias: 'builtin'
}
};
1 change: 1 addition & 0 deletions components/prism-apl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions components/prism-applescript.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
/* TODO
Add support for nested block comments...
*/

Prism.languages.applescript = {
'comment': [
/\(\*[\w\W]*?\*\)/,
// Allow one level of nesting
/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,
/--.+/,
/#.+/
],
'string': /"(?:\\?.)*?"/,
'number': /\b-?\d*\.?\d+([Ee]-?\d+)?\b/,
'operator': [
/[&=≠≤≥*+\-\/÷^]|[<>]=?/,
/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/
],
'keyword': /\b(?:about|above|after|against|and|apart from|around|as|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|continue|copy|div|does|eighth|else|end|equal|equals|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out of|over|prop|property|put|ref|reference|repeat|return|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
'keyword': /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
'class': {
pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,
alias: 'builtin'
},
'number': /\b-?\d*\.?\d+([Ee]-?\d+)?\b/,
'punctuation': /[{}():,¬«»《》]/
};
2 changes: 1 addition & 1 deletion components/prism-applescript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion components/prism-aspnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Prism.languages.aspnet = Prism.languages.extend('markup', {
'page-directive tag': {
pattern: /<%\s*@.*%>/i,
inside: {
'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master|MasterType|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
rest: Prism.languages.markup.tag.inside
}
},
Expand All @@ -14,6 +14,8 @@ Prism.languages.aspnet = Prism.languages.extend('markup', {
}
}
});
// Regexp copied from prism-markup, with a negative look-ahead added
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i;

// match directives of attribute value foo="<% Bar %>"
Prism.languages.insertBefore('inside', 'punctuation', {
Expand Down
Loading

0 comments on commit 9019fce

Please sign in to comment.