1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 18:52:50 +00:00

Added files

This commit is contained in:
2015-06-25 16:28:41 -05:00
parent 656dca9289
commit eb27b55a54
5621 changed files with 1630154 additions and 0 deletions

View 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>

View File

@@ -0,0 +1,5 @@
(function () {
"use strict";
console.log('Hello World!');
}();

View File

@@ -0,0 +1,5 @@
<pre><code>(function () {
"use strict";
console.log('Hello World!');
}();</code></pre>

View 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']);
}());

View 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);
}());

View 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']);
}());

View 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, []);
}());

View 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);