highlight.js
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,3 +6,3 @@ Syntax highlighting with language autodetection. | ||
Original author and current maintainer: | ||
Ivan Sagalaev <Maniac@SoftwareManiacs.Org> | ||
Ivan Sagalaev <maniac@softwaremaniacs.org> | ||
@@ -47,1 +47,2 @@ Contributors: | ||
- Stephan Kountso <steplg@gmail.com> | ||
- pumbur <pumbur@pumbur.net> |
@@ -6,3 +6,3 @@ Подсветка синтаксиса с автоопределением языка. | ||
Первоначальный автор и ведущий проекта: | ||
Иван Сагалаев <Maniac@SoftwareManiacs.Org> | ||
Иван Сагалаев <maniac@softwaremaniacs.org> | ||
@@ -47,1 +47,2 @@ Внесли свой вклад: | ||
- Степан Кунцьо <steplg@gmail.com> | ||
- pumbur <pumbur@pumbur.net> |
@@ -5,3 +5,3 @@ { | ||
"description": "A node clone of highlight.js syntax highlighter library", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -19,6 +19,8 @@ # Highlight.js | ||
<script type="text/javascript" src="highlight.pack.js"></script> | ||
<script type="text/javascript"> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
```html | ||
<script type="text/javascript" src="highlight.pack.js"></script> | ||
<script type="text/javascript"> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
``` | ||
@@ -29,9 +31,11 @@ Also you can replace TAB ('\x09') characters used for indentation in your code | ||
<script type="text/javascript"> | ||
hljs.tabReplace = ' '; // 4 spaces | ||
// ... or | ||
hljs.tabReplace = '<span class="indent">\t</span>'; | ||
```html | ||
<script type="text/javascript"> | ||
hljs.tabReplace = ' '; // 4 spaces | ||
// ... or | ||
hljs.tabReplace = '<span class="indent">\t</span>'; | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
``` | ||
@@ -52,5 +56,7 @@ The script looks in your page for fragments `<pre><code>...</code></pre>` | ||
$(document).ready(function() { | ||
$('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')}); | ||
}); | ||
```javascript | ||
$(document).ready(function() { | ||
$('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')}); | ||
}); | ||
``` | ||
@@ -60,5 +66,6 @@ If your code container relies on `<br>` tags instead of line breaks (i.e. if | ||
$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); | ||
```javascript | ||
$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); | ||
``` | ||
### Styling | ||
@@ -68,17 +75,19 @@ | ||
.comment { | ||
color: gray; | ||
} | ||
```css | ||
.comment { | ||
color: gray; | ||
} | ||
.keyword { | ||
font-weight: bold; | ||
} | ||
.keyword { | ||
font-weight: bold; | ||
} | ||
.python .string { | ||
color: blue; | ||
} | ||
.python .string { | ||
color: blue; | ||
} | ||
.html .atribute .value { | ||
color: green; | ||
} | ||
.html .atribute .value { | ||
color: green; | ||
} | ||
``` | ||
@@ -112,3 +121,5 @@ Highlight.js comes with several style themes located in "styles" directory that | ||
<pre><code class="html">...</code></pre> | ||
```html | ||
<pre><code class="html">...</code></pre> | ||
``` | ||
@@ -120,12 +131,13 @@ You can use class names recommended in HTML5: "language-html", | ||
<pre><code class="no-highlight">...</code></pre> | ||
```html | ||
<pre><code class="no-highlight">...</code></pre> | ||
``` | ||
## Meta | ||
- Version: 6.0 | ||
- Version: 6.1 | ||
- URL: http://softwaremaniacs.org/soft/highlight/en/ | ||
- Author: Ivan Sagalaev (<Maniac@SoftwareManiacs.Org>) | ||
- Author: Ivan Sagalaev (<maniac@softwaremaniacs.org>) | ||
For the license terms see LICENSE files. | ||
For the list of contributors see AUTHORS.en.txt file. |
@@ -21,6 +21,8 @@ # Highlight.js | ||
<script type="text/javascript" src="highlight.pack.js"></script> | ||
<script type="text/javascript"> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
```html | ||
<script type="text/javascript" src="highlight.pack.js"></script> | ||
<script type="text/javascript"> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
``` | ||
@@ -31,9 +33,11 @@ Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на | ||
<script type="text/javascript"> | ||
hljs.tabReplace = ' '; // 4 spaces | ||
// ... or | ||
hljs.tabReplace = '<span class="indent">\t</span>'; | ||
```html | ||
<script type="text/javascript"> | ||
hljs.tabReplace = ' '; // 4 spaces | ||
// ... or | ||
hljs.tabReplace = '<span class="indent">\t</span>'; | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
hljs.initHighlightingOnLoad(); | ||
</script> | ||
``` | ||
@@ -54,5 +58,7 @@ Дальше скрипт ищет на странице конструкции `<pre><code>...</code></pre>`, | ||
$(document).ready(function() { | ||
$('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')}); | ||
}); | ||
```javascript | ||
$(document).ready(function() { | ||
$('pre code').each(function(i, e) {hljs.highlightBlock(e, ' ')}); | ||
}); | ||
``` | ||
@@ -62,5 +68,6 @@ Если ваш блок кода использует `<br>` вместо переводов строки (т.е. если это не | ||
$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); | ||
```javascript | ||
$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); | ||
``` | ||
### Выбор стилей | ||
@@ -70,17 +77,19 @@ | ||
.comment { | ||
color: gray; | ||
} | ||
```css | ||
.comment { | ||
color: gray; | ||
} | ||
.keyword { | ||
font-weight: bold; | ||
} | ||
.keyword { | ||
font-weight: bold; | ||
} | ||
.python .string { | ||
color: blue; | ||
} | ||
.python .string { | ||
color: blue; | ||
} | ||
.html .atribute .value { | ||
color: green; | ||
} | ||
.html .atribute .value { | ||
color: green; | ||
} | ||
``` | ||
@@ -115,3 +124,5 @@ В комплекте с highlight.js идут несколько стилевых тем в директории styles, | ||
<pre><code class="html">...</code></pre> | ||
```html | ||
<pre><code class="html">...</code></pre> | ||
``` | ||
@@ -124,12 +135,13 @@ Можно использовать рекомендованные в HTML5 названия классов: | ||
<pre><code class="no-highlight">...</code></pre> | ||
```html | ||
<pre><code class="no-highlight">...</code></pre> | ||
``` | ||
## Координаты | ||
- Версия: 6.0 | ||
- Версия: 6.1 | ||
- URL: http://softwaremaniacs.org/soft/highlight/ | ||
- Автор: Иван Сагалаев (<Maniac@SoftwareManiacs.Org>) | ||
- Автор: Иван Сагалаев (<maniac@softwaremaniacs.org>) | ||
Лицензионное соглашение читайте в файле LICENSE. | ||
Список соавторов читайте в файле AUTHORS.ru.txt |
/* | ||
Language: Bash | ||
Author: vah <vahtenberg@gmail.com> | ||
Category: common | ||
*/ | ||
@@ -48,7 +47,2 @@ | ||
hljs.HASH_COMMENT_MODE, | ||
{ | ||
className: 'comment', | ||
begin: '\\/\\/', end: '$', | ||
illegal: '.' | ||
}, | ||
hljs.C_NUMBER_MODE, | ||
@@ -55,0 +49,0 @@ STRING, |
/* | ||
Language: C++ | ||
Category: common | ||
*/ | ||
@@ -5,0 +4,0 @@ |
/* | ||
Language: C# | ||
Author: Jason Diamond <jason@diamond.name> | ||
Category: common | ||
*/ | ||
@@ -6,0 +5,0 @@ |
/* | ||
Language: CSS | ||
Category: common | ||
*/ | ||
@@ -39,5 +38,5 @@ | ||
className: 'at_rule', | ||
begin: '@font-face', | ||
begin: '@(font-face|page)', | ||
lexems: '[a-z-]+', | ||
keywords: {'font-face': 1} | ||
keywords: {'font-face': 1, 'page': 1} | ||
}, | ||
@@ -44,0 +43,0 @@ { |
@@ -5,3 +5,2 @@ /* | ||
Author: Vasily Polovnyov <vast@whiteants.net> | ||
Category: common | ||
*/ | ||
@@ -8,0 +7,0 @@ |
/* | ||
Language: Ini | ||
Category: common | ||
*/ | ||
@@ -5,0 +4,0 @@ |
/* | ||
Language: Java | ||
Author: Vsevolod Solovyov <vsevolod.solovyov@gmail.com> | ||
Category: common | ||
*/ | ||
@@ -6,0 +5,0 @@ |
/* | ||
Language: Javascript | ||
Category: common | ||
*/ | ||
@@ -5,0 +4,0 @@ |
/* | ||
Language: Perl | ||
Author: Peter Leonov <gojpeg@yandex.ru> | ||
Category: common | ||
*/ | ||
@@ -24,3 +23,11 @@ | ||
var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR1, VAR2]; | ||
var METHOD = { | ||
begin: '->', | ||
contains: [ | ||
{begin: hljs.IDENT_RE}, | ||
{begin: '{', end: '}'} | ||
] | ||
}; | ||
var PERL_DEFAULT_CONTAINS = [ | ||
VAR1, VAR2, | ||
hljs.HASH_COMMENT_MODE, | ||
@@ -32,2 +39,3 @@ { | ||
}, | ||
METHOD, | ||
{ | ||
@@ -118,3 +126,2 @@ className: 'string', | ||
}, | ||
VAR1, VAR2, | ||
{ | ||
@@ -131,2 +138,3 @@ className: 'operator', | ||
SUBST.contains = PERL_DEFAULT_CONTAINS; | ||
METHOD.contains[1].contains = PERL_DEFAULT_CONTAINS; | ||
@@ -133,0 +141,0 @@ return { |
/* | ||
Language: PHP | ||
Author: Victor Karamzin <Victor.Karamzin@enterra-inc.com> | ||
Category: common | ||
*/ | ||
@@ -6,0 +5,0 @@ |
/* | ||
Language: Python | ||
Category: common | ||
*/ | ||
@@ -9,3 +8,3 @@ | ||
className: 'string', | ||
begin: 'u?r?\'\'\'', end: '\'\'\'', | ||
begin: '(u|b)?r?\'\'\'', end: '\'\'\'', | ||
relevance: 10 | ||
@@ -15,3 +14,3 @@ }; | ||
className: 'string', | ||
begin: 'u?r?"""', end: '"""', | ||
begin: '(u|b)?r?"""', end: '"""', | ||
relevance: 10 | ||
@@ -21,3 +20,3 @@ }; | ||
className: 'string', | ||
begin: '(u|r|ur)\'', end: '\'', | ||
begin: '(u|r|ur|b|br)\'', end: '\'', | ||
contains: [hljs.BACKSLASH_ESCAPE], | ||
@@ -28,3 +27,3 @@ relevance: 10 | ||
className: 'string', | ||
begin: '(u|r|ur)"', end: '"', | ||
begin: '(u|r|ur|b|br)"', end: '"', | ||
contains: [hljs.BACKSLASH_ESCAPE], | ||
@@ -31,0 +30,0 @@ relevance: 10 |
@@ -5,3 +5,2 @@ /* | ||
Contributors: Peter Leonov <gojpeg@yandex.ru>, Vasily Polovnyov <vast@whiteants.net>, Loren Segal <lsegal@soen.ca> | ||
Category: common | ||
*/ | ||
@@ -8,0 +7,0 @@ |
/* | ||
Language: SQL | ||
Category: common | ||
*/ | ||
@@ -5,0 +4,0 @@ |
/* | ||
Language: HTML, XML | ||
Category: common | ||
*/ | ||
@@ -51,3 +50,4 @@ | ||
begin: '<!DOCTYPE', end: '>', | ||
relevance: 10 | ||
relevance: 10, | ||
contains: [{begin: '\\[', end: '\\]'}] | ||
}, | ||
@@ -54,0 +54,0 @@ { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1316156
72
9911
137