@rokelamen/md2html 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -5
- package/bin/cli.cjs +4085 -4482
- package/dist/index.d.ts +1 -0
- package/dist/index.js +82 -71
- package/dist/lib/html.d.ts +2 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/regexp.d.ts +15 -0
- package/dist/lib/render.d.ts +2 -0
- package/dist/types/index.d.ts +38 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
# md2html
|
|
2
2
|
|
|
3
|
-
A simple markdown-html
|
|
3
|
+
A simple markdown-html converter written in Typescript.
|
|
4
|
+
|
|
5
|
+
The style relies on browser pure style, inspired by [`txti`](https://txti.es/).
|
|
4
6
|
|
|
5
7
|
## Goal
|
|
6
8
|
|
|
7
9
|
> I create this project for learning TS and node dev, not for the purpose of building another better markdown parse engine.
|
|
8
10
|
|
|
9
|
-
Markdown syntax was first promoted with the release of `markdown.pl` by John Gruber. This leads to Markdown has no explicit definition, which means how markdown is parsed to HTML highly depends on the implementation of the tool. *And I
|
|
11
|
+
Markdown syntax was first promoted with the release of `markdown.pl` by John Gruber. This leads to Markdown has no explicit definition, which means how markdown is parsed to HTML highly depends on the implementation of the tool. *And I choose a simplest way(line-by-line parsing)*
|
|
10
12
|
|
|
11
13
|
To stay as close as possible to the 'Standard Markdown', [CommonMark](https://commonmark.org/) is a great reference.
|
|
12
14
|
|
|
13
|
-
##
|
|
15
|
+
## Requirement
|
|
16
|
+
|
|
17
|
+
[Node](https://nodejs.org/) environment(>= v12.0.0) is necessary.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Using npm:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm i -g @rokelamen/md2html
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### As a command-line
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
md2html [options] [input]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
1. Parse from/to stdio
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
md2html "# Markdown content" > index.html
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. Parse from/to file
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
md2html -f input.md -o index.html
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### As a library
|
|
14
48
|
|
|
15
|
-
|
|
49
|
+
```javascript
|
|
50
|
+
import { parse } from '@rokelamen/md2html';
|
|
51
|
+
```
|
|
16
52
|
|
|
17
|
-
|
|
53
|
+
## Development
|
|
18
54
|
|
|
55
|
+
For development logs, please refer to the [Development Log](docs/development.md).
|