JSPM

@wcj/html-to-markdown-cli

2.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 528
  • Score
    100M100P100Q107038F
  • License MIT

Command line tool for html conversion markdown.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wcj/html-to-markdown-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @wcj/html-to-markdown-cli

    Buy me a coffee CI NPM @wcj/html-to-markdown version NPM @wcj/html-to-markdown-cli version

    Command line tool for html conversion markdown.

    Quick Start

    $ npx @wcj/html-to-markdown-cli ./html/index.html
    # 🌐 Request: /Users/xxx/index.html
    # 🎉 Compliled successfully!
    # ╰┈ Output: /Users/xxx/dist/index.md
    $ npx @wcj/html-to-markdown-cli https://jaywcjlove.github.io/idoc/
    # 🌐 Request: https://jaywcjlove.github.io/idoc/
    # 🎉 Compliled successfully!
    # ╰┈ Output: /Users/xxx/dist/idoc.md

    Or

    $ sudo npm i @wcj/html-to-markdown-cli -g
    $ html-to-markdown ./html/index.html
    # => # Markdown String
    $ html-to-markdown https://jaywcjlove.github.io/idoc/
    # => # Markdown String

    Command Help

    Usage: html-to-markdown <URL|file path|-> [options] [--help|h] [--version|v]
    
    Passing "-" as the first arg will take input from STDIN
    
    Options:
    
      -v, --version, Show version number
      -h, --help, Displays help information.
      -o, --output <dir-path>, Output directory. defalut(dist)
      -s, --stdout, Output to stdout
    
    Example:
    
      html-to-markdown ./html/index.html
      html-to-markdown https://jaywcjlove.github.io/idoc/
      html-to-markdown --output="dist"
      echo "<h1>hello world</h1>"| html-to-markdown - --stdout

    Support Config

    In the project's root directory, add a .htm2mdrc.js file with the following configuration to enable the rehype and remark plugins.

    /**
     * @typedef {import("@wcj/html-to-markdown").Options} Options
     * @type {Options}
     **/
    export default { 
      rehypeParseOption: {},
      rehypePlugins: [],
      remarkPlugins: [],
    };

    The configuration is supported by auto-config-loader and it supports configurations in formats of .htm2mdrc.js, .htm2mdrc.mjs, .htm2mdrc.cjs, and .htm2mdrc.ts.

    License

    Licensed under the MIT License.