marked -> markdown-it

This commit is contained in:
ccd0 2016-05-08 10:46:57 -07:00
parent 787bba642a
commit 3923c64755
5 changed files with 53 additions and 10 deletions

View File

@ -209,7 +209,7 @@ testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip
builds/% : testbuilds/% | builds
$(CP)
test.html : README.md template.jst tools/markdown.js node_modules/marked/package.json node_modules/lodash.template/package.json
test.html : README.md template.jst tools/markdown.js node_modules/markdown-it/package.json node_modules/markdown-it-anchor/package.json node_modules/lodash.template/package.json
node tools/markdown.js
index.html : test.html

View File

@ -56,7 +56,8 @@
"jshint": "^2.9.2",
"jszip": "^3.0.0",
"lodash.template": "^4.2.4",
"marked": "^0.3.5",
"markdown-it": "^6.0.1",
"markdown-it-anchor": "^2.5.0",
"request": "^2.72.0",
"webstore-upload": "^0.0.7"
},

View File

@ -16,6 +16,11 @@
"from": "archiver@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-0.8.1.tgz"
},
"argparse": {
"version": "1.0.7",
"from": "argparse@>=1.0.7 <2.0.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.7.tgz"
},
"asap": {
"version": "2.0.3",
"from": "asap@>=2.0.3 <2.1.0",
@ -474,6 +479,11 @@
"from": "lazystream@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz"
},
"linkify-it": {
"version": "1.2.1",
"from": "linkify-it@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-1.2.1.tgz"
},
"lodash": {
"version": "2.4.2",
"from": "lodash@>=2.4.1 <2.5.0",
@ -529,10 +539,27 @@
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
},
"marked": {
"version": "0.3.5",
"from": "marked@latest",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.5.tgz"
"markdown-it": {
"version": "6.0.1",
"from": "markdown-it@latest",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-6.0.1.tgz",
"dependencies": {
"entities": {
"version": "1.1.1",
"from": "entities@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz"
}
}
},
"markdown-it-anchor": {
"version": "2.5.0",
"from": "markdown-it-anchor@latest",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-2.5.0.tgz"
},
"mdurl": {
"version": "1.0.1",
"from": "mdurl@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz"
},
"mime-db": {
"version": "1.22.0",
@ -673,11 +700,21 @@
"from": "sntp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz"
},
"sprintf-js": {
"version": "1.0.3",
"from": "sprintf-js@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
},
"sshpk": {
"version": "1.7.4",
"from": "sshpk@>=1.7.0 <2.0.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz"
},
"string": {
"version": "3.3.1",
"from": "string@>=3.0.1 <4.0.0",
"resolved": "https://registry.npmjs.org/string/-/string-3.3.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
@ -723,6 +760,11 @@
"from": "tweetnacl@>=0.13.0 <1.0.0",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz"
},
"uc.micro": {
"version": "1.0.0",
"from": "uc.micro@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.0.tgz"
},
"util-deprecate": {
"version": "1.0.2",
"from": "util-deprecate@>=1.0.1 <1.1.0",

View File

@ -60,7 +60,7 @@ var engine = (function() {
if (/Presto\//.test(navigator.userAgent)) return 'presto';
})();
if (engine) {
var engines = {'firefox': 'gecko', 'chromium': 'blink presto', 'safari': 'webkit', 'webkitgtk-': 'webkit', 'other-browsers': 'edge'};
var engines = {'firefox': 'gecko', 'chromium': 'blink presto', 'safari': 'webkit', 'webkitgtk': 'webkit', 'other-browsers': 'edge'};
for (browser in engines) {
document.getElementById(browser + '-hide').checked = (engines[browser].indexOf(engine) < 0);
}

View File

@ -1,9 +1,9 @@
var fs = require('fs');
var marked = require('marked');
var md = require('markdown-it')({linkify: true}).use(require('markdown-it-anchor'));
var template = require('lodash.template');
var md = fs.readFileSync('README.md', 'utf8');
var content = marked(md);
var readme = fs.readFileSync('README.md', 'utf8');
var content = md.render(readme);
var webtemplate = fs.readFileSync('template.jst', 'utf8');
var output = template(webtemplate)({content: content});
output = output.replace(/\r\n/g, '\n');