initial commit
This commit is contained in:
16
node_modules/marked/.editorconfig
generated
vendored
Normal file
16
node_modules/marked/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
root = true
|
||||
|
||||
[*, *.json, *.js]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md, !test/*md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
28
node_modules/marked/.eslintrc.json
generated
vendored
Normal file
28
node_modules/marked/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": "standard",
|
||||
"plugins": [
|
||||
"standard"
|
||||
],
|
||||
"parserOptions": { "ecmaVersion": 5 },
|
||||
"rules": {
|
||||
"semi": "off",
|
||||
"indent": ["warn", 2, {
|
||||
"VariableDeclarator": { "var": 2 },
|
||||
"SwitchCase": 1,
|
||||
"outerIIFEBody": 0
|
||||
}],
|
||||
"space-before-function-paren": "off",
|
||||
"operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }],
|
||||
"no-cond-assign": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-return-assign": "off",
|
||||
"one-var": "off",
|
||||
"no-control-regex": "off"
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"browser": true,
|
||||
"amd": true,
|
||||
"jasmine": true
|
||||
}
|
||||
}
|
||||
17
node_modules/marked/.travis.yml
generated
vendored
Normal file
17
node_modules/marked/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
language: node_js
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: spec tests 👩🏽💻
|
||||
node_js: v0.10
|
||||
- node_js: v4
|
||||
- node_js: lts/*
|
||||
- node_js: node
|
||||
|
||||
- stage: lint ✨
|
||||
node_js: lts/*
|
||||
script: npm run test:lint
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
43
node_modules/marked/LICENSE.md
generated
vendored
Normal file
43
node_modules/marked/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# License information
|
||||
|
||||
## Contribution License Agreement
|
||||
|
||||
If you contribute code to this project, you are implicitly allowing your code
|
||||
to be distributed under the MIT license. You are also implicitly verifying that
|
||||
all code is your original work. `</legalese>`
|
||||
|
||||
## Marked
|
||||
|
||||
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
## Markdown
|
||||
|
||||
Copyright © 2004, John Gruber
|
||||
http://daringfireball.net/
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
|
||||
15
node_modules/marked/Makefile
generated
vendored
Normal file
15
node_modules/marked/Makefile
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
all:
|
||||
@cp lib/marked.js marked.js
|
||||
@uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js
|
||||
|
||||
clean:
|
||||
@rm marked.js
|
||||
@rm marked.min.js
|
||||
|
||||
bench:
|
||||
@node test --bench
|
||||
|
||||
man/marked.1.txt:
|
||||
groff -man -Tascii man/marked.1 | col -b > man/marked.1.txt
|
||||
|
||||
.PHONY: clean all
|
||||
53
node_modules/marked/README.md
generated
vendored
Normal file
53
node_modules/marked/README.md
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Marked
|
||||
|
||||
Marked is
|
||||
|
||||
1. built for speed.
|
||||
2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.
|
||||
3. light-weight while implementing all markdown features from the supported flavors & specifications.
|
||||
4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects.
|
||||
|
||||
## Installation
|
||||
|
||||
**CLI:** `npm install -g marked`
|
||||
|
||||
**In-browser:** `npm install marked --save`
|
||||
|
||||
## Usage
|
||||
|
||||
**CLI**
|
||||
|
||||
``` bash
|
||||
$ marked -o hello.html
|
||||
hello world
|
||||
^D
|
||||
$ cat hello.html
|
||||
<p>hello world</p>
|
||||
```
|
||||
|
||||
**Browser**
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Marked in the browser</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
<script>
|
||||
document.getElementById('content').innerHTML =
|
||||
marked('# Marked in the browser\n\nRendered by **marked**.');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
||||
|
||||
191
node_modules/marked/bin/marked
generated
vendored
Executable file
191
node_modules/marked/bin/marked
generated
vendored
Executable file
@@ -0,0 +1,191 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Marked CLI
|
||||
* Copyright (c) 2011-2013, Christopher Jeffrey (MIT License)
|
||||
*/
|
||||
|
||||
var fs = require('fs')
|
||||
, util = require('util')
|
||||
, marked = require('../');
|
||||
|
||||
/**
|
||||
* Man Page
|
||||
*/
|
||||
|
||||
function help() {
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
var options = {
|
||||
cwd: process.cwd(),
|
||||
env: process.env,
|
||||
setsid: false,
|
||||
customFds: [0, 1, 2]
|
||||
};
|
||||
|
||||
spawn('man', [__dirname + '/../man/marked.1'], options)
|
||||
.on('error', function(err) {
|
||||
fs.readFile(__dirname + '/../man/marked.1.txt', 'utf8', function(err, data) {
|
||||
if (err) throw err;
|
||||
console.log(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
|
||||
function main(argv, callback) {
|
||||
var files = []
|
||||
, options = {}
|
||||
, input
|
||||
, output
|
||||
, arg
|
||||
, tokens
|
||||
, opt;
|
||||
|
||||
function getarg() {
|
||||
var arg = argv.shift();
|
||||
|
||||
if (arg.indexOf('--') === 0) {
|
||||
// e.g. --opt
|
||||
arg = arg.split('=');
|
||||
if (arg.length > 1) {
|
||||
// e.g. --opt=val
|
||||
argv.unshift(arg.slice(1).join('='));
|
||||
}
|
||||
arg = arg[0];
|
||||
} else if (arg[0] === '-') {
|
||||
if (arg.length > 2) {
|
||||
// e.g. -abc
|
||||
argv = arg.substring(1).split('').map(function(ch) {
|
||||
return '-' + ch;
|
||||
}).concat(argv);
|
||||
arg = argv.shift();
|
||||
} else {
|
||||
// e.g. -a
|
||||
}
|
||||
} else {
|
||||
// e.g. foo
|
||||
}
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
while (argv.length) {
|
||||
arg = getarg();
|
||||
switch (arg) {
|
||||
case '--test':
|
||||
return require('../test').main(process.argv.slice());
|
||||
case '-o':
|
||||
case '--output':
|
||||
output = argv.shift();
|
||||
break;
|
||||
case '-i':
|
||||
case '--input':
|
||||
input = argv.shift();
|
||||
break;
|
||||
case '-t':
|
||||
case '--tokens':
|
||||
tokens = true;
|
||||
break;
|
||||
case '-h':
|
||||
case '--help':
|
||||
return help();
|
||||
default:
|
||||
if (arg.indexOf('--') === 0) {
|
||||
opt = camelize(arg.replace(/^--(no-)?/, ''));
|
||||
if (!marked.defaults.hasOwnProperty(opt)) {
|
||||
continue;
|
||||
}
|
||||
if (arg.indexOf('--no-') === 0) {
|
||||
options[opt] = typeof marked.defaults[opt] !== 'boolean'
|
||||
? null
|
||||
: false;
|
||||
} else {
|
||||
options[opt] = typeof marked.defaults[opt] !== 'boolean'
|
||||
? argv.shift()
|
||||
: true;
|
||||
}
|
||||
} else {
|
||||
files.push(arg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function getData(callback) {
|
||||
if (!input) {
|
||||
if (files.length <= 2) {
|
||||
return getStdin(callback);
|
||||
}
|
||||
input = files.pop();
|
||||
}
|
||||
return fs.readFile(input, 'utf8', callback);
|
||||
}
|
||||
|
||||
return getData(function(err, data) {
|
||||
if (err) return callback(err);
|
||||
|
||||
data = tokens
|
||||
? JSON.stringify(marked.lexer(data, options), null, 2)
|
||||
: marked(data, options);
|
||||
|
||||
if (!output) {
|
||||
process.stdout.write(data + '\n');
|
||||
return callback();
|
||||
}
|
||||
|
||||
return fs.writeFile(output, data, callback);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
|
||||
function getStdin(callback) {
|
||||
var stdin = process.stdin
|
||||
, buff = '';
|
||||
|
||||
stdin.setEncoding('utf8');
|
||||
|
||||
stdin.on('data', function(data) {
|
||||
buff += data;
|
||||
});
|
||||
|
||||
stdin.on('error', function(err) {
|
||||
return callback(err);
|
||||
});
|
||||
|
||||
stdin.on('end', function() {
|
||||
return callback(null, buff);
|
||||
});
|
||||
|
||||
try {
|
||||
stdin.resume();
|
||||
} catch (e) {
|
||||
callback(e);
|
||||
}
|
||||
}
|
||||
|
||||
function camelize(text) {
|
||||
return text.replace(/(\w)-(\w)/g, function(_, a, b) {
|
||||
return a + b.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose / Entry Point
|
||||
*/
|
||||
|
||||
if (!module.parent) {
|
||||
process.title = 'marked';
|
||||
main(process.argv.slice(), function(err, code) {
|
||||
if (err) throw err;
|
||||
return process.exit(code || 0);
|
||||
});
|
||||
} else {
|
||||
module.exports = main;
|
||||
}
|
||||
23
node_modules/marked/bower.json
generated
vendored
Normal file
23
node_modules/marked/bower.json
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "marked",
|
||||
"homepage": "https://github.com/markedjs/marked",
|
||||
"authors": [
|
||||
"Christopher Jeffrey <chjjeffrey@gmail.com>"
|
||||
],
|
||||
"description": "A markdown parser built for speed",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"markup",
|
||||
"html"
|
||||
],
|
||||
"main": "lib/marked.js",
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"app/bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
10
node_modules/marked/component.json
generated
vendored
Normal file
10
node_modules/marked/component.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "marked",
|
||||
"version": "0.3.4",
|
||||
"repo": "markedjs/marked",
|
||||
"description": "A markdown parser built for speed",
|
||||
"keywords": ["markdown", "markup", "html"],
|
||||
"scripts": ["lib/marked.js"],
|
||||
"main": "lib/marked.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
1
node_modules/marked/index.js
generated
vendored
Normal file
1
node_modules/marked/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./lib/marked');
|
||||
11
node_modules/marked/jasmine.json
generated
vendored
Normal file
11
node_modules/marked/jasmine.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"spec_dir": "test",
|
||||
"spec_files": [
|
||||
"**/*-spec.js"
|
||||
],
|
||||
"helpers": [
|
||||
"helpers/**/*.js"
|
||||
],
|
||||
"stopSpecOnExpectationFailure": false,
|
||||
"random": true
|
||||
}
|
||||
1388
node_modules/marked/lib/marked.js
generated
vendored
Normal file
1388
node_modules/marked/lib/marked.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
91
node_modules/marked/man/marked.1
generated
vendored
Normal file
91
node_modules/marked/man/marked.1
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
.ds q \N'34'
|
||||
.TH marked 1 "2014-01-31" "v0.3.1" "marked.js"
|
||||
|
||||
.SH NAME
|
||||
marked \- a javascript markdown parser
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B marked
|
||||
[\-o \fI<output>\fP] [\-i \fI<input>\fP] [\-\-help]
|
||||
[\-\-tokens] [\-\-pedantic] [\-\-gfm]
|
||||
[\-\-breaks] [\-\-tables] [\-\-sanitize]
|
||||
[\-\-smart\-lists] [\-\-lang\-prefix \fI<prefix>\fP]
|
||||
[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP]
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B marked
|
||||
is a full-featured javascript markdown parser, built for speed. It also includes
|
||||
multiple GFM features.
|
||||
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
cat in.md | marked > out.html
|
||||
.TP
|
||||
echo "hello *world*" | marked
|
||||
.TP
|
||||
marked \-o out.html in.md \-\-gfm
|
||||
.TP
|
||||
marked \-\-output="hello world.html" \-i in.md \-\-no-breaks
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-o,\ \-\-output\ [\fIoutput\fP]
|
||||
Specify file output. If none is specified, write to stdout.
|
||||
.TP
|
||||
.BI \-i,\ \-\-input\ [\fIinput\fP]
|
||||
Specify file input, otherwise use last argument as input file. If no input file
|
||||
is specified, read from stdin.
|
||||
.TP
|
||||
.BI \-t,\ \-\-tokens
|
||||
Output a token stream instead of html.
|
||||
.TP
|
||||
.BI \-\-pedantic
|
||||
Conform to obscure parts of markdown.pl as much as possible. Don't fix original
|
||||
markdown bugs.
|
||||
.TP
|
||||
.BI \-\-gfm
|
||||
Enable github flavored markdown.
|
||||
.TP
|
||||
.BI \-\-breaks
|
||||
Enable GFM line breaks. Only works with the gfm option.
|
||||
.TP
|
||||
.BI \-\-tables
|
||||
Enable GFM tables. Only works with the gfm option.
|
||||
.TP
|
||||
.BI \-\-sanitize
|
||||
Sanitize output. Ignore any HTML input.
|
||||
.TP
|
||||
.BI \-\-smart\-lists
|
||||
Use smarter list behavior than the original markdown.
|
||||
.TP
|
||||
.BI \-\-lang\-prefix\ [\fIprefix\fP]
|
||||
Set the prefix for code block classes.
|
||||
.TP
|
||||
.BI \-\-mangle
|
||||
Mangle email addresses.
|
||||
.TP
|
||||
.BI \-\-no\-sanitize,\ \-no-etc...
|
||||
The inverse of any of the marked options above.
|
||||
.TP
|
||||
.BI \-\-silent
|
||||
Silence error output.
|
||||
.TP
|
||||
.BI \-h,\ \-\-help
|
||||
Display help information.
|
||||
|
||||
.SH CONFIGURATION
|
||||
For configuring and running programmatically.
|
||||
|
||||
.B Example
|
||||
|
||||
require('marked')('*foo*', { gfm: true });
|
||||
|
||||
.SH BUGS
|
||||
Please report any bugs to https://github.com/markedjs/marked.
|
||||
|
||||
.SH LICENSE
|
||||
Copyright (c) 2011-2014, Christopher Jeffrey (MIT License).
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR markdown(1),
|
||||
.BR node.js(1)
|
||||
96
node_modules/marked/man/marked.1.txt
generated
vendored
Normal file
96
node_modules/marked/man/marked.1.txt
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
marked(1) marked.js marked(1)
|
||||
|
||||
|
||||
|
||||
NAME
|
||||
marked - a javascript markdown parser
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
marked [-o <output>] [-i <input>] [--help] [--tokens] [--pedantic]
|
||||
[--gfm] [--breaks] [--tables] [--sanitize] [--smart-lists] [--lang-pre‐
|
||||
fix <prefix>] [--no-etc...] [--silent] [filename]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
marked is a full-featured javascript markdown parser, built for speed.
|
||||
It also includes multiple GFM features.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
cat in.md | marked > out.html
|
||||
|
||||
echo "hello *world*" | marked
|
||||
|
||||
marked -o out.html in.md --gfm
|
||||
|
||||
marked --output="hello world.html" -i in.md --no-breaks
|
||||
|
||||
|
||||
OPTIONS
|
||||
-o, --output [output]
|
||||
Specify file output. If none is specified, write to stdout.
|
||||
|
||||
-i, --input [input]
|
||||
Specify file input, otherwise use last argument as input file.
|
||||
If no input file is specified, read from stdin.
|
||||
|
||||
-t, --tokens
|
||||
Output a token stream instead of html.
|
||||
|
||||
--pedantic
|
||||
Conform to obscure parts of markdown.pl as much as possible.
|
||||
Don't fix original markdown bugs.
|
||||
|
||||
--gfm Enable github flavored markdown.
|
||||
|
||||
--breaks
|
||||
Enable GFM line breaks. Only works with the gfm option.
|
||||
|
||||
--tables
|
||||
Enable GFM tables. Only works with the gfm option.
|
||||
|
||||
--sanitize
|
||||
Sanitize output. Ignore any HTML input.
|
||||
|
||||
--smart-lists
|
||||
Use smarter list behavior than the original markdown.
|
||||
|
||||
--lang-prefix [prefix]
|
||||
Set the prefix for code block classes.
|
||||
|
||||
--mangle
|
||||
Mangle email addresses.
|
||||
|
||||
--no-sanitize, -no-etc...
|
||||
The inverse of any of the marked options above.
|
||||
|
||||
--silent
|
||||
Silence error output.
|
||||
|
||||
-h, --help
|
||||
Display help information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
For configuring and running programmatically.
|
||||
|
||||
Example
|
||||
|
||||
require('marked')('*foo*', { gfm: true });
|
||||
|
||||
|
||||
BUGS
|
||||
Please report any bugs to https://github.com/chjj/marked.
|
||||
|
||||
|
||||
LICENSE
|
||||
Copyright (c) 2011-2014, Christopher Jeffrey (MIT License).
|
||||
|
||||
|
||||
SEE ALSO
|
||||
markdown(1), node.js(1)
|
||||
|
||||
|
||||
|
||||
v0.3.1 2014-01-31 marked(1)
|
||||
6
node_modules/marked/marked.min.js
generated
vendored
Normal file
6
node_modules/marked/marked.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
55
node_modules/marked/package.json
generated
vendored
Normal file
55
node_modules/marked/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "marked",
|
||||
"description": "A markdown parser built for speed",
|
||||
"author": "Christopher Jeffrey",
|
||||
"version": "0.3.19",
|
||||
"main": "./lib/marked.js",
|
||||
"bin": "./bin/marked",
|
||||
"man": "./man/marked.1",
|
||||
"repository": "git://github.com/markedjs/marked.git",
|
||||
"homepage": "https://marked.js.org",
|
||||
"bugs": {
|
||||
"url": "http://github.com/markedjs/marked/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"markup",
|
||||
"html"
|
||||
],
|
||||
"tags": [
|
||||
"markdown",
|
||||
"markup",
|
||||
"html"
|
||||
],
|
||||
"devDependencies": {
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-config-standard": "^11.0.0-beta.0",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"eslint-plugin-node": "^5.2.1",
|
||||
"eslint-plugin-promise": "^3.6.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"front-matter": "^2.3.0",
|
||||
"glob-to-regexp": "0.3.0",
|
||||
"jasmine": "^3.1.0",
|
||||
"markdown": "*",
|
||||
"markdown-it": "*",
|
||||
"showdown": "*",
|
||||
"uglify-js": "^3.3.10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jasmine --config=jasmine.json",
|
||||
"test:unit": "npm test -- test/unit/**/*-spec.js",
|
||||
"test:specs": "npm test -- test/specs/**/*-spec.js",
|
||||
"test:integration": "npm test -- test/integration/**/*-spec.js",
|
||||
"test:old": "node test",
|
||||
"test:lint": "eslint lib/marked.js test/index.js",
|
||||
"bench": "node test --bench",
|
||||
"lint": "eslint --fix lib/marked.js test/index.js",
|
||||
"build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js",
|
||||
"preversion": "npm run build && (git diff --quiet || git commit -am 'minify')"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
}
|
||||
153
node_modules/marked/www/demo.css
generated
vendored
Normal file
153
node_modules/marked/www/demo.css
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Helvetica, Arial, Verdana, sans-serif;
|
||||
background-color: #DDF;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
textarea {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
#header {
|
||||
margin: 0;
|
||||
padding: 0.4em 0 0 0;
|
||||
text-align: center;
|
||||
color: #002;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#header * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1em;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
#header a {
|
||||
color: #005;
|
||||
position: relative;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
#bothContainers {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin-top: 2.4em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#leftContainer, #rightContainer {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 48.5%;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#leftContainer {
|
||||
float: left;
|
||||
left: 1%;
|
||||
}
|
||||
|
||||
#rightContainer {
|
||||
float: right;
|
||||
right: 1%;
|
||||
}
|
||||
|
||||
#rightContainer > * {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.label {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.label * {
|
||||
position: relative;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.label span {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
#outputType {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
font-weight: 900;
|
||||
font-family: Arial, Verdana, sans-serif;
|
||||
background-color: #dacccc;
|
||||
color: #444;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.pane {
|
||||
margin: 1.6em 0em 0.2em;
|
||||
padding: 0.6em;
|
||||
background-color: #eee;
|
||||
display: block;
|
||||
border: 1px solid #000;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#previewPane {
|
||||
background-color: #f3eeee;
|
||||
}
|
||||
|
||||
#outputPane {
|
||||
background-color: #6c6666;
|
||||
color: #fff;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#syntaxPane {
|
||||
background-color: #e6dede;
|
||||
background-color: #f7ecec;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#inputPane {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#previewPane {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#previewPane > * {
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#previewPane > blockquote {
|
||||
margin-left: 3em;
|
||||
}
|
||||
|
||||
#previewPane > :first-child {
|
||||
margin-top: 4px; /* pane padding */
|
||||
}
|
||||
|
||||
#previewPane * {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
#previewPane code {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
244
node_modules/marked/www/demo.html
generated
vendored
Normal file
244
node_modules/marked/www/demo.html
generated
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Marked Demo Page</title>
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/marked.js"></script>
|
||||
<script type="text/javascript" src="demo.js"></script>
|
||||
<link rel="stylesheet" href="demo.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>Demo Page for <a href="https://github.com/chjj/marked/">Marked</a></h1>
|
||||
</div>
|
||||
|
||||
<div id="bothContainers">
|
||||
<div id="leftContainer">
|
||||
<div class="label">
|
||||
<span>Input</span>
|
||||
</div>
|
||||
<textarea id="input" cols="80" rows="20" class="pane">Marked - Markdown Parser
|
||||
========================
|
||||
|
||||
[Marked] lets you convert [Markdown] into HTML. Markdown is a simple text format whose goal is to be very easy to read and write, even when not converted to HTML. This demo page will let you type anything you like and see how it gets converted. Live. No more waiting around.
|
||||
|
||||
How To Use The Demo
|
||||
-------------------
|
||||
|
||||
1. Type in stuff on the left.
|
||||
2. See the live updates on the right.
|
||||
|
||||
That's it. Pretty simple. There's also a drop-down option in the upper right to switch between various views:
|
||||
|
||||
- **Preview:** A live display of the generated HTML as it would render in a browser.
|
||||
- **HTML Source:** The generated HTML before your browser makes it pretty.
|
||||
- **Lexer Data:** What [marked] uses internally, in case you like gory stuff like this.
|
||||
- **Quick Reference:** A brief run-down of how to format things using markdown.
|
||||
|
||||
Why Markdown?
|
||||
-------------
|
||||
|
||||
It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [markdown] says,
|
||||
|
||||
> The overriding design goal for Markdown's
|
||||
> formatting syntax is to make it as readable
|
||||
> as possible. The idea is that a
|
||||
> Markdown-formatted document should be
|
||||
> publishable as-is, as plain text, without
|
||||
> looking like it's been marked up with tags
|
||||
> or formatting instructions.
|
||||
|
||||
Ready to start writing? Either start changing stuff on the left or
|
||||
[clear everything](?blank=1) with a simple click.
|
||||
|
||||
[Marked]: https://github.com/chjj/marked/
|
||||
[Markdown]: http://daringfireball.net/projects/markdown/
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
<div id="rightContainer">
|
||||
<div class="label">
|
||||
<select id="outputType">
|
||||
<option value="preview">Preview</option>
|
||||
<option value="html">HTML Source</option>
|
||||
<option value="lexer">Lexer Data</option>
|
||||
<option value="quickref">Quick Reference</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="preview" class="pane"><noscript><h2>You'll need to enable Javascript to use this tool.</h2></noscript></div>
|
||||
|
||||
<textarea id="html" class="pane" cols="80" rows="20" readonly="readonly"></textarea>
|
||||
|
||||
<textarea id="lexer" class="pane" cols="80" rows="20" readonly="readonly"></textarea>
|
||||
|
||||
<textarea id="quickref" class="pane" cols="80" rows="20" readonly="readonly">Markdown Quick Reference
|
||||
========================
|
||||
|
||||
This guide is a very brief overview, with examples, of the syntax that [Markdown] supports. It is itself written in Markdown and you can copy the samples over to the left-hand pane for experimentation. It's shown as *text* and not *rendered HTML*.
|
||||
|
||||
[Markdown]: http://daringfireball.net/projects/markdown/
|
||||
|
||||
|
||||
Simple Text Formatting
|
||||
======================
|
||||
|
||||
First thing is first. You can use *stars* or _underscores_ for italics. **Double stars** and __double underscores__ do bold. ***Three together*** do ___both___.
|
||||
|
||||
Paragraphs are pretty easy too. Just have a blank line between chunks of text.
|
||||
|
||||
> This chunk of text is in a block quote. Its multiple lines will all be
|
||||
> indended a bit from the rest of the text.
|
||||
>
|
||||
> > Multiple levels of block quotes also work.
|
||||
|
||||
Sometimes you want to include some code, such as when you are explaining how `<h1>` HTML tags work, or maybe you are a programmer and you are discussing `someMethod()`.
|
||||
|
||||
If you want to include some code and have
|
||||
newlines preserved, indent the line with a tab
|
||||
or at least four spaces.
|
||||
Extra spaces work here too.
|
||||
This is also called preformatted text and it is useful for showing examples.
|
||||
The text will stay as text, so any *markdown* or <u>HTML</u> you add will
|
||||
not show up formatted. This way you can show markdown examples in a
|
||||
markdown document.
|
||||
|
||||
> You can also use preformatted text with your blockquotes
|
||||
> as long as you add at least five spaces.
|
||||
|
||||
|
||||
Headings
|
||||
========
|
||||
|
||||
There are a couple of ways to make headings. Using three or more equals signs on a line under a heading makes it into an "h1" style. Three or more hyphens under a line makes it "h2" (slightly smaller). You can also use multiple pound symbols before and after a heading. Pounds after the title are ignored. Here's some examples:
|
||||
|
||||
This is H1
|
||||
==========
|
||||
|
||||
This is H2
|
||||
----------
|
||||
|
||||
# This is H1
|
||||
## This is H2
|
||||
### This is H3 with some extra pounds ###
|
||||
#### You get the idea ####
|
||||
##### I don't need extra pounds at the end
|
||||
###### H6 is the max
|
||||
|
||||
|
||||
Links
|
||||
=====
|
||||
|
||||
Let's link to a few sites. First, let's use the bare URL, like <http://www.github.com>. Great for text, but ugly for HTML.
|
||||
Next is an inline link to [Google](http://www.google.com). A little nicer.
|
||||
This is a reference-style link to [Wikipedia] [1].
|
||||
Lastly, here's a pretty link to [Yahoo]. The reference-style and pretty links both automatically use the links defined below, but they could be defined *anywhere* in the markdown and are removed from the HTML. The names are also case insensitive, so you can use [YaHoO] and have it link properly.
|
||||
|
||||
[1]: http://www.wikipedia.org/
|
||||
[Yahoo]: http://www.yahoo.com/
|
||||
|
||||
Title attributes may be added to links by adding text after a link.
|
||||
This is the [inline link](http://www.bing.com "Bing") with a "Bing" title.
|
||||
You can also go to [W3C] [2] and maybe visit a [friend].
|
||||
|
||||
[2]: http://w3c.org (The W3C puts out specs for web-based things)
|
||||
[Friend]: http://facebook.com/ "Facebook!"
|
||||
|
||||
Email addresses in plain text are not linked: test@example.com.
|
||||
Email addresses wrapped in angle brackets are linked: <test@example.com>.
|
||||
They are also obfuscated so that email harvesting spam robots hopefully won't get them.
|
||||
|
||||
|
||||
Lists
|
||||
=====
|
||||
|
||||
* This is a bulleted list
|
||||
* Great for shopping lists
|
||||
- You can also use hyphens
|
||||
+ Or plus symbols
|
||||
|
||||
The above is an "unordered" list. Now, on for a bit of order.
|
||||
|
||||
1. Numbered lists are also easy
|
||||
2. Just start with a number
|
||||
3738762. However, the actual number doesn't matter when converted to HTML.
|
||||
1. This will still show up as 4.
|
||||
|
||||
You might want a few advanced lists:
|
||||
|
||||
- This top-level list is wrapped in paragraph tags
|
||||
- This generates an extra space between each top-level item.
|
||||
|
||||
- You do it by adding a blank line
|
||||
|
||||
- This nested list also has blank lines between the list items.
|
||||
|
||||
- How to create nested lists
|
||||
1. Start your regular list
|
||||
2. Indent nested lists with four spaces
|
||||
3. Further nesting means you should indent with four more spaces
|
||||
* This line is indented with eight spaces.
|
||||
|
||||
- List items can be quite lengthy. You can keep typing and either continue
|
||||
them on the next line with no indentation.
|
||||
|
||||
- Alternately, if that looks ugly, you can also
|
||||
indent the next line a bit for a prettier look.
|
||||
|
||||
- You can put large blocks of text in your list by just indenting with four spaces.
|
||||
|
||||
This is formatted the same as code, but you can inspect the HTML
|
||||
and find that it's just wrapped in a `<p>` tag and *won't* be shown
|
||||
as preformatted text.
|
||||
|
||||
You can keep adding more and more paragraphs to a single
|
||||
list item by adding the traditional blank line and then keep
|
||||
on indenting the paragraphs with four spaces. You really need
|
||||
to only indent the first line, but that looks ugly.
|
||||
|
||||
- Lists support blockquotes
|
||||
|
||||
> Just like this example here. By the way, you can
|
||||
> nest lists inside blockquotes!
|
||||
> - Fantastic!
|
||||
|
||||
- Lists support preformatted text
|
||||
|
||||
You just need to indent eight spaces.
|
||||
|
||||
|
||||
Even More
|
||||
=========
|
||||
|
||||
Horizontal Rule
|
||||
---------------
|
||||
|
||||
If you need a horizontal rule you just need to put at least three hyphens, asterisks, or underscores on a line by themselves. You can also even put spaces between the characters.
|
||||
|
||||
---
|
||||
****************************
|
||||
_ _ _ _ _ _ _
|
||||
|
||||
Those three all produced horizontal lines. Keep in mind that three hyphens under any text turns that text into a heading, so add a blank like if you use hyphens.
|
||||
|
||||
Images
|
||||
------
|
||||
|
||||
Images work exactly like links, but they have exclamation points in front. They work with references and titles too.
|
||||
|
||||
 and ![Happy].
|
||||
|
||||
[Happy]: http://www.wpclipart.com/smiley/simple_smiley/smiley_face_simple_green_small.png ("Smiley face")
|
||||
|
||||
|
||||
Inline HTML
|
||||
-----------
|
||||
|
||||
If markdown is too limiting, you can just insert your own <strike>crazy</strike> HTML. Span-level HTML <u>can *still* use markdown</u>. Block level elements must be separated from text by a blank line and must not have any spaces before the opening and closing HTML.
|
||||
|
||||
<div style='font-family: "Comic Sans", sans-serif;'>
|
||||
It is a pity, but markdown does **not** work in here for most markdown parsers. [Marked] handles it pretty well.
|
||||
</div>
|
||||
</textarea></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
105
node_modules/marked/www/demo.js
generated
vendored
Normal file
105
node_modules/marked/www/demo.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
$(function () {
|
||||
var $inputElem = $('#input');
|
||||
var $outputTypeElem = $('#outputType');
|
||||
var $previewElem = $('#preview');
|
||||
var $htmlElem = $('#html');
|
||||
var $lexerElem = $('#lexer');
|
||||
var $syntaxElem = $('#syntax');
|
||||
var inputDirty = true;
|
||||
var $activeElem = null;
|
||||
|
||||
if (top.document.location.href.match(/\?blank=1$/)) {
|
||||
$inputElem.val('');
|
||||
}
|
||||
|
||||
$outputTypeElem.change(function () {
|
||||
$('#rightContainer .pane').hide();
|
||||
$activeElem = $('#' + $outputTypeElem.val()).show();
|
||||
}).change();
|
||||
|
||||
var noticeChange = function () {
|
||||
inputDirty = true;
|
||||
};
|
||||
$inputElem.
|
||||
change(noticeChange).
|
||||
keyup(noticeChange).
|
||||
keypress(noticeChange).
|
||||
keydown(noticeChange);
|
||||
|
||||
var jsonString = function (input) {
|
||||
var output = (input + '').
|
||||
replace(/\n/g, '\\n').
|
||||
replace(/\r/g, '\\r').
|
||||
replace(/\t/g, '\\t').
|
||||
replace(/\f/g, '\\f').
|
||||
replace(/[\\"']/g, '\\$&').
|
||||
replace(/\u0000/g, '\\0');
|
||||
return '"' + output + '"';
|
||||
};
|
||||
|
||||
var getScrollSize = function () {
|
||||
var e = $activeElem[0];
|
||||
|
||||
return e.scrollHeight - e.clientHeight;
|
||||
};
|
||||
var getScrollPercent = function () {
|
||||
var size = getScrollSize();
|
||||
|
||||
if (size <= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return $activeElem.scrollTop() / size;
|
||||
};
|
||||
var setScrollPercent = function (percent) {
|
||||
$activeElem.scrollTop(percent * getScrollSize());
|
||||
};
|
||||
|
||||
var delayTime = 1;
|
||||
var checkForChanges = function () {
|
||||
if (inputDirty) {
|
||||
inputDirty = false;
|
||||
var startTime = new Date();
|
||||
|
||||
// Save scroll position
|
||||
var scrollPercent = getScrollPercent();
|
||||
|
||||
// Convert
|
||||
var markdown = $inputElem.val();
|
||||
var lexed = marked.lexer(markdown);
|
||||
|
||||
// Grab lexed output and convert to a string before the parser
|
||||
// destroys the data
|
||||
var lexedList = [];
|
||||
|
||||
for (var i = 0; i < lexed.length; i ++) {
|
||||
var lexedLine = [];
|
||||
for (var j in lexed[i]) {
|
||||
lexedLine.push(j + ":" + jsonString(lexed[i][j]));
|
||||
}
|
||||
lexedList.push("{" + lexedLine.join(", ") + "}");
|
||||
}
|
||||
|
||||
var parsed = marked.parser(lexed);
|
||||
|
||||
// Assign
|
||||
$previewElem.html(parsed);
|
||||
$htmlElem.val(parsed);
|
||||
$lexerElem.val(lexedList.join("\n"));
|
||||
|
||||
// Set the scroll percent
|
||||
setScrollPercent(scrollPercent);
|
||||
|
||||
var endTime = new Date();
|
||||
delayTime = endTime - startTime;
|
||||
if (delayTime < 50) {
|
||||
delayTime = 50;
|
||||
} else if (delayTime > 500) {
|
||||
delayTime = 1000;
|
||||
}
|
||||
}
|
||||
window.setTimeout(checkForChanges, delayTime);
|
||||
};
|
||||
checkForChanges();
|
||||
setScrollPercent(0);
|
||||
});
|
||||
Reference in New Issue
Block a user