Skip to content

Commit c9d241a

Browse files
committed
Update README & workflow
1 parent 444a2e7 commit c9d241a

File tree

5 files changed

+93
-4
lines changed

5 files changed

+93
-4
lines changed

.github/workflows/convert.yml renamed to .github/workflows/gitpage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
deploy:
10+
gitpage:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
@@ -29,5 +29,5 @@ jobs:
2929
git remote add secure-origin https://${{ secrets.NPM_CI }}@github.com/liao2000/${{ github.event.repository.name }}
3030
git checkout -b gh-pages
3131
git add .
32-
git commit -m "Automatically generated by CI"
32+
git commit -m "Generated by CI"
3333
git push --force secure-origin gh-pages

.github/workflows/main.yml renamed to .github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
release:
55
types: [created]
66
jobs:
7-
build:
7+
publish:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.github/
2+
.gitattributes
3+
example/

CHANGELOG.md

Whitespace-only changes.

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,93 @@
11
# HackMD to HTML cli
22

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+
36
A simple Node.js wrapper for `markdown-it`. This tool helps to convert HackMD markdown files to HTML files.
47

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+
589
## TODO
690

7-
+ publish to npm
91+
+ Provide more template & styles
92+
+ Automatically generate HTML `<title>`
93+
+ Support more HackMD syntax

0 commit comments

Comments
 (0)