2018-03-11 17:32:23 -04:00
|
|
|
# Marked
|
2018-02-25 18:09:11 -05:00
|
|
|
|
2018-02-25 14:18:59 -05:00
|
|
|
Marked is
|
|
|
|
|
2018-03-11 17:32:23 -04:00
|
|
|
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.
|
2018-02-25 15:17:16 -05:00
|
|
|
4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects.
|
2018-02-25 14:18:59 -05:00
|
|
|
|
2018-03-11 17:32:23 -04:00
|
|
|
## Installation
|
2013-06-28 11:54:34 -07:00
|
|
|
|
2018-02-25 15:17:16 -05:00
|
|
|
**CLI:** `npm install -g marked`
|
2016-07-08 16:04:04 -03:00
|
|
|
|
2018-02-25 15:17:16 -05:00
|
|
|
**In-browser:** `npm install marked --save`
|
2016-07-08 16:04:04 -03:00
|
|
|
|
2018-03-11 17:32:23 -04:00
|
|
|
## Usage
|
2013-06-28 11:54:34 -07:00
|
|
|
|
2018-02-25 15:17:16 -05:00
|
|
|
**CLI**
|
2013-06-28 11:54:34 -07:00
|
|
|
|
2018-02-25 15:17:16 -05:00
|
|
|
``` bash
|
|
|
|
$ marked -o hello.html
|
|
|
|
hello world
|
|
|
|
^D
|
|
|
|
$ cat hello.html
|
|
|
|
<p>hello world</p>
|
2013-06-28 11:54:34 -07:00
|
|
|
```
|
|
|
|
|
2018-02-25 15:17:16 -05:00
|
|
|
**Browser**
|
2014-05-06 15:48:15 +02:00
|
|
|
|
|
|
|
```html
|
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8"/>
|
|
|
|
<title>Marked in the browser</title>
|
2018-03-11 17:32:23 -04:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
2014-05-06 15:48:15 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="content"></div>
|
|
|
|
<script>
|
|
|
|
document.getElementById('content').innerHTML =
|
2018-03-11 17:32:23 -04:00
|
|
|
marked('# Marked in the browser\n\nRendered by **marked**.');
|
2014-05-06 15:48:15 +02:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
2013-06-28 11:54:34 -07:00
|
|
|
|
2018-02-27 13:16:03 -05:00
|
|
|
|
2018-03-11 17:32:23 -04:00
|
|
|
## License
|
2012-01-03 00:35:47 -06:00
|
|
|
|
2017-12-25 17:53:35 -05:00
|
|
|
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
2012-01-03 00:35:47 -06:00
|
|
|
|