Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jochen Bauer
spn-website
Commits
aaaf7ab2
Commit
aaaf7ab2
authored
May 02, 2018
by
nachtgold
Committed by
Hubert Denkmair
May 03, 2018
Browse files
highlight.js restored because the docs page is using it
parent
762c1b39
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
core/static/core/highlight.js/CHANGES.md
0 → 100755
View file @
aaaf7ab2
This diff is collapsed.
Click to expand it.
core/static/core/highlight.js/LICENSE
0 → 100755
View file @
aaaf7ab2
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
core/static/core/highlight.js/README.md
0 → 100755
View file @
aaaf7ab2
# Highlight.js
[

](https://travis-ci.org/isagalaev/highlight.js)
Highlight.js is a syntax highlighter written in JavaScript. It works in
the browser as well as on the server. It works with pretty much any
markup, doesn’t depend on any framework and has automatic language
detection.
## Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
[
`initHighlightingOnLoad`][1
]:
```html
<link
rel=
"stylesheet"
href=
"/path/to/styles/default.css"
>
<script
src=
"/path/to/highlight.pack.js"
></script>
<script>
hljs.initHighlightingOnLoad();
</script>
```
This will find and highlight code inside of `<pre><code>` tags; it tries
to detect the language automatically. If automatic detection doesn’t
work for you, you can specify the language in the `class` attribute:
```
html
<pre><code
class=
"html"
>
...
</code></pre>
```
The list of supported language classes is available in the [class
reference][2]. Classes can also be prefixed with either `language-` or
`lang-`.
To disable highlighting altogether use the `nohighlight` class:
```
html
<pre><code
class=
"nohighlight"
>
...
</code></pre>
```
## Custom Initialization
When you need a bit more control over the initialization of
highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4]
functions. This allows you to control *what* to highlight and *when*.
Here’s an equivalent way to calling [`initHighlightingOnLoad`][1] using
jQuery:
```
javascript
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
```
You can use any tags instead of `<pre><code>` to mark up your code. If
you don't use a container that preserve line breaks you will need to
configure highlight.js to use the `<br>` tag:
```
javascript
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
```
For other options refer to the documentation for [`configure`][4].
## Web Workers
You can run highlighting inside a web worker to avoid freezing the browser
window while dealing with very big chunks of code.
In your main script:
```
javascript
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
```
In worker.js:
```
javascript
onmessage = function(event) {
importScripts('
<path>
/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
```
## Getting the Library
You can get highlight.js as a hosted, or custom-build, browser script or
as a server module. Right out of the box the browser script supports
both AMD and CommonJS, so if you wish you can use RequireJS or
Browserify without having to build from source. The server module also
works perfectly fine with Browserify, but there is the option to use a
build specific to browsers rather than something meant for a server.
Head over to the [download page][5] for all the options.
**Don't link to GitHub directly.** The library is not supposed to work straight
from the source, it requires building. If none of the pre-packaged options
work for you refer to the [building documentation][6].
**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be
too big. If you don't see the language you need in the ["Common" section][5],
it can be added manually:
```
html
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"
></script>
```
**On Almond.** You need to use the optimizer to give the module a name. For
example:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## License
Highlight.js is released under the BSD License. See [LICENSE][7] file
for details.
## Links
The official site for the library is at <https://highlightjs.org/>.
Further in-depth documentation for the API and other topics is at
<http://highlightjs.readthedocs.io/>.
Authors and contributors are listed in the [AUTHORS.en.txt][8] file.
[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block
[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options
[5]: https://highlightjs.org/download/
[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html
[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt
core/static/core/highlight.js/README.ru.md
0 → 100755
View file @
aaaf7ab2
# Highlight.js
Highlight.js — это инструмент для подсветки синтаксиса, написанный на JavaScript. Он работает
и в браузере, и на сервере. Он работает с практически любой HTML разметкой, не
зависит от каких-либо фреймворков и умеет автоматически определять язык.
## Начало работы
Минимум, что нужно сделать для использования highlight.js на веб-странице — это
подключить библиотеку, CSS-стили и вызывать
[
`initHighlightingOnLoad`
][
1
]
:
```
html
<link
rel=
"stylesheet"
href=
"/path/to/styles/default.css"
>
<script
src=
"/path/to/highlight.pack.js"
></script>
<script>
hljs
.
initHighlightingOnLoad
();
</script>
```
Библиотека найдёт и раскрасит код внутри тегов
`<pre><code>`
, попытавшись
автоматически определить язык. Когда автоопределение не срабатывает, можно явно
указать язык в атрибуте class:
```
html
<pre><code
class=
"html"
>
...
</code></pre>
```
Список поддерживаемых классов языков доступен в
[
справочнике по классам
][
2
]
.
Класс также можно предварить префиксами
`language-`
или
`lang-`
.
Чтобы отключить подсветку для какого-то блока, используйте класс
`nohighlight`
:
```
html
<pre><code
class=
"nohighlight"
>
...
</code></pre>
```
## Инициализация вручную
Чтобы иметь чуть больше контроля за инициализацией подсветки, вы можете
использовать функции
[
`highlightBlock`
][
3
]
и
[
`configure`
][
4
]
. Таким образом
можно управлять тем,
*что*
и
*когда*
подсвечивать.
Вот пример инициализации, эквивалентной вызову
[
`initHighlightingOnLoad`
][
1
]
, но
с использованием jQuery:
```
javascript
$
(
document
).
ready
(
function
()
{
$
(
'
pre code
'
).
each
(
function
(
i
,
block
)
{
hljs
.
highlightBlock
(
block
);
});
});
```
Вы можете использовать любые теги разметки вместо
`<pre><code>`
. Если
используете контейнер, не сохраняющий переводы строк, вам нужно сказать
highlight.js использовать для них тег
`<br>`
:
```
javascript
hljs
.
configure
({
useBR
:
true
});
$
(
'
div.code
'
).
each
(
function
(
i
,
block
)
{
hljs
.
highlightBlock
(
block
);
});
```
Другие опции можно найти в документации функции
[
`configure`
][
4
]
.
## Web Workers
Подсветку можно запустить внутри web worker'а, чтобы окно
браузера не подтормаживало при работе с большими кусками кода.
В основном скрипте:
```
javascript
addEventListener
(
'
load
'
,
function
()
{
var
code
=
document
.
querySelector
(
'
#code
'
);
var
worker
=
new
Worker
(
'
worker.js
'
);
worker
.
onmessage
=
function
(
event
)
{
code
.
innerHTML
=
event
.
data
;
}
worker
.
postMessage
(
code
.
textContent
);
})
```
В worker.js:
```
javascript
onmessage
=
function
(
event
)
{
importScripts
(
'
<path>/highlight.pack.js
'
);
var
result
=
self
.
hljs
.
highlightAuto
(
event
.
data
);
postMessage
(
result
.
value
);
}
```
## Установка библиотеки
Highlight.js можно использовать в браузере прямо с CDN хостинга или скачать
индивидуальную сборку, а также установив модуль на сервере. На
[
странице загрузки
][
5
]
подробно описаны все варианты.
**Не подключайте GitHub напрямую.**
Библиотека не предназначена для
использования в виде исходного кода, а требует отдельной сборки. Если вам не
подходит ни один из готовых вариантов, читайте
[
документацию по сборке
][
6
]
.
**Файл на CDN содержит не все языки.**
Иначе он будет слишком большого размера.
Если нужного вам языка нет в
[
категории "Common"
][
5
]
, можно дообавить его
вручную:
```
html
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"
></script>
```
**Про Almond.**
Нужно задать имя модуля в оптимизаторе, например:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## Лицензия
Highlight.js распространяется под лицензией BSD. Подробнее читайте файл
[
LICENSE
][
7
]
.
## Ссылки
Официальный сайт билиотеки расположен по адресу
<https://highlightjs.org/>
.
Более подробная документация по API и другим темам расположена на
<http://highlightjs.readthedocs.io/>
.
Авторы и контрибьюторы перечислены в файле
[
AUTHORS.ru.txt
][
8
]
file.
[
1
]:
http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[
2
]:
http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
[
3
]:
http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block
[
4
]:
http://highlightjs.readthedocs.io/en/latest/api.html#configure-options
[
5
]:
https://highlightjs.org/download/
[
6
]:
http://highlightjs.readthedocs.io/en/latest/building-testing.html
[
7
]:
https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[
8
]:
https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.ru.txt
core/static/core/highlight.js/highlight.pack.js
0 → 100755
View file @
aaaf7ab2
/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
!
function
(
e
){
var
n
=
"
object
"
==
typeof
window
&&
window
||
"
object
"
==
typeof
self
&&
self
;
"
undefined
"
!=
typeof
exports
?
e
(
exports
):
n
&&
(
n
.
hljs
=
e
({}),
"
function
"
==
typeof
define
&&
define
.
amd
&&
define
([],
function
(){
return
n
.
hljs
}))}(
function
(
e
){
function
n
(
e
){
return
e
.
replace
(
/&/g
,
"
&
"
).
replace
(
/</g
,
"
<
"
).
replace
(
/>/g
,
"
>
"
)}
function
t
(
e
){
return
e
.
nodeName
.
toLowerCase
()}
function
r
(
e
,
n
){
var
t
=
e
&&
e
.
exec
(
n
);
return
t
&&
0
===
t
.
index
}
function
a
(
e
){
return
k
.
test
(
e
)}
function
i
(
e
){
var
n
,
t
,
r
,
i
,
o
=
e
.
className
+
"
"
;
if
(
o
+=
e
.
parentNode
?
e
.
parentNode
.
className
:
""
,
t
=
B
.
exec
(
o
))
return
w
(
t
[
1
])?
t
[
1
]:
"
no-highlight
"
;
for
(
o
=
o
.
split
(
/
\s
+/
),
n
=
0
,
r
=
o
.
length
;
r
>
n
;
n
++
)
if
(
i
=
o
[
n
],
a
(
i
)
||
w
(
i
))
return
i
}
function
o
(
e
){
var
n
,
t
=
{},
r
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
for
(
n
in
e
)
t
[
n
]
=
e
[
n
];
return
r
.
forEach
(
function
(
e
){
for
(
n
in
e
)
t
[
n
]
=
e
[
n
]}),
t
}
function
u
(
e
){
var
n
=
[];
return
function
r
(
e
,
a
){
for
(
var
i
=
e
.
firstChild
;
i
;
i
=
i
.
nextSibling
)
3
===
i
.
nodeType
?
a
+=
i
.
nodeValue
.
length
:
1
===
i
.
nodeType
&&
(
n
.
push
({
event
:
"
start
"
,
offset
:
a
,
node
:
i
}),
a
=
r
(
i
,
a
),
t
(
i
).
match
(
/br|hr|img|input/
)
||
n
.
push
({
event
:
"
stop
"
,
offset
:
a
,
node
:
i
}));
return
a
}(
e
,
0
),
n
}
function
c
(
e
,
r
,
a
){
function
i
(){
return
e
.
length
&&
r
.
length
?
e
[
0
].
offset
!==
r
[
0
].
offset
?
e
[
0
].
offset
<
r
[
0
].
offset
?
e
:
r
:
"
start
"
===
r
[
0
].
event
?
e
:
r
:
e
.
length
?
e
:
r
}
function
o
(
e
){
function
r
(
e
){
return
"
"
+
e
.
nodeName
+
'
="
'
+
n
(
e
.
value
).
replace
(
'
"
'
,
"
"
"
)
+
'
"
'
}
s
+=
"
<
"
+
t
(
e
)
+
E
.
map
.
call
(
e
.
attributes
,
r
).
join
(
""
)
+
"
>
"
}
function
u
(
e
){
s
+=
"
</
"
+
t
(
e
)
+
"
>
"
}
function
c
(
e
){(
"
start
"
===
e
.
event
?
o
:
u
)(
e
.
node
)}
for
(
var
l
=
0
,
s
=
""
,
f
=
[];
e
.
length
||
r
.
length
;){
var
g
=
i
();
if
(
s
+=
n
(
a
.
substring
(
l
,
g
[
0
].
offset
)),
l
=
g
[
0
].
offset
,
g
===
e
){
f
.
reverse
().
forEach
(
u
);
do
c
(
g
.
splice
(
0
,
1
)[
0
]),
g
=
i
();
while
(
g
===
e
&&
g
.
length
&&
g
[
0
].
offset
===
l
);
f
.
reverse
().
forEach
(
o
)}
else
"
start
"
===
g
[
0
].
event
?
f
.
push
(
g
[
0
].
node
):
f
.
pop
(),
c
(
g
.
splice
(
0
,
1
)[
0
])}
return
s
+
n
(
a
.
substr
(
l
))}
function
l
(
e
){
return
e
.
v
&&!
e
.
cached_variants
&&
(
e
.
cached_variants
=
e
.
v
.
map
(
function
(
n
){
return
o
(
e
,{
v
:
null
},
n
)})),
e
.
cached_variants
||
e
.
eW
&&
[
o
(
e
)]
||
[
e
]}
function
s
(
e
){
function
n
(
e
){
return
e
&&
e
.
source
||
e
}
function
t
(
t
,
r
){
return
new
RegExp
(
n
(
t
),
"
m
"
+
(
e
.
cI
?
"
i
"
:
""
)
+
(
r
?
"
g
"
:
""
))}
function
r
(
a
,
i
){
if
(
!
a
.
compiled
){
if
(
a
.
compiled
=!
0
,
a
.
k
=
a
.
k
||
a
.
bK
,
a
.
k
){
var
o
=
{},
u
=
function
(
n
,
t
){
e
.
cI
&&
(
t
=
t
.
toLowerCase
()),
t
.
split
(
"
"
).
forEach
(
function
(
e
){
var
t
=
e
.
split
(
"
|
"
);
o
[
t
[
0
]]
=
[
n
,
t
[
1
]?
Number
(
t
[
1
]):
1
]})};
"
string
"
==
typeof
a
.
k
?
u
(
"
keyword
"
,
a
.
k
):
x
(
a
.
k
).
forEach
(
function
(
e
){
u
(
e
,
a
.
k
[
e
])}),
a
.
k
=
o
}
a
.
lR
=
t
(
a
.
l
||
/
\w
+/
,
!
0
),
i
&&
(
a
.
bK
&&
(
a
.
b
=
"
\\
b(
"
+
a
.
bK
.
split
(
"
"
).
join
(
"
|
"
)
+
"
)
\\
b
"
),
a
.
b
||
(
a
.
b
=
/
\B
|
\b
/
),
a
.
bR
=
t
(
a
.
b
),
a
.
e
||
a
.
eW
||
(
a
.
e
=
/
\B
|
\b
/
),
a
.
e
&&
(
a
.
eR
=
t
(
a
.
e
)),
a
.
tE
=
n
(
a
.
e
)
||
""
,
a
.
eW
&&
i
.
tE
&&
(
a
.
tE
+=
(
a
.
e
?
"
|
"
:
""
)
+
i
.
tE
)),
a
.
i
&&
(
a
.
iR
=
t
(
a
.
i
)),
null
==
a
.
r
&&
(
a
.
r
=
1
),
a
.
c
||
(
a
.
c
=
[]),
a
.
c
=
Array
.
prototype
.
concat
.
apply
([],
a
.
c
.
map
(
function
(
e
){
return
l
(
"
self
"
===
e
?
a
:
e
)})),
a
.
c
.
forEach
(
function
(
e
){
r
(
e
,
a
)}),
a
.
starts
&&
r
(
a
.
starts
,
i
);
var
c
=
a
.
c
.
map
(
function
(
e
){
return
e
.
bK
?
"
\\
.?(
"
+
e
.
b
+
"
)
\\
.?
"
:
e
.
b
}).
concat
([
a
.
tE
,
a
.
i
]).
map
(
n
).
filter
(
Boolean
);
a
.
t
=
c
.
length
?
t
(
c
.
join
(
"
|
"
),
!
0
):{
exec
:
function
(){
return
null
}}}}
r
(
e
)}
function
f
(
e
,
t
,
a
,
i
){
function
o
(
e
,
n
){
var
t
,
a
;
for
(
t
=
0
,
a
=
n
.
c
.
length
;
a
>
t
;
t
++
)
if
(
r
(
n
.
c
[
t
].
bR
,
e
))
return
n
.
c
[
t
]}
function
u
(
e
,
n
){
if
(
r
(
e
.
eR
,
n
)){
for
(;
e
.
endsParent
&&
e
.
parent
;)
e
=
e
.
parent
;
return
e
}
return
e
.
eW
?
u
(
e
.
parent
,
n
):
void
0
}
function
c
(
e
,
n
){
return
!
a
&&
r
(
n
.
iR
,
e
)}
function
l
(
e
,
n
){
var
t
=
N
.
cI
?
n
[
0
].
toLowerCase
():
n
[
0
];
return
e
.
k
.
hasOwnProperty
(
t
)
&&
e
.
k
[
t
]}
function
p
(
e
,
n
,
t
,
r
){
var
a
=
r
?
""
:
I
.
classPrefix
,
i
=
'
<span class="
'
+
a
,
o
=
t
?
""
:
C
;
return
i
+=
e
+
'
">
'
,
i
+
n
+
o
}
function
h
(){
var
e
,
t
,
r
,
a
;
if
(
!
E
.
k
)
return
n
(
k
);
for
(
a
=
""
,
t
=
0
,
E
.
lR
.
lastIndex
=
0
,
r
=
E
.
lR
.
exec
(
k
);
r
;)
a
+=
n
(
k
.
substring
(
t
,
r
.
index
)),
e
=
l
(
E
,
r
),
e
?(
B
+=
e
[
1
],
a
+=
p
(
e
[
0
],
n
(
r
[
0
]))):
a
+=
n
(
r
[
0
]),
t
=
E
.
lR
.
lastIndex
,
r
=
E
.
lR
.
exec
(
k
);
return
a
+
n
(
k
.
substr
(
t
))}
function
d
(){
var
e
=
"
string
"
==
typeof
E
.
sL
;
if
(
e
&&!
y
[
E
.
sL
])
return
n
(
k
);
var
t
=
e
?
f
(
E
.
sL
,
k
,
!
0
,
x
[
E
.
sL
]):
g
(
k
,
E
.
sL
.
length
?
E
.
sL
:
void
0
);
return
E
.
r
>
0
&&
(
B
+=
t
.
r
),
e
&&
(
x
[
E
.
sL
]
=
t
.
top
),
p
(
t
.
language
,
t
.
value
,
!
1
,
!
0
)}
function
b
(){
L
+=
null
!=
E
.
sL
?
d
():
h
(),
k
=
""
}
function
v
(
e
){
L
+=
e
.
cN
?
p
(
e
.
cN
,
""
,
!
0
):
""
,
E
=
Object
.
create
(
e
,{
parent
:{
value
:
E
}})}
function
m
(
e
,
n
){
if
(
k
+=
e
,
null
==
n
)
return
b
(),
0
;
var
t
=
o
(
n
,
E
);
if
(
t
)
return
t
.
skip
?
k
+=
n
:(
t
.
eB
&&
(
k
+=
n
),
b
(),
t
.
rB
||
t
.
eB
||
(
k
=
n
)),
v
(
t
,
n
),
t
.
rB
?
0
:
n
.
length
;
var
r
=
u
(
E
,
n
);
if
(
r
){
var
a
=
E
;
a
.
skip
?
k
+=
n
:(
a
.
rE
||
a
.
eE
||
(
k
+=
n
),
b
(),
a
.
eE
&&
(
k
=
n
));
do
E
.
cN
&&
(
L
+=
C
),
E
.
skip
||
(
B
+=
E
.
r
),
E
=
E
.
parent
;
while
(
E
!==
r
.
parent
);
return
r
.
starts
&&
v
(
r
.
starts
,
""
),
a
.
rE
?
0
:
n
.
length
}
if
(
c
(
n
,
E
))
throw
new
Error
(
'
Illegal lexeme "
'
+
n
+
'
" for mode "
'
+
(
E
.
cN
||
"
<unnamed>
"
)
+
'
"
'
);
return
k
+=
n
,
n
.
length
||
1
}
var
N
=
w
(
e
);
if
(
!
N
)
throw
new
Error
(
'
Unknown language: "
'
+
e
+
'
"
'
);
s
(
N
);
var
R
,
E
=
i
||
N
,
x
=
{},
L
=
""
;
for
(
R
=
E
;
R
!==
N
;
R
=
R
.
parent
)
R
.
cN
&&
(
L
=
p
(
R
.
cN
,
""
,
!
0
)
+
L
);
var
k
=
""
,
B
=
0
;
try
{
for
(
var
M
,
j
,
O
=
0
;;){
if
(
E
.
t
.
lastIndex
=
O
,
M
=
E
.
t
.
exec
(
t
),
!
M
)
break
;
j
=
m
(
t
.
substring
(
O
,
M
.
index
),
M
[
0
]),
O
=
M
.
index
+
j
}
for
(
m
(
t
.
substr
(
O
)),
R
=
E
;
R
.
parent
;
R
=
R
.
parent
)
R
.
cN
&&
(
L
+=
C
);
return
{
r
:
B
,
value
:
L
,
language
:
e
,
top
:
E
}}
catch
(
T
){
if
(
T
.
message
&&-
1
!==
T
.
message
.
indexOf
(
"
Illegal
"
))
return
{
r
:
0
,
value
:
n
(
t
)};
throw
T
}}
function
g
(
e
,
t
){
t
=
t
||
I
.
languages
||
x
(
y
);
var
r
=
{
r
:
0
,
value
:
n
(
e
)},
a
=
r
;
return
t
.
filter
(
w
).
forEach
(
function
(
n
){
var
t
=
f
(
n
,
e
,
!
1
);
t
.
language
=
n
,
t
.
r
>
a
.
r
&&
(
a
=
t
),
t
.
r
>
r
.
r
&&
(
a
=
r
,
r
=
t
)}),
a
.
language
&&
(
r
.
second_best
=
a
),
r
}
function
p
(
e
){
return
I
.
tabReplace
||
I
.
useBR
?
e
.
replace
(
M
,
function
(
e
,
n
){
return
I
.
useBR
&&
"
\n
"
===
e
?
"
<br>
"
:
I
.
tabReplace
?
n
.
replace
(
/
\t
/g
,
I
.
tabReplace
):
""
}):
e
}
function
h
(
e
,
n
,
t
){
var
r
=
n
?
L
[
n
]:
t
,
a
=
[
e
.
trim
()];
return
e
.
match
(
/
\b
hljs
\b
/
)
||
a
.
push
(
"
hljs
"
),
-
1
===
e
.
indexOf
(
r
)
&&
a
.
push
(
r
),
a
.
join
(
"
"
).
trim
()}
function
d
(
e
){
var
n
,
t
,
r
,
o
,
l
,
s
=
i
(
e
);
a
(
s
)
||
(
I
.
useBR
?(
n
=
document
.
createElementNS
(
"
http://www.w3.org/1999/xhtml
"
,
"
div
"
),
n
.
innerHTML
=
e
.
innerHTML
.
replace
(
/
\n
/g
,
""
).
replace
(
/<br
[
\/]
*>/g
,
"
\n
"
)):
n
=
e
,
l
=
n
.
textContent
,
r
=
s
?
f
(
s
,
l
,
!
0
):
g
(
l
),
t
=
u
(
n
),
t
.
length
&&
(
o
=
document
.
createElementNS
(
"
http://www.w3.org/1999/xhtml
"
,
"
div
"
),
o
.
innerHTML
=
r
.
value
,
r
.
value
=
c
(
t
,
u
(
o
),
l
)),
r
.
value
=
p
(
r
.
value
),
e
.
innerHTML
=
r
.
value
,
e
.
className
=
h
(
e
.
className
,
s
,
r
.
language
),
e
.
result
=
{
language
:
r
.
language
,
re
:
r
.
r
},
r
.
second_best
&&
(
e
.
second_best
=
{
language
:
r
.
second_best
.
language
,
re
:
r
.
second_best
.
r
}))}
function
b
(
e
){
I
=
o
(
I
,
e
)}
function
v
(){
if
(
!
v
.
called
){
v
.
called
=!
0
;
var
e
=
document
.
querySelectorAll
(
"
pre code
"
);
E
.
forEach
.
call
(
e
,
d
)}}
function
m
(){
addEventListener
(
"
DOMContentLoaded
"
,
v
,
!
1
),
addEventListener
(
"
load
"
,
v
,
!
1
)}
function
N
(
n
,
t
){
var
r
=
y
[
n
]
=
t
(
e
);
r
.
aliases
&&
r
.
aliases
.
forEach
(
function
(
e
){
L
[
e
]
=
n
})}
function
R
(){
return
x
(
y
)}
function
w
(
e
){
return
e
=
(
e
||
""
).
toLowerCase
(),
y
[
e
]
||
y
[
L
[
e
]]}
var
E
=
[],
x
=
Object
.
keys
,
y
=
{},
L
=
{},
k
=
/^
(
no-
?
highlight|plain|text
)
$/i
,
B
=
/
\b
lang
(?:
uage
)?
-
([\w
-
]
+
)\b
/i
,
M
=
/
((
^
(
<
[^
>
]
+>|
\t
|
)
+|
(?:\n)))
/gm
,
C
=
"
</span>
"
,
I
=
{
classPrefix
:
"
hljs-
"
,
tabReplace
:
null
,
useBR
:
!
1
,
languages
:
void
0
};
return
e
.
highlight
=
f
,
e
.
highlightAuto
=
g
,
e
.
fixMarkup
=
p
,
e
.
highlightBlock
=
d
,
e
.
configure
=
b
,
e
.
initHighlighting
=
v
,
e
.
initHighlightingOnLoad
=
m
,
e
.
registerLanguage
=
N
,
e
.
listLanguages
=
R
,
e
.
getLanguage
=
w
,
e
.
inherit
=
o
,
e
.
IR
=
"
[a-zA-Z]
\\
w*
"
,
e
.
UIR
=
"
[a-zA-Z_]
\\
w*
"
,
e
.
NR
=
"
\\
b
\\
d+(
\\
.
\\
d+)?
"
,
e
.
CNR
=
"
(-?)(
\\
b0[xX][a-fA-F0-9]+|(
\\
b
\\
d+(
\\
.
\\
d*)?|
\\
.
\\
d+)([eE][-+]?
\\
d+)?)
"
,
e
.
BNR
=
"
\\
b(0b[01]+)
"
,
e
.
RSR
=
"
!|!=|!==|%|%=|&|&&|&=|
\\
*|
\\
*=|
\\
+|
\\
+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|
\\
?|
\\
[|
\\
{|
\\
(|
\\
^|
\\
^=|
\\
||
\\
|=|
\\
|
\\
||~
"
,
e
.
BE
=
{
b
:
"
\\\\
[
\\
s
\\
S]
"
,
r
:
0
},
e
.
ASM
=
{
cN
:
"
string
"
,
b
:
"
'
"
,
e
:
"
'
"
,
i
:
"
\\
n
"
,
c
:[
e
.
BE
]},
e
.
QSM
=
{
cN
:
"
string
"
,
b
:
'
"
'
,
e
:
'
"
'
,
i
:
"
\\
n
"
,
c
:[
e
.
BE
]},
e
.
PWM
=
{
b
:
/
\b(
a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more
)\b
/
},
e
.
C
=
function
(
n
,
t
,
r
){
var
a
=
e
.
inherit
({
cN
:
"
comment
"
,
b
:
n
,
e
:
t
,
c
:[]},
r
||
{});
return
a
.
c
.
push
(
e
.
PWM
),
a
.
c
.
push
({
cN
:
"
doctag
"
,
b
:
"
(?:TODO|FIXME|NOTE|BUG|XXX):
"
,
r
:
0
}),
a
},
e
.
CLCM
=
e
.
C
(
"
//
"
,
"
$
"
),
e
.
CBCM
=
e
.
C
(
"
/
\\
*
"
,
"
\\
*/
"
),
e
.
HCM
=
e
.
C
(
"
#
"
,
"
$
"
),
e
.
NM
=
{
cN
:
"
number
"
,
b
:
e
.
NR
,
r
:
0
},
e
.
CNM
=
{
cN
:
"
number
"
,
b
:
e
.
CNR
,
r
:
0
},
e
.
BNM
=
{
cN
:
"
number
"
,
b
:
e
.
BNR
,
r
:
0
},
e
.
CSSNM
=
{
cN
:
"
number
"
,
b
:
e
.
NR
+
"
(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?
"
,
r
:
0
},
e
.
RM
=
{
cN
:
"
regexp
"
,
b
:
/
\/
/
,
e
:
/
\/[
gimuy
]
*/
,
i
:
/
\n
/
,
c
:[
e
.
BE
,{
b
:
/
\[
/
,
e
:
/
\]
/
,
r
:
0
,
c
:[
e
.
BE
]}]},
e
.
TM
=
{
cN
:
"
title
"
,
b
:
e
.
IR
,
r
:
0
},
e
.
UTM
=
{
cN
:
"
title
"
,
b
:
e
.
UIR
,
r
:
0
},
e
.
METHOD_GUARD
=
{
b
:
"
\\
.
\\
s*
"
+
e
.
UIR
,
r
:
0
},
e
});
hljs
.
registerLanguage
(
"
lua
"
,
function
(
e
){
var
t
=
"
\\
[=*
\\
[
"
,
a
=
"
\\
]=*
\\
]
"
,
r
=
{
b
:
t
,
e
:
a
,
c
:[
"
self
"
]},
n
=
[
e
.
C
(
"
--(?!
"
+
t
+
"
)
"
,
"
$
"
),
e
.
C
(
"
--
"
+
t
,
a
,{
c
:[
r
],
r
:
10
})];
return
{
l
:
e
.
UIR
,
k
:{
literal
:
"
true false nil
"
,
keyword
:
"
and break do else elseif end for goto if in local not or repeat return then until while
"
,
built_in
:
"
_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstringmodule next pairs pcall print rawequal rawget rawset require select setfenvsetmetatable tonumber tostring type unpack xpcall arg selfcoroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove
"
},
c
:
n
.
concat
([{
cN
:
"
function
"
,
bK
:
"
function
"
,
e
:
"
\\
)
"
,
c
:[
e
.
inherit
(
e
.
TM
,{
b
:
"
([_a-zA-Z]
\\
w*
\\
.)*([_a-zA-Z]
\\
w*:)?[_a-zA-Z]
\\
w*
"
}),{
cN
:
"
params
"
,
b
:
"
\\
(
"
,
eW
:
!
0
,
c
:
n
}].
concat
(
n
)},
e
.
CNM
,
e
.
ASM
,
e
.
QSM
,{
cN
:
"
string
"
,
b
:
t
,
e
:
a
,
c
:[
r
],
r
:
5
}])}});
\ No newline at end of file
core/static/core/highlight.js/styles/agate.css
0 → 100755
View file @
aaaf7ab2
/*!
* Agate by Taufik Nurrohman <https://github.com/tovic>
* ----------------------------------------------------
*
* #ade5fc
* #a2fca2
* #c6b4f0
* #d36363
* #fcc28c
* #fc9b9b
* #ffa
* #fff
* #333
* #62c8f3
* #888
*
*/
pre
code
.hljs
{
display
:
block
;
overflow-x
:
auto
;
padding
:
0.5em
;
background
:
#333
;
color
:
white
;
}
pre
code
.hljs-name
,
pre
code
.hljs-strong
{
font-weight
:
bold
;
}
pre
code
.hljs-code
,
pre
code
.hljs-emphasis
{
font-style
:
italic
;
}
pre
code
.hljs-tag
{
color
:
#62c8f3
;
}
pre
code
.hljs-variable
,
pre
code
.hljs-template-variable
,
pre
code
.hljs-selector-id
,
pre
code
.hljs-selector-class
{
color
:
#ade5fc
;
}
pre
code
.hljs-string
,
pre
code
.hljs-bullet
{
color
:
#a2fca2
;
}
pre
code
.hljs-type
,
pre
code
.hljs-title
,
pre
code
.hljs-section
,
pre
code
.hljs-attribute
,
pre
code
.hljs-quote
,
pre
code
.hljs-built_in
,
pre
code
.hljs-builtin-name
{
color
:
#ffa
;
}
pre
code
.hljs-number
,
pre
code
.hljs-symbol
,
pre
code
.hljs-bullet
{
color
:
#d36363
;
}
pre
code
.hljs-keyword
,
pre
code
.hljs-selector-tag
,
pre
code
.hljs-literal
{
color
:
#fcc28c
;
}
pre
code
.hljs-comment
,
pre
code
.hljs-deletion
,
pre
code
.hljs-code
{
color
:
#888
;
}
pre
code
.hljs-regexp
,
pre
code
.hljs-link
{
color
:
#c6b4f0
;
}
pre
code
.hljs-meta
{
color
:
#fc9b9b
;
}
pre
code
.hljs-deletion
{
background-color
:
#fc9b9b
;
color
:
#333
;
}
pre
code
.hljs-addition
{
background-color
:
#a2fca2
;
color
:
#333
;
}
pre
code
.hljs
a
{
color
:
inherit
;
}
pre
code
.hljs
a
:focus
,
pre
code
.hljs
a
:hover
{
color
:
inherit
;
text-decoration
:
underline
;
}
core/static/docs/docs.css
View file @
aaaf7ab2
...
...
@@ -4,11 +4,12 @@
}
.docs_container
{
background-color
:
#
1a2632
;
background-color
:
#
000000
A0
;
color
:
#fff
;
margin-left
:
200px
;
min-width
:
400px
;
width
:
80%
;
padding
:
14px
;
width
:
80%
;
}
.markdown-body
pre
.usage
{
...
...
docs/lua/ldoc/ldoc/html/ldoc_snake_ltp.lua
View file @
aaaf7ab2
...
...
@@ -9,9 +9,15 @@ return [==[
{% endblock %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static "core/highlight.js/styles/agate.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "docs/docs.css" %}" />
{% endblock %}
{% block js%}
<script src="{% static "core/highlight.js/highlight.pack.js" %}"></script>
<script>hljs.initHighlightingOnLoad();</script>
{% endblock %}
{% block content %}
<div class="docs_container markdown-body">
...
...
docs/templates/docs/docs.html
View file @
aaaf7ab2
...
...
@@ -8,9 +8,15 @@
{% endblock %}
{% block css %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
core
/
highlight.js
/
styles
/
agate.css
"
%}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
docs
/
docs.css
"
%}"
/>
{% endblock %}
{% block js%}
<script
src=
"{% static "
core
/
highlight.js
/
highlight.pack.js
"
%}"
></script>
<script>
hljs
.
initHighlightingOnLoad
();
</script>
{% endblock %}
{% block content %}
<div
class=
"docs_container markdown-body"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment