@aiquants/html-to-markdown 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/{core-C45e4gDg.js → core-0q2nkcWH.js} +955 -1053
- package/dist/core-DUdcm-c8.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +8 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +49 -17
- package/dist/src/converter.d.ts +7 -5
- package/dist/src/index.d.ts +1 -1
- package/dist/src/plugins/index.d.ts +1 -1
- package/dist/src/types.d.ts +45 -1
- package/dist/tests/browser-100.test.d.ts +1 -0
- package/dist/tests/browser-coverage.test.d.ts +1 -0
- package/dist/tests/converter-coverage.test.d.ts +1 -0
- package/dist/tests/readme-usage.test.d.ts +1 -0
- package/dist/tests/rehype-absolute-links-coverage.test.d.ts +1 -0
- package/dist/tests/rehype-sanitize-html-coverage.test.d.ts +1 -0
- package/package.json +1 -1
- package/dist/core-D1CksXT5.cjs +0 -1
package/README.md
CHANGED
|
@@ -22,13 +22,18 @@ npm install @aiquants/html-to-markdown
|
|
|
22
22
|
|
|
23
23
|
### As a Command-Line Tool
|
|
24
24
|
|
|
25
|
-
You can run the tool directly using `npx` without installation.
|
|
25
|
+
You can run the tool directly using `npx` without installation. By default, the converted Markdown will be saved in the `.outputs/raw` directory, but you can specify a custom output path using the `--output` option.
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npx @aiquants/html-to-markdown <URL> [--locale <locale>]
|
|
28
|
+
npx @aiquants/html-to-markdown <URL> [--locale <locale>] [--output <path>]
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
**
|
|
31
|
+
**Options:**
|
|
32
|
+
|
|
33
|
+
- `--locale <locale>`: Set the locale for the browser context and console messages (`en-US` or `ja-JP`). Defaults to `en-US`.
|
|
34
|
+
- `--output <path>`, `-o <path>`: Specify the output file path. If not specified, the file will be saved in the `.outputs/raw` directory with an auto-generated filename.
|
|
35
|
+
|
|
36
|
+
**Examples:**
|
|
32
37
|
|
|
33
38
|
```bash
|
|
34
39
|
# Convert a Wikipedia page with the Japanese locale
|
|
@@ -36,6 +41,12 @@ npx @aiquants/html-to-markdown https://ja.wikipedia.org/wiki/Node.js --locale ja
|
|
|
36
41
|
|
|
37
42
|
# Convert an English page (locale defaults to en-US)
|
|
38
43
|
npx @aiquants/html-to-markdown https://en.wikipedia.org/wiki/Node.js
|
|
44
|
+
|
|
45
|
+
# Save to a specific file
|
|
46
|
+
npx @aiquants/html-to-markdown https://en.wikipedia.org/wiki/Node.js --output ./my-output.md
|
|
47
|
+
|
|
48
|
+
# Use short option for output
|
|
49
|
+
npx @aiquants/html-to-markdown https://ja.wikipedia.org/wiki/Node.js --locale ja-JP -o ./nodejs-ja.md
|
|
39
50
|
```
|
|
40
51
|
|
|
41
52
|
### As a Library
|
|
@@ -105,6 +116,7 @@ This project is built upon the following open-source software. We are grateful t
|
|
|
105
116
|
| Package | License |
|
|
106
117
|
| ------------------------ | ---------- |
|
|
107
118
|
| github-slugger | MIT |
|
|
119
|
+
| happy-dom | MIT |
|
|
108
120
|
| hast | MIT |
|
|
109
121
|
| hast-util-to-html | MIT |
|
|
110
122
|
| playwright | Apache-2.0 |
|