update readme and license

This commit is contained in:
Christopher Jeffrey 2012-01-03 00:35:47 -06:00
parent 298a437d9b
commit 10e58d5b14
3 changed files with 58 additions and 23 deletions

38
LICENSE
View File

@ -1,19 +1,19 @@
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
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.
Copyright (c) 2011-2012, 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.

View File

@ -90,7 +90,42 @@ $ cat hello.html
<p>hello world</p>
```
## Todo
## Syntax Highlighting
- Implement GFM features.
- Add an explicit pretty printing and minification feature.
Marked has an interface that allows for a syntax highlighter to highlight code
blocks before they're output.
Example implementation:
``` js
var highlight = require('my-syntax-highlighter')
, marked_ = require('marked');
var marked = function(text) {
var tokens = marked_.lexer(text)
, l = tokens.length
, i = 0
, token;
for (; i < l; i++) {
token = tokens[i];
if (token.type === 'code') {
token.text = highlight(token.text, token.lang);
// marked should not escape this
token.escaped = true;
}
}
text = marked_.parser(tokens);
return text;
};
module.exports = marked;
```
## License
Copyright (c) 2011-2012, Christopher Jeffrey. (MIT License)
See LICENSE for more info.

View File

@ -1,6 +1,6 @@
/**
* marked - A markdown parser (https://github.com/chjj/marked)
* Copyright (c) 2011, Christopher Jeffrey. (MIT Licensed)
* Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed)
*/
;(function() {