mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 18:52:50 +00:00
Added files
This commit is contained in:
16
mongoui/mongoui-master/node_modules/highlight/examples/example.html
generated
vendored
Normal file
16
mongoui/mongoui-master/node_modules/highlight/examples/example.html
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Foo</title>
|
||||
</head>
|
||||
<body>
|
||||
Bar
|
||||
<br/>
|
||||
Baz
|
||||
<p>Quux</p>
|
||||
<ul>
|
||||
<li>Qux</li>
|
||||
<li>Grault</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
5
mongoui/mongoui-master/node_modules/highlight/examples/example.js
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/highlight/examples/example.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
console.log('Hello World!');
|
||||
}();
|
||||
5
mongoui/mongoui-master/node_modules/highlight/examples/example.js.html
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/highlight/examples/example.js.html
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<pre><code>(function () {
|
||||
"use strict";
|
||||
|
||||
console.log('Hello World!');
|
||||
}();</code></pre>
|
||||
29
mongoui/mongoui-master/node_modules/highlight/examples/should-annotate-xml.js
generated
vendored
Normal file
29
mongoui/mongoui-master/node_modules/highlight/examples/should-annotate-xml.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Highlight = require("../lib/highlight.js")
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, reHasAnnotations = /\sclass="tag"/
|
||||
;
|
||||
|
||||
function runTest(err) {
|
||||
|
||||
assert.ok(!err, err && err.message);
|
||||
assert.strictEqual(1, Highlight.loadedLanguages.length, 'more than one language is loaded: ' + Highlight.loadedLanguages);
|
||||
assert.strictEqual('xml', Highlight.loadedLanguages[0], 'xml isn\'t the language');
|
||||
|
||||
fs.readFile('./example.html', 'utf8', function (err, text) {
|
||||
var annotated
|
||||
;
|
||||
|
||||
assert.ok(!err, 'threw error reading example.html');
|
||||
annotated = Highlight.highlight(text, ' ');
|
||||
assert.ok(annotated.match(reHasAnnotations));
|
||||
//console.log(annotated);
|
||||
console.info('[PASS] source is annotated');
|
||||
});
|
||||
}
|
||||
|
||||
Highlight.init(runTest, ['xml']);
|
||||
}());
|
||||
41
mongoui/mongoui-master/node_modules/highlight/examples/should-load-all-languages.js
generated
vendored
Normal file
41
mongoui/mongoui-master/node_modules/highlight/examples/should-load-all-languages.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Highlight = require("../lib/highlight.js")
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, reHasAnnotations = /\sclass="[\w-]+"/
|
||||
;
|
||||
|
||||
function runTest(err) {
|
||||
|
||||
//console.log(Highlight.loadedLanguages);
|
||||
assert.ok(!err, err && err.message);
|
||||
assert.strictEqual(Highlight.languages.length, Highlight.loadedLanguages.length
|
||||
, 'not all languages were loaded: '
|
||||
+ Highlight.languages.length
|
||||
+ " "
|
||||
+ Highlight.loadedLanguages.length
|
||||
);
|
||||
assert.deepEqual(Highlight.languages, Highlight.loadedLanguages
|
||||
, 'not all languages were loaded: '
|
||||
+ JSON.stringify(Highlight.languages, null, ' ')
|
||||
+ "\n"
|
||||
+ JSON.stringify(Highlight.loadedLanguages, null, ' ')
|
||||
);
|
||||
|
||||
// It's okay that these run out-of-order / in-parallel
|
||||
fs.readFile('./example.js', 'utf8', function (err, text) {
|
||||
var annotated
|
||||
;
|
||||
|
||||
assert.ok(!err, 'threw error reading example.js');
|
||||
annotated = Highlight.highlight(text, ' ');
|
||||
assert.ok(annotated.match(reHasAnnotations));
|
||||
//console.log(annotated);
|
||||
console.info('[PASS] annotated source (perhaps incorrectly) with all modules loaded');
|
||||
});
|
||||
}
|
||||
|
||||
Highlight.init(runTest);
|
||||
}());
|
||||
29
mongoui/mongoui-master/node_modules/highlight/examples/should-load-js-only.js
generated
vendored
Normal file
29
mongoui/mongoui-master/node_modules/highlight/examples/should-load-js-only.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Highlight = require("../lib/highlight.js")
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, reHasAnnotations = /\sclass="[\w-]+"/
|
||||
;
|
||||
|
||||
function runTest(err) {
|
||||
|
||||
assert.ok(!err, err && err.message);
|
||||
assert.strictEqual(1, Highlight.loadedLanguages.length, 'more than one language is loaded: ' + Highlight.loadedLanguages);
|
||||
assert.strictEqual('javascript', Highlight.loadedLanguages[0], 'javascript is the language');
|
||||
|
||||
fs.readFile('./example.js.html', 'utf8', function (err, text) {
|
||||
var annotated
|
||||
;
|
||||
|
||||
assert.ok(!err, 'threw error reading example.js.html');
|
||||
annotated = Highlight.highlight(text, ' ', true);
|
||||
assert.ok(annotated.match(reHasAnnotations));
|
||||
//console.log(annotated);
|
||||
console.info('[PASS] source is annotated');
|
||||
});
|
||||
}
|
||||
|
||||
Highlight.init(runTest, ['javascript']);
|
||||
}());
|
||||
36
mongoui/mongoui-master/node_modules/highlight/examples/should-load-no-languages.js
generated
vendored
Normal file
36
mongoui/mongoui-master/node_modules/highlight/examples/should-load-no-languages.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Highlight = require("../lib/highlight.js")
|
||||
, assert = require('assert')
|
||||
, fs = require('fs')
|
||||
, reHasMarkup = /<.*class=["']?[\w-]+["'?]/
|
||||
, reHasAnnotations = /\sclass="[\w-]+"/
|
||||
;
|
||||
|
||||
function runTest(err) {
|
||||
|
||||
//console.log(Highlight.loadedLanguages);
|
||||
assert.ok(!err, err && err.message);
|
||||
assert.strictEqual(0, Highlight.loadedLanguages.length
|
||||
, 'some languages were loaded: '
|
||||
+ Highlight.languages.length
|
||||
+ " "
|
||||
+ Highlight.loadedLanguages.length
|
||||
);
|
||||
|
||||
// It's okay that these run out-of-order / in-parallel
|
||||
fs.readFile('./example.js', 'utf8', function (err, text) {
|
||||
var annotated
|
||||
;
|
||||
|
||||
assert.ok(!err, 'threw error reading example.js');
|
||||
annotated = Highlight.highlight(text, ' ');
|
||||
assert.ok(!annotated.match(reHasAnnotations));
|
||||
//console.log(annotated);
|
||||
console.info('[PASS] source is not annotated');
|
||||
});
|
||||
}
|
||||
|
||||
Highlight.init(runTest, []);
|
||||
}());
|
||||
25
mongoui/mongoui-master/node_modules/highlight/examples/test.js
generated
vendored
Normal file
25
mongoui/mongoui-master/node_modules/highlight/examples/test.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
var hl = require("../lib/highlight.js").Highlight,
|
||||
code_string = "<?php\r\n"+
|
||||
"\techo \"Hello world!\";\r\n"+
|
||||
"\tfor($i=0;$i<100;$i++){\r\n"+
|
||||
"\t\techo \"$i\";\r\n"+
|
||||
"\t}\r\n"+
|
||||
"?>",
|
||||
|
||||
code_block = "<p>PHP code:</p>\n"+
|
||||
"<code><?php\n"+
|
||||
"\techo \"Hello world!\";\n"+
|
||||
"\tfor($i=0;$i<100;$i++){\n"+
|
||||
"\t\techo \"$i\";\n"+
|
||||
"\t}\n"+
|
||||
"?></code>",
|
||||
|
||||
html1 = hl(code_string), // convert all
|
||||
html2 = hl(code_string,' '), // convert with special tab replacer
|
||||
html3 = hl(code_block, false, true); // convert only inside <code/>
|
||||
|
||||
console.log(html1);
|
||||
console.log(html2);
|
||||
console.log(html3);
|
||||
Reference in New Issue
Block a user