diff --git a/LICENSE b/LICENSE index 89218157..5076d06a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011, Christopher Jeffrey (http://epsilon-not.net/) +Copyright (c) 2011, 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 @@ -16,4 +16,4 @@ 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. \ No newline at end of file +THE SOFTWARE. diff --git a/README.md b/README.md index a4aaef41..d1da7e6c 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,23 @@ marked lingers around 350 lines long and still implements all markdown features. ## Install - $ npm install marked +``` bash +$ npm install marked +``` ## Usage - var marked = require('marked'); - console.log(marked('i am using __markdown__.')); +``` js +var marked = require('marked'); +console.log(marked('i am using __markdown__.')); +``` You also have direct access to the lexer and parser if you so desire. - var tokens = md.lexer(str); - console.log(md.parser(tokens)); +``` js +var tokens = marked.lexer(str); +console.log(marked.parser(tokens)); +``` ## Todo (& notes to self) @@ -53,4 +59,4 @@ There may also be some bugs. - Handle escaping of HTML entities better. - Client-side compatibility. -I've still just begun to write this. I expect I will be updating it frequently. \ No newline at end of file +I've still just begun to write this. I expect I will be updating it frequently. diff --git a/package.json b/package.json index dfb5311b..d6d0c3d0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "author": "Christopher Jeffrey", "version": "0.0.1", "main": "./lib/marked.js", + "bin": { "marked": "./bin/marked" }, "repository": "git://github.com/chjj/marked.git", "keywords": [ "markdown", "markup" ] -} \ No newline at end of file +} diff --git a/test/bench.js b/test/bench.js index 03f20065..80abbbc0 100644 --- a/test/bench.js +++ b/test/bench.js @@ -8,9 +8,9 @@ var benchmark = function(func, t) { console.log('%s: %sms', func.name, new Date() - start); }; -var md_ = require('../'); -benchmark(function md() { - md_(text); +var marked_ = require('../'); +benchmark(function marked() { + marked_(text); }); var showdown_ = require('showdown'); @@ -21,4 +21,4 @@ benchmark(function showdown() { var markdown_ = require('markdown'); benchmark(function markdownjs() { markdown_.toHTML(text); -}); \ No newline at end of file +}); diff --git a/test/index.js b/test/index.js index 4f1f0fe2..703eb8e7 100644 --- a/test/index.js +++ b/test/index.js @@ -8,14 +8,15 @@ var md = require('../') , text = fs.readFileSync(__dirname + '/in.md', 'utf8'); var a = md(text) - , b = fs.readFileSync(__dirname + '/out.md', 'utf8'); + , b = fs.readFileSync(__dirname + '/out.html', 'utf8'); console.log(a); console.log('----------------------------------------------------------------'); console.log(b); +console.log('----------------------------------------------------------------'); a = a.replace(/\s+/g, ''); b = b.replace(/\s+/g, ''); assert.ok(a === b, 'Failed.'); -console.log('Complete.'); \ No newline at end of file +console.log('Complete.'); diff --git a/test/out.md b/test/out.md deleted file mode 100644 index 1db93cbc..00000000 --- a/test/out.md +++ /dev/null @@ -1,13 +0,0 @@ -
Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.
-A link
- -Code goes here.
-Lots of it...
-
- bq Item 1
- bq Item 2
- New bq Item 1
- New bq Item 2 Text here
-Another blockquote To quoth someone and whatnot markdown.js breaks here again
Hello world. Here is a link. And an image .
Code goes here.
-Lots of it...
\ No newline at end of file