8000 GitHub - ksw2000/hackmd-to-html-cli at v0.0.8
[go: up one dir, main page]

Skip to content

ksw2000/hackmd-to-html-cli

Repository files navigation

hackmd-to-html-cli

NPM version

A simple Node.js wrapper for markdown-it. This tool helps to convert HackMD markdown files to HTML files.

Install

npm install -g hackmd-to-html-cli

Input: ./example/index.md

Output: https://ksw2000.github.io/hackmd-to-html-cli/

Usage

$ hmd2html --help
hmd2html --help
Usage: index [options]

Options:
  -v, --version                    output the current version
  -s, --source <files_or_dirs...>  specify the input markdown files or directories
  -d, --destination <path>         specify the output directory (default: ./output)
  -l, --layout <html_file>         specify the layout file (default: "")
  -b, --hardBreak                  use hard break instead of soft break
  -h, --help                       display help for command

Convert

# files
$ hmd2html -s file1.md file2.md file3.md

# directories
$ hmd2html -s ./dir1 ./dir2

# files or directories
$ hmd2html -s file1.md ./dir1

Set output folder

$ hmd2html -s file1.md -d ./out

Use custom layout

$ hmd2html -s hello.md -l ./myLayout.html
  • /
    • output/ generated
      • hello.html
    • hello.md
    • myLayout.html

./myLayout.html

<html>
    <head></head>
    <body>
        {{main}}
    </body>
</html>

./hello.md

# hello

./output/hello.html

<html>
    <head></head>
    <body>
        <h1>hello</h1>
    </body>
</html>

Develop

  1. npm run lint to check the format of source code.
  2. npm test to test this package, which generates result from ./example into ./output.

TODO

  • Provide more templates & styles
  • Support more HackMD syntax
    • specifiy your name, time and color to vary the blockquotes.
    • YAML Metadata
    • Render CSV as table
    • PlantUML
    • Fretboard
    • Support externals

About

A CLI/Package converts HackMD markdown to HTML.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  
0