1 | # Marked
|
2 |
|
3 | Marked is
|
4 |
|
5 | 1. built for speed.
|
6 | 2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.
|
7 | 3. light-weight while implementing all markdown features from the supported flavors & specifications.
|
8 | 4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects.
|
9 |
|
10 | ## Installation
|
11 |
|
12 | **CLI:** `npm install -g marked`
|
13 |
|
14 | **In-browser:** `npm install marked --save`
|
15 |
|
16 | ## Usage
|
17 |
|
18 | **CLI**
|
19 |
|
20 | ``` bash
|
21 | $ marked -o hello.html
|
22 | hello world
|
23 | ^D
|
24 | $ cat hello.html
|
25 | <p>hello world</p>
|
26 | ```
|
27 |
|
28 | **Browser**
|
29 |
|
30 | ```html
|
31 | <!doctype html>
|
32 | <html>
|
33 | <head>
|
34 | <meta charset="utf-8"/>
|
35 | <title>Marked in the browser</title>
|
36 | <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
37 | </head>
|
38 | <body>
|
39 | <div id="content"></div>
|
40 | <script>
|
41 | document.getElementById('content').innerHTML =
|
42 | marked('# Marked in the browser\n\nRendered by **marked**.');
|
43 | </script>
|
44 | </body>
|
45 | </html>
|
46 | ```
|
47 |
|
48 |
|
49 |
|
50 | ## License
|
51 |
|
52 | Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
53 |
|