-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-wells.html
More file actions
415 lines (313 loc) · 20.5 KB
/
Copy pathcode-wells.html
File metadata and controls
415 lines (313 loc) · 20.5 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata for the Webpage -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrapr · Code Wells</title>
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="img/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
<link rel="manifest" href="img/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- Bootstrap CSS files-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery UI CSS (optional) -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<!-- Google web fonts -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:500,600" rel="stylesheet">
<link rel="stylesheet" href="https://use.typekit.net/cti7nio.css">
<!-- CSS Animations --> <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<!-- Font Awesome Web Icons -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Main local stylesheet -->
<link rel="stylesheet" href="css/main.css">
<!-- Prettify theme -->
<link rel="stylesheet" href="css/prettify-theme.css">
</head>
<body id="top">
<!-- Navbar include -->
<div w3-include-html="navbar.html"></div>
<div class="container main-content">
<div class="row add-100">
<div class="col-sm-6">
<ol class="breadcrumb">
<li><a href="index.html">Bootstrapr</a></li>
<li class="active">Code Wells</li>
</ol>
</div>
<!-- col-sm-6 -->
<div class="col-sm-6">
<p class="pull-right">
<i class="fa fa-fw fa-bookmark gray" aria-hidden="true"></i>
<a href="https://getbootstrap.com/docs/3.3/" target="_blank">Bootstrap 3.3.7</a> | <a href="https://getbootstrap.com/docs/3.3/css/#code" target="_blank"><span id="docs-link">Code wells</span></a>
</p>
</div>
<!-- col-sm-4-->
</div>
<!-- .row -->
<div class="row">
<div class="col-sm-12">
<h1>Code Wells</h1>
<p class="lead">Code wells display computer languages in a highly readable format.</p>
<p>Code Wells are rendered with the <code><pre></code> element. Google's Prettify package is used to color-code the output. Unlike other HTML elements, the <code><pre></code> element preserves all spacing exactly as you type
it. In most cases, the tool will autodetect your language and color the code accordingly.</p>
</div>
</div>
<hr class="divider">
<div class="row">
<div class="col-sm-3">
<form>
<div class="form-group">
<label for="list-type">Language Type</label>
<select class="form-control" id="language-type">
<option value="" selected="selected">Auto</option>
<option value="" disabled="disabled">----------------------------------</option>
<option value=" lang-css">CSS</option>
<option value=" lang-html">HTML</option>
<option value=" lang-js">Javascript</option>
<option value="" disabled="disabled">----------------------------------</option>
<option value=" lang-bsh">Bash</option>
<option value=" lang-c">C</option>
<option value=" lang-cpp">C++</option>
<option value=" lang-java">Java</option>
<option value=" lang-py">Python</option>
<option value=" lang-perl">Perl</option>
<option value=" lang-rb">Ruby</option>
<option value=" lang-xml">XML</option>
</select>
</div>
<div class="form-group">
<label for="blockquote-quote">Paste Code Snippet</label>
<textarea id="code-snippet" class="form-control" rows="20"></textarea>
</div>
<label for="line-numbers" class="push-down-1">Add Line Numbers</label>
<div class="checkbox">
<label class="switch">
<input type="checkbox" id="line-numbers">
<span class="slider round"></span>
</label>
</div>
</form>
<div class="push-down-2 button-box" id="action-buttons">
<button type="button" class="btn btn-primary pull-right" id="build-button"><i class="fa fa-fw fa-cogs" aria-hidden="true"></i> Build </button>
<button type="button" class="btn btn-default pull-right" id="clear-form"><i class="fa fa-refresh fa-fw" aria-hidden="true"></i> <span class="hidden-xs hidden-sm">Reset</span></button>
</div>
</div>
<!-- .col-sm-3 -->
<div class="col-sm-9">
<div class="example" id="simple-example">
<pre class="prettyprint linenums">
// This is a javascript comment
$( document ).ready(function() {
$('.navfeatures').addClass('active');
$('.navcodewells').addClass('active');
});
</pre>
</div>
<div class="well">
<!-- Copier-->
<button class="btn btn-code-well pull-right copier" type="button" data-clipboard-demo="" data-clipboard-target="#simple-code" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-fw fa-clipboard"
aria-hidden="true"></i> Copy</button>
<!-- Beautifier -->
<button class="btn btn-code-well pull-left disabled" type="button" data-clipboard-demo="" data-toggle="tooltip" data-placement="bottom" title="Already Prettified"><i class="fa fa-indent fa-fw" aria-hidden="true"></i> Prettify
</button>
<!-- Update Example Panel-->
<button id="update-preview" class="btn btn-code-well pull-left" type="button" data-clipboard-demo="" data-toggle="tooltip" data-placement="bottom" title="Update Example window"><i class="fa fa-fw fa-arrows-v" aria-hidden="true"></i>
Update Example</button>
<hr class="well-separator">
<pre class="prettyprint lang-html" id="simple-code" contenteditable="true">
<pre class='prettyprint linenums'>
// This is a javascript comment
$( document ).ready(function() {
$('.navfeatures').addClass('active');
$('.navcodewells').addClass('active');
});
</pre>
</pre>
</div>
<!-- example closes -->
<h4 class="sub-header">Custom CSS</h4>
<p>Custom CSS is required if you wish to disable the alternating backgrounds on numbered lines. Alternating backgrounds on numbered lines are fine on lighter backgrounds but generally look poor on darker backgrounds.</p>
<div class="well">
<!-- Copier-->
<button class="btn btn-code-well pull-right copier" type="button" data-clipboard-demo="" data-clipboard-target="#custom-css-code" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-fw fa-clipboard"
aria-hidden="true"></i> Copy</button>
<!-- Update Example Panel-->
<a id="download-all-css" class="btn btn-code-well pull-left" type="button" data-toggle="tooltip" data-placement="bottom" title="View all Bootstrapr CSS" role="button" href="css/all-bootstrapr-css.css" target="_blank"><i class="fa fa-fw fa-css3"
aria-hidden="true"></i> View all Bootstrapr CSS</a>
<hr class="well-separator">
<pre class="prettyprint lang-css" contenteditable="true" id="custom-css-code">
/* Disables the background for alternating line numbers */
ol.linenums li {
background: transparent !important;
}
</pre>
</div>
<!-- .well -->
<h4 class="sub-header">Notes</h4>
<div class='alert alert-info push-down-1' role='alert'>
<p><i class="fa fa-fw fa-code" aria-hidden="true"></i><a class='close' data-dismiss='alert' aria-label='close'>×</a><strong>Theme Colors</strong><br />There are many color themes available for syntax highlighting. I have used Google's
dark theme <a href="https://github.com/google/code-prettify/blob/master/styles/sunburst.css">sunburst.css</a>. For more themes, see <a href="https://rawgit.com/google/code-prettify/master/styles/index.html" target="_blank">this
theme gallery</a> or <a href="https://jmblog.github.io/color-themes-for-google-code-prettify/" target="_blank">this other theme gallery</a>.</p>
</div>
<h4 class="sub-header">Including Google Prettify</h4>
<p>To include Google's syntax highlighter for your Web page, follow these steps. For more information on serving and customizing Prettify, see the <a href="https://github.com/google/code-prettify" target="_blank">Code-Prettify
documentation</a>.</p>
<table class="table numbered-steps">
<thead></thead>
<tbody>
<tr>
<td style="width: 10%">1</td>
<td style="width: 80%">Inlcude a link to a cloud-hosted <strong>prettify.js</strong> file within the <code><head></code> element of your HTML file.
<pre class='prettyprint lang-html' id="well-step0">
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</pre>
</td>
<td><button class="btn btn-code-well copier center-block" type="button" data-clipboard-demo="" data-clipboard-target="#well-step0" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-clipboard"
aria-hidden="true"></i> Copy</button></td>
</tr>
<tr>
<td>2</td>
<td>Add the <code>.prettyprint</code> class to your <code><pre></code> element.
<pre class='prettyprint' id="well-step1">
<pre class="prettyprint"> ... </pre>
</pre>
</td>
<td><button class="btn btn-code-well copier center-block" type="button" data-clipboard-demo="" data-clipboard-target="#well-step1" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-clipboard"
aria-hidden="true"></i> Copy</button></td>
</tr>
<tr>
<td>3</td>
<td>Although in many cases, Prettify will auto-detect your language, we recommend specifying it explicitly.
<pre class='prettyprint lang-html' id="well-step2">
<pre class='prettyprint lang-css'> ... Your code here ... </pre>
</pre>
</td>
<td><button class="btn btn-code-well copier center-block" type="button" data-clipboard-demo="" data-clipboard-target="#well-step2" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-clipboard"
aria-hidden="true"></i> Copy</button></td>
</tr>
<tr>
<td>4</td>
<td>
<p>If your language <a href='https://github.com/google/code-prettify#how-do-i-specify-the-language-of-my-code' target='_blank'>is not supported natively</a>—as is the case with CSS—you will need to include a link
to the specific language
file. First, download the appropriate language file from the following list:</p>
<p class='push-down-1' style='padding: 10px'><a href='https://github.com/google/code-prettify/blob/master/src/lang-apollo.js'>Apollo</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-basic.js'>Basic</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-clj.js'>Clojure</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-css.js'>CSS</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-dart.js'>Dart</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-erlang.js'>Erlang</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-go.js'>Go</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-hs.js'>Haskell</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-lasso.js'>Lasso</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-lisp.js'>Lisp/Scheme</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-llvm.js'>LLVM</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-logtalk.js'>Logtalk</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-lua.js'>Lua</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-matlab.js'>MATLAB</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-ml.js'>MLs: F#, Ocaml, SML</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-mumps.js'>Mumps</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-n.js'>Nemerle</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-pascal.js'>Pascal</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-proto.js'>Protocol
Buffers</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-r.js'>R, S</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-rd.js'>RD</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-rust.js'>Rust</a>,
<a href='https://github.com/google/code-prettify/blob/master/src/lang-scala.js'>Scala</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-sql.js'>SQL</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-swift.js'>Swift</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-tcl.js'>TCL</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-tex.js'>LaTeX</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-vb.js'>Visual Basic</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-vhdl.js'>VHDL</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-wiki.js'>Wiki</a>
, <a href='https://github.com/google/code-prettify/blob/master/src/lang-xq.js'>XQ</a>, <a href='https://github.com/google/code-prettify/blob/master/src/lang-yaml.js'>YAML</a></p>
<p>Next, serve it from a subdirectory of your Web site, such as:
<pre class='prettyprint' id="well-step3">
<script type="text/javascript" src="js/lang-css.js"> ... </script>
</pre>
</p>
</td>
<td><button class="btn btn-code-well copier push-down-3" type="button" data-clipboard-demo="" data-clipboard-target="#well-step3" data-toggle="tooltip" data-placement="bottom" title="Copy to Clipboard"><i class="fa fa-clipboard"
aria-hidden="true"></i> Copy</button></td>
</tr>
</tbody>
</table>
</div>
<!-- .col-sm-9 -->
</div>
<!-- .row -->
</div>
<!-- .container-fluid -->
<!-- Navbar include -->
<div w3-include-html="footer.html"></div>
<!-- Confirmation modal -->
<div id="dialog-confirm" title="Reset Form">
<p>This will reset the form. Are you sure?</p>
</div>
<!-- Animations JS -->
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<!-- Back-to-top button -->
<a role="button" id="topper" class="btn scroll-link" href="#top"><i class="fa fa-fw fa-2x fa-caret-up" aria-hidden="true"></i></a>
<!-- jQuery Javascript Library (required by Bootstrap) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
<!-- jQuery UI Library (optional) -->
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- Bootstrap Library -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>window.jQuery.fn.modal || document.write('<script src="js/bootstrap.min.js"><\/script>')</script>
<script>
(function($) {
$(function() {
if ($('body').css('color') !== 'rgb(246, 247, 251)') {
$('head').prepend('<link rel="stylesheet" href="css/bootstrap.min.css">');
$('head').prepend('<link rel="stylesheet" href="css/fontawesome-local.css">');
}
});
})(window.jQuery);
</script>
<!-- Main local script file -->
<script src="js/main.js"></script>
<!-- includes for Google's code highlighter 'prettyprint' -->
<link rel="stylesheet" type="text/css" href="css/prettify.css">
<script type="text/javascript" src="js/prettify.js"></script>
<script type="text/javascript" src="js/lang-css.js"></script>
<!-- html file include script | used for navbar -->
<script src="js/w3data.js"></script>
<script>
w3IncludeHTML();
</script>
<!-- clipboard.js include -->
<script src="js/clipboard.min.js"></script>
<script>
$(document).ready(function() {
// tooltips function
$(function() {
$('[data-toggle="tooltip"]').tooltip()
})
var lineNumbers = "";
// Add active class to navmenu selection
$("li#code-wells").addClass("active");
$("#containers-dropdown").addClass("activated");
$('#build-button').click(function() {
if ($('#line-numbers').is(':checked')) {
lineNumbers = " linenums";
} else {
lineNumbers = "";
}
var langType = $("#language-type").val();
var theCode = $('#code-snippet').val();
theCode = theCode.replace(/[>]/g, '>');
theCode = theCode.replace(/[<]/g, '<');
var theNewCode = "<pre class='prettyprint" + lineNumbers + langType + "'>" + "\n" + theCode + "\n" + "</pre>";
$('#get-entities').val(theNewCode);
$("#simple-example").html(theNewCode);
$('#simple-code').text(theNewCode);
$('pre').removeClass('prettyprinted');
prettyPrint();
});
// clipboard button
new Clipboard('.btn');
});
</script>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5e46f4c0e8e8fb44"></script>
</body>
</html>