1 | <a href="https://marked.js.org">
|
2 | <img width="60px" height="60px" src="https://marked.js.org/img/logo-black.svg" align="right" />
|
3 | </a>
|
4 |
|
5 | # Marked
|
6 |
|
7 | [![npm](https://badgen.net/npm/v/marked)](https://www.npmjs.com/package/marked)
|
8 | [![gzip size](https://badgen.net/badgesize/gzip/https://cdn.jsdelivr.net/npm/marked/marked.min.js)](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
|
9 | [![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked)
|
10 | [![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked)
|
11 | [![dep](https://badgen.net/david/dep/markedjs/marked)](https://david-dm.org/markedjs/marked)
|
12 | [![dev dep](https://badgen.net/david/dev/markedjs/marked)](https://david-dm.org/markedjs/marked?type=dev)
|
13 | [![travis](https://badgen.net/travis/markedjs/marked)](https://travis-ci.org/markedjs/marked)
|
14 |
|
15 | - ⚡ built for speed
|
16 | - ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
|
17 | - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
|
18 | - 🌐 works in a browser, on a server, or from a command line interface (CLI)
|
19 |
|
20 | ## Demo
|
21 |
|
22 | Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️
|
23 |
|
24 | ## Docs
|
25 |
|
26 | Our [documentation pages](https://marked.js.org) are also rendered using marked 💯
|
27 |
|
28 | Also read about:
|
29 |
|
30 | * [Options](https://marked.js.org/#/USING_ADVANCED.md)
|
31 | * [Extensibility](https://marked.js.org/#/USING_PRO.md)
|
32 |
|
33 | ## Installation
|
34 |
|
35 | **CLI:** `npm install -g marked`
|
36 |
|
37 | **In-browser:** `npm install marked --save`
|
38 |
|
39 | ## Usage
|
40 |
|
41 | ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML by default 🚨
|
42 |
|
43 | **CLI**
|
44 |
|
45 | ``` bash
|
46 | $ marked -o hello.html
|
47 | hello world
|
48 | ^D
|
49 | $ cat hello.html
|
50 | <p>hello world</p>
|
51 | ```
|
52 |
|
53 | **Browser**
|
54 |
|
55 | ```html
|
56 | <!doctype html>
|
57 | <html>
|
58 | <head>
|
59 | <meta charset="utf-8"/>
|
60 | <title>Marked in the browser</title>
|
61 | </head>
|
62 | <body>
|
63 | <div id="content"></div>
|
64 | <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
65 | <script>
|
66 | document.getElementById('content').innerHTML =
|
67 | marked('# Marked in the browser\n\nRendered by **marked**.');
|
68 | </script>
|
69 | </body>
|
70 | </html>
|
71 | ```
|
72 |
|
73 | ## License
|
74 |
|
75 | Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|