forked from EnlighterJS/EnlighterJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevelopment.phtml
More file actions
254 lines (207 loc) · 8.95 KB
/
Development.phtml
File metadata and controls
254 lines (207 loc) · 8.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon !-->
<link rel="icon" href="Resources/favicon.png" type="image/png">
<title>EnlighterJS Playground</title>
<!-- Bootstrap CSS - just 4 styling ;) -->
<link rel="stylesheet" href="Resources/bootstrap.min.css">
<link rel="stylesheet" href="Resources/bootstrap-theme.min.css">
<link rel="stylesheet" href="Resources/Template.css">
<!-- Include MooTools Framework (MooTools.MORE ist only required for development!) -->
<script type="text/javascript" src="Resources/mootools-core-1.4.5-full-nocompat.js"></script>
<script type="text/javascript" src="Resources/mootools-more-1.4.0.1.js"></script>
<!-- EnlighterJS Sourcefile Loader -->
<script type="text/javascript" src="Build/DynamicSourcefileLoader.dev.js"></script>
<script type="text/javascript">
// attention: don't use load or domready here! the jsloaded event is triggered by DynamicSourcefileLoader
window.addEvent('jsloaded', function(){
var options = {
language : 'javascript',
indent : 4
};
//document.getElements('pre.special').enlight(options);
//document.id('NoLight').enlight(true).enlight(false);
EnlighterJS.Util.Helper(document.getElements('pre.special'), {
language : 'js',
theme: 'git',
rawButton: true
});
EnlighterJS.Util.Helper(document.getElements('code.special'), {
language : 'js',
renderer : 'Inline'
});
});
</script>
</head>
<body>
<!-- Topnav -->
<div id="navbar-wrapper">
<div class="container">
<div class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<a class="navbar-brand" href="Quickstart.html">EnlighterJS</a>
</div>
<ul class="nav navbar-nav">
<li><a href="Quickstart.html">Quickstart</a></li>
<li class="dropdown"><a href="#">Examples<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Languages</li>
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="dropdown-header">Initialization</li>
<li><a href="Metainit.html">Metatag based</a></li>
</ul></li>
<li><a href="Themes.html">Themes</a></li>
<li><a href="http://wordpress.org/plugins/enlighter/">Plugins<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://wordpress.org/plugins/enlighter/">Enlighter for WordPress</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/AndiDittrich/EnlighterJS/archive/master.zip">Get EnlighterJS<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Get it from GitHub</li>
<li><a href="https://github.com/AndiDittrich/EnlighterJS/archive/master.zip">Download (latest)</a></li>
<li><a href="https://github.com/AndiDittrich/EnlighterJS">Browse on GitHub</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!-- // topnav -->
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>
<strong>EnlighterJS</strong> <small>Advanced Javascript Syntax Highlighter</small>
</h1>
</div>
<div id="content">
<!-- ############################################################# -->
<h2>Inline Content</h2>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
<code class="special">window.addEvent('domready', function(){});</code>
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.<br /> Lorem ipsum dolor sit amet,
<code>not highlighted</code>
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<h2>Single JS Testcode</h2>
<pre class="special">
window.addEvent('domready', function(){
// metadata config available ? -> autoinit
var m = document.getElement('meta[name="EnlighterJS"]');
// check instance
if (!m){
return;
}
// create new options object
var options = {
language: m.get('data-language') || 'generic',
theme: m.get('data-theme') || 'Enlighter',
indent: m.get('data-indent').toInt() || -1,
hover: m.get('data-hover') || 'hoverEnabled'
};
// selector available ? if not, match all pre-tags
var blockSelector = m.get('data-selector-block') || 'pre';
// selector available ? if not, match all code-tags
var inlineSelector = m.get('data-selector-inline') || 'code';
});
</pre>
<h2>JS Testcode</h2>
<pre class="special" data-enlighter-group="g1" id="Lightit1" data-enlighter-lineoffset="5" data-enlighter-title="Javascript1" data-enlighter-highlight="10,16-19">
window.addEvent('domready', function(){
// metadata config available ? -> autoinit
var m = document.getElement('meta[name="EnlighterJS"]');
// check instance
if (!m){
return;
}
// create new options object
var options = {
language: m.get('data-language') || 'generic',
theme: m.get('data-theme') || 'Enlighter',
indent: m.get('data-indent').toInt() || -1,
hover: m.get('data-hover') || 'hoverEnabled'
};
// selector available ? if not, match all pre-tags
var blockSelector = m.get('data-selector-block') || 'pre';
// selector available ? if not, match all code-tags
var inlineSelector = m.get('data-selector-inline') || 'code';
});
</pre>
<pre class="special" data-enlighter-group="g1" data-enlighter-linenums="true" data-enlighter-title="TypeScript ?!" data-enlighter-theme="mootools">
// create output container element
var container = new Element(this.options.containerTag);
// set class and id attributes.
container.addClass(theme + 'EnlighterJS');
container.addClass('EnlighterJSRendered');
container.set('id', 'EnlighterJS_' + String.uniqueID());
// generate output based on ordered list of tokens
language.getTokens().each(function(token, index){
// get classname
var className = token.type ? (language.aliases[token.type] || token.type) : '';
// create new inline element which contains the token - htmlspecialchars get escaped by mootools setText !
container.grab(new Element('span', {
'class': className,
'text': token.text
}));
});
return container;
</pre>
<pre class="special" data-enlighter-group="g1" data-enlighter-linenums="true" data-enlighter-theme="mootools">
// set class and id attributes.
container.addClass(theme + 'EnlighterJS');
container.addClass('EnlighterJSRendered');
container.set('id', 'EnlighterJS_' + String.uniqueID());
</pre>
<h2>No-Highlight</h2>
<pre data-enlighter-language="no-highlight" data-enlighter-highlight="3,6-9" id="NoLight" class="special">
// create output container element
var container = new Element(this.options.containerTag);
// set class and id attributes.
container.addClass(theme + 'EnlighterJS');
container.addClass('EnlighterJSRendered');
container.set('id', 'EnlighterJS_' + String.uniqueID());
</pre>
<h2>Inline Code</h2>
<p>
EnlighterJS also supports
<code class="special" data-enlighter-language="js">alert('Inline Sourcecode highlighting');</code>
(since version 1.8).
</p>
<h2>Custom Language</h2>
<pre class="special" data-enlighter-language="mylang">
<!##
# This is a hash-style-comment
if FILE == 123.123 then
echo 'testcase'
elseif
echo "OH NO"
endif
##!>
</pre>
<!-- ############################################################# -->
</div>
<!-- // content -->
</div>
<!-- // container -->
<!-- Sticky Footer Message -->
<div id="footer">
<div class="container">
<p class="text-muted">
<strong>EnlighterJS</strong> is developed by <a href="http://andidittrich.de">Andi Dittrich</a><br /> <a href="https://github.com/AndiDittrich/EnlighterJS/archive/master.zip">Download</a> EnlighterJS on <a href="https://github.com/AndiDittrich/EnlighterJS">GitHub</a> | It's released under the Terms of <a href="../LICENSE.md">MIT X11 License</a> | Demo created with <a href="http://getbootstrap.com">Bootstrap</a>
</p>
</div>
</div>
<!-- // Sticky Footer Message -->
</body>
</html>