Skip to content

Commit

Permalink
doc: update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 10, 2024
1 parent 973fcb4 commit 2170b4a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,23 @@ $ html-to-markdown https://jaywcjlove.github.io/idoc/
## Command Help

```bash
Usage: html-to-markdown <URL|file path> [options] [--help|h] [--version|v]
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
Expand Down
40 changes: 39 additions & 1 deletion packages/html-to-markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,44 @@ $ html-to-markdown https://jaywcjlove.github.io/idoc/
# ╰┈ Output: /Users/xxx/dist/idoc.md
```

Command Help

```bash
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](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) and [remark](https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins) plugins.

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

## Usage

```js
Expand Down Expand Up @@ -96,7 +134,7 @@ As always, thanks to our amazing contributors!
<img src="https://jaywcjlove.github.io/html-to-markdown-cli/CONTRIBUTORS.svg" />
</a>

Made with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).
Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).

## License

Expand Down

0 comments on commit 2170b4a

Please sign in to comment.