From 2170b4a41038c291e8c9d4744d5e9c855e83900f Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 10 May 2024 21:10:10 +0800 Subject: [PATCH] doc: update document. --- packages/cli/README.md | 6 ++++- packages/html-to-markdown/README.md | 40 ++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/packages/cli/README.md b/packages/cli/README.md index 9329167..8c0be53 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -34,19 +34,23 @@ $ html-to-markdown https://jaywcjlove.github.io/idoc/ ## Command Help ```bash -Usage: html-to-markdown [options] [--help|h] [--version|v] +Usage: html-to-markdown [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 , 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 "

hello world

"| html-to-markdown - --stdout ``` ## Support Config diff --git a/packages/html-to-markdown/README.md b/packages/html-to-markdown/README.md index 9d45e85..9ad5022 100644 --- a/packages/html-to-markdown/README.md +++ b/packages/html-to-markdown/README.md @@ -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 [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 , 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 "

hello world

"| 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 @@ -96,7 +134,7 @@ As always, thanks to our amazing contributors! -Made with [action-contributors](https://github.com/jaywcjlove/github-action-contributors). +Made with [contributors](https://github.com/jaywcjlove/github-action-contributors). ## License