1 | # markdown-service · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![npm](https://img.shields.io/npm/dt/markdown-service.svg)](https://www.npmjs.org/package/markdown-service) [![Gzip size](https://img.badgesize.io/https://unpkg.com/markdown-service/?compression=gzip)](https://unpkg.com/markdown-service/) [![CI Status](https://github.com/klaufel/markdown-service/workflows/CI/badge.svg)](https://github.com/klaufel/markdown-service/actions?query=branch%3Amain)
|
2 |
|
3 | ## 🚀 Installation
|
4 |
|
5 | ```sh
|
6 | npm install markdown-service
|
7 | ```
|
8 |
|
9 | ## 🧐 How to use?
|
10 |
|
11 | ```js
|
12 | import markdownService from "markdown-service";
|
13 |
|
14 | const markdown = await markdownService("//domain.com/awesome-readme.md");
|
15 | ```
|
16 |
|
17 | ## ⚙️ Format support
|
18 |
|
19 | [Markdown syntax](https://www.markdownguide.org/cheat-sheet/)
|
20 |
|
21 | ### Front matter `---`
|
22 |
|
23 | YAML can be used at the top of Markdown documents to add more structured data.
|
24 |
|
25 | Surround the YAML with two lines of consecutive dashes.
|
26 |
|
27 | ```mdx
|
28 | ---
|
29 | name: "The shadow of the wind"
|
30 | author: "Carlos Ruiz Zafón"
|
31 | ---
|
32 |
|
33 | _Daniel_, welcome to the cemetery of forgotten books.
|
34 | ```
|
35 |
|
36 | ```js
|
37 | const markdown = await markdownService("//domain.com/markdown.md");
|
38 |
|
39 | /*
|
40 | {
|
41 | head: {
|
42 | name: "The shadow of the wind",
|
43 | author: 'Carlos Ruiz Zafón',
|
44 | },
|
45 | content: '<strong>Daniel</strong>, welcome to the cemetery of forgotten books.'
|
46 | }
|
47 | */
|
48 | ```
|
49 |
|
50 | ## License
|
51 |
|
52 | [MIT License](LICENSE.md) © [Juan Carlos Ruiz](https://github.com/klaufel)
|