File tree Expand file tree Collapse file tree 5 files changed +93
-4
lines changed Expand file tree Collapse file tree 5 files changed +93
-4
lines changed Original file line number Diff line number Diff line change 7
7
branches : [ main ]
8
8
9
9
jobs :
10
- deploy :
10
+ gitpage :
11
11
runs-on : ubuntu-latest
12
12
steps :
13
13
- uses : actions/checkout@v2
29
29
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/liao2000/${{ github.event.repository.name }}
30
30
git checkout -b gh-pages
31
31
git add .
32
- git commit -m "Automatically generated by CI"
32
+ git commit -m "Generated by CI"
33
33
git push --force secure-origin gh-pages
Original file line number Diff line number Diff line change 4
4
release :
5
5
types : [created]
6
6
jobs :
7
- build :
7
+ publish :
8
8
runs-on : ubuntu-latest
9
9
steps :
10
10
- uses : actions/checkout@v2
Original file line number Diff line number Diff line change
1
+ .github /
2
+ .gitattributes
3
+ example /
Original file line number Diff line number Diff line change 1
1
# HackMD to HTML cli
2
2
3
+ ![ ] ( https://img.shields.io/github/workflow/status/liao2000/HackMD-to-HTML/publish?style=flat-square )
4
+ [ ![ NPM version] ( https://img.shields.io/npm/v/hackmd-to-html-cli.svg?style=flat-square )] ( https://www.npmjs.org/package/hackmd-to-html-cli )
5
+
3
6
A simple Node.js wrapper for ` markdown-it ` . This tool helps to convert HackMD markdown files to HTML files.
4
7
8
+ > See DEMO: [ https://liao2000.github.io/HackMD-to-HTML/ ] ( https://liao2000.github.io/HackMD-to-HTML/ )
9
+
10
+ ## Install
11
+
12
+ ``` sh
13
+ npm install -g hackmd-to-html-cli
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ``` sh
19
+ $ hmd2html --help
20
+ hmd2html --help
21
+ Usage: index [options]
22
+
23
+ Options:
24
+ -v, --version output the current version
25
+ -s, --source < files_or_dirs...> specify the input markdown files or directories
26
+ -d, --destination < path> specify the output directory (default: ./output)
27
+ -l, --layout < html_file> specify the layout file (default: " " )
28
+ -h, --help display help for command
29
+ ```
30
+
31
+ ### Convert
32
+
33
+ ``` sh
34
+ # files
35
+ $ hmd2html -s file1.md file2.md file3.md
36
+
37
+ # directories
38
+ $ hmd2html -s ./dir1 ./dir2
39
+
40
+ # files or directories
41
+
42
+ $ hmd2html -s file1.md ./dir1
43
+ ```
44
+
45
+ ### Set output folder
46
+
47
+ ``` sh
48
+ $ hmd2html -s file1.md -d ./out
49
+ ```
50
+
51
+ ### Use custom layout
52
+
53
+
54
+ ``` sh
55
+ $ hmd2html -s hello.md -l ./myLayout.html
56
+ ```
57
+
58
+ + /
59
+ + output
60
+ + hello.html
61
+ + hello.md
62
+ + myLayout.html
63
+
64
+ ** myLayout.html**
65
+ ``` html
66
+ <html >
67
+ <head ></head >
68
+ <body >
69
+ {{main}}
70
+ </body >
71
+ </html >
72
+ ```
73
+
74
+ ** hello.md**
75
+ ``` markdown
76
+ # hello
77
+ ```
78
+
79
+ ** hello.html**
80
+ ``` html
81
+ <html >
82
+ <head ></head >
83
+ <body >
84
+ <h1 >hello</h1 >
85
+ </body >
86
+ </html >
87
+ ```
88
+
5
89
## TODO
6
90
7
- + publish to npm
91
+ + Provide more template & styles
92
+ + Automatically generate HTML ` <title> `
93
+ + Support more HackMD syntax
You can’t perform that action at this time.
0 commit comments