update evilstreak markdown plugin; move to node_modules

This commit is contained in:
Jeff Williams 2012-10-14 09:13:53 -07:00
parent 8993be2049
commit 929e60dd99
9 changed files with 652 additions and 316 deletions

View File

@ -16,6 +16,9 @@
"url": "https://github.com/jsdoc3/jsdoc"
}
],
"dependencies": {
"markdown": "0.4.0"
},
"bugs": "https://github.com/jsdoc3/jsdoc/issues",
"contributors" : [
{

94
node_modules/markdown/README.markdown generated vendored Normal file
View File

@ -0,0 +1,94 @@
markdown-js
===========
Yet another markdown parser, this time for JavaScript. There's a few
options that precede this project but they all treat markdown to HTML
conversion as a single step process. You pass markdown in and get HTML
out, end of story. We had some pretty particular views on how the
process should actually look, which include:
* producing well-formed HTML. This means that em and strong nesting is
important, as is the ability to output as both HTML and XHTML
* having an intermediate representation to allow processing of parsed
data (we in fact have two, both [JsonML]: a markdown tree and an
HTML tree)
* being easily extensible to add new dialects without having to
rewrite the entire parsing mechanics
* having a good test suite. The only test suites we could find tested
massive blocks of input, and passing depended on outputting the HTML
with exactly the same whitespace as the original implementation
[JsonML]: http://jsonml.org/ "JSON Markup Language"
## Installation
Just the `markdown` library:
npm install markdown
Also install `md2html` to `/usr/local/bin` (or wherever)
npm install -g markdown
## Usage
The simple way to use it with CommonJS is:
var input = "# Heading\n\nParagraph";
var output = require( "markdown" ).markdown.toHTML( input );
print( output );
If you want more control check out the documentation in
[lib/markdown.js] which details all the methods and parameters
available (including examples!). One day we'll get the docs generated
and hosted somewhere for nicer browsing.
We're yet to try it out in a browser, though it's high up on our list of
things to sort out for this project.
### md2html
md2html /path/to/doc.md > /path/to/doc.html
[lib/markdown.js]: http://github.com/evilstreak/markdown-js/blob/master/lib/markdown.js
## Intermediate Representation
Internally the process to convert a chunk of markdown into a chunk of
HTML has three steps:
1. Parse the markdown into a JsonML tree. Any references found in the
parsing are stored in the attribute hash of the root node under the
key `references`.
2. Convert the markdown tree into an HTML tree. Rename any nodes that
need it (`bulletlist` to `ul` for example) and lookup any references
used by links or images. Remove the references attribute once done.
3. Stringify the HTML tree being careful not to wreck whitespace where
whitespace is important (surrounding inline elements for example).
Each step of this process can be called individually if you need to do
some processing or modification of the data at an intermediate stage.
For example, you may want to grab a list of all URLs linked to in the
document before rendering it to HTML which you could do by recursing
through the HTML tree looking for `a` nodes.
## Running tests
To run the tests under node you will need tap installed (it's listed as a
devDependencies so `npm install` from the checkout should be enough), then do
$ ./node_modules/.bin/tap test/*.t.js
## Contributing
Do the usual github fork and pull request dance. Add yourself to the
contributors section of package.json too if you want to.
## License
Released under the MIT license.

3
node_modules/markdown/lib/index.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
// super simple module for the most common nodejs use case.
exports.markdown = require("./markdown");
exports.parse = exports.markdown.toHTML;

File diff suppressed because it is too large Load Diff

63
node_modules/markdown/package.json generated vendored Normal file
View File

@ -0,0 +1,63 @@
{
"name": "markdown",
"version": "0.4.0",
"description": "A sensible Markdown parser for javascript",
"keywords": [
"markdown",
"text processing",
"ast"
],
"maintainers": [
{
"name": "Dominic Baggott",
"email": "dominic.baggott@gmail.com",
"url": "http://evilstreak.co.uk"
},
{
"name": "Ash Berlin",
"email": "ash_markdownjs@firemirror.com",
"url": "http://ashberlin.com"
}
],
"contributors": [
{
"name": "Dominic Baggott",
"email": "dominic.baggott@gmail.com",
"url": "http://evilstreak.co.uk"
},
{
"name": "Ash Berlin",
"email": "ash_markdownjs@firemirror.com",
"url": "http://ashberlin.com"
}
],
"bugs": {
"url": "http://github.com/evilstreak/markdown-js/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"repository": {
"type": "git",
"url": "git://github.com/evilstreak/markdown-js.git"
},
"main": "./lib/index.js",
"bin": {
"md2html": "./bin/md2html.js"
},
"dependencies": {
"nopt": "1"
},
"devDependencies": {
"tap": "0"
},
"scripts": {
"test": "tap test/*.t.js"
},
"readme": "markdown-js\n===========\n\nYet another markdown parser, this time for JavaScript. There's a few\noptions that precede this project but they all treat markdown to HTML\nconversion as a single step process. You pass markdown in and get HTML\nout, end of story. We had some pretty particular views on how the\nprocess should actually look, which include:\n\n * producing well-formed HTML. This means that em and strong nesting is\n important, as is the ability to output as both HTML and XHTML\n\n * having an intermediate representation to allow processing of parsed\n data (we in fact have two, both [JsonML]: a markdown tree and an\n HTML tree)\n\n * being easily extensible to add new dialects without having to\n rewrite the entire parsing mechanics\n\n * having a good test suite. The only test suites we could find tested\n massive blocks of input, and passing depended on outputting the HTML\n with exactly the same whitespace as the original implementation\n\n[JsonML]: http://jsonml.org/ \"JSON Markup Language\"\n\n## Installation\n\nJust the `markdown` library:\n\n npm install markdown\n\nAlso install `md2html` to `/usr/local/bin` (or wherever)\n\n npm install -g markdown\n\n## Usage\n\nThe simple way to use it with CommonJS is:\n\n var input = \"# Heading\\n\\nParagraph\";\n var output = require( \"markdown\" ).markdown.toHTML( input );\n print( output );\n\nIf you want more control check out the documentation in\n[lib/markdown.js] which details all the methods and parameters\navailable (including examples!). One day we'll get the docs generated\nand hosted somewhere for nicer browsing.\n\nWe're yet to try it out in a browser, though it's high up on our list of\nthings to sort out for this project.\n\n### md2html\n\n md2html /path/to/doc.md > /path/to/doc.html\n\n[lib/markdown.js]: http://github.com/evilstreak/markdown-js/blob/master/lib/markdown.js\n\n## Intermediate Representation\n\nInternally the process to convert a chunk of markdown into a chunk of\nHTML has three steps:\n\n 1. Parse the markdown into a JsonML tree. Any references found in the\n parsing are stored in the attribute hash of the root node under the\n key `references`.\n\n 2. Convert the markdown tree into an HTML tree. Rename any nodes that\n need it (`bulletlist` to `ul` for example) and lookup any references\n used by links or images. Remove the references attribute once done.\n\n 3. Stringify the HTML tree being careful not to wreck whitespace where\n whitespace is important (surrounding inline elements for example).\n\nEach step of this process can be called individually if you need to do\nsome processing or modification of the data at an intermediate stage.\nFor example, you may want to grab a list of all URLs linked to in the\ndocument before rendering it to HTML which you could do by recursing\nthrough the HTML tree looking for `a` nodes.\n\n## Running tests\n\nTo run the tests under node you will need tap installed (it's listed as a\ndevDependencies so `npm install` from the checkout should be enough), then do\n\n $ ./node_modules/.bin/tap test/*.t.js\n\n## Contributing\n\nDo the usual github fork and pull request dance. Add yourself to the\ncontributors section of package.json too if you want to.\n\n## License\n\nReleased under the MIT license.\n",
"_id": "markdown@0.4.0",
"_from": "markdown"
}

View File

@ -1,7 +1,7 @@
{
"name": "JSDoc",
"version": "3.0.0",
"revision": "1345064014682",
"revision": "1350231216174",
"description": "An automatic documentation generator for javascript.",
"keywords": [ "documentation", "javascript" ],
"licenses": [
@ -16,6 +16,9 @@
"url": "https://github.com/jsdoc3/jsdoc"
}
],
"dependencies": {
"markdown": "0.4.0"
},
"bugs": "https://github.com/jsdoc3/jsdoc/issues",
"contributors" : [
{

View File

@ -35,10 +35,10 @@ function getParser(parser, conf) {
return parser.makeHtml(source);
};
} else if (parser === "evilstreak") {
parser = require("evilstreak/markdown");
parser = require("markdown").markdown;
return function(source) {
return parser.renderJsonML(parser.toHTMLTree(source, conf.dialect));
return parser.toHTML(source, conf.dialect);
};
} else {
throw "unknown Markdown parser: '" + parser + "'";

View File

@ -29,10 +29,10 @@ function getParser(parser, conf) {
};
}
else if (parser === 'evilstreak') {
parser = require('evilstreak/markdown');
parser = require('markdown').markdown;
return function(source) {
return parser.renderJsonML(parser.toHTMLTree(source, conf.dialect));
return parser.toHTML(source, conf.dialect);
};
}
else {

View File

@ -4,7 +4,7 @@
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
var mdParser = require('evilstreak/markdown');
var mdParser = require('markdown').markdown;
/**
@module jsdoc/tutorial