html-to-markdown-wasm 2.9.1 → 2.10.1
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/dist/README.md +13 -13
- package/dist/html_to_markdown_wasm.d.ts +42 -41
- package/dist/html_to_markdown_wasm_bg.js +398 -416
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/package.json +1 -1
- package/dist-node/README.md +13 -13
- package/dist-node/html_to_markdown_wasm.d.ts +42 -41
- package/dist-node/html_to_markdown_wasm.js +402 -416
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/package.json +1 -1
- package/dist-web/README.md +13 -13
- package/dist-web/html_to_markdown_wasm.d.ts +43 -41
- package/dist-web/html_to_markdown_wasm.js +395 -417
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/package.json +1 -1
- package/package.json +2 -2
|
Binary file
|
package/dist/package.json
CHANGED
package/dist-node/README.md
CHANGED
|
@@ -51,19 +51,19 @@ Experience WebAssembly-powered HTML to Markdown conversion instantly in your bro
|
|
|
51
51
|
|
|
52
52
|
## Installation
|
|
53
53
|
|
|
54
|
-
| Target | Command
|
|
55
|
-
| --------------------------- |
|
|
56
|
-
| **Node.js/Bun** (native) | `npm install html-to-markdown-node`
|
|
57
|
-
| **WebAssembly** (universal) | `npm install html-to-markdown-wasm`
|
|
58
|
-
| **Deno** | `import { convert } from "npm:html-to-markdown-wasm"`
|
|
59
|
-
| **Python** (bindings + CLI) | `pip install html-to-markdown`
|
|
60
|
-
| **PHP** (extension + helpers) | `pie install goldziher/html-to-markdown`<br>`composer require html-to-markdown
|
|
61
|
-
| **Ruby** gem | `bundle add html-to-markdown` or `gem install html-to-markdown`
|
|
62
|
-
| **Elixir** (Rustler NIF) | `{:html_to_markdown, "~> 2.8"}`
|
|
63
|
-
| **Rust** crate | `cargo add html-to-markdown-rs`
|
|
64
|
-
| Rust CLI
|
|
65
|
-
| Homebrew CLI | `brew
|
|
66
|
-
| Releases | [GitHub Releases](https://github.com/Goldziher/html-to-markdown/releases)
|
|
54
|
+
| Target | Command(s) |
|
|
55
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| **Node.js/Bun** (native) | `npm install html-to-markdown-node` |
|
|
57
|
+
| **WebAssembly** (universal) | `npm install html-to-markdown-wasm` |
|
|
58
|
+
| **Deno** | `import { convert } from "npm:html-to-markdown-wasm"` |
|
|
59
|
+
| **Python** (bindings + CLI) | `pip install html-to-markdown` |
|
|
60
|
+
| **PHP** (extension + helpers) | `PHP_EXTENSION_DIR=$(php-config --extension-dir) pie install goldziher/html-to-markdown`<br>`composer require goldziher/html-to-markdown` |
|
|
61
|
+
| **Ruby** gem | `bundle add html-to-markdown` or `gem install html-to-markdown` |
|
|
62
|
+
| **Elixir** (Rustler NIF) | `{:html_to_markdown, "~> 2.8"}` |
|
|
63
|
+
| **Rust** crate | `cargo add html-to-markdown-rs` |
|
|
64
|
+
| Rust CLI (crates.io) | `cargo install html-to-markdown-cli` |
|
|
65
|
+
| Homebrew CLI | `brew install html-to-markdown` (core) |
|
|
66
|
+
| Releases | [GitHub Releases](https://github.com/Goldziher/html-to-markdown/releases) |
|
|
67
67
|
|
|
68
68
|
## Quick Start
|
|
69
69
|
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
* Convert HTML to Markdown
|
|
5
|
-
*
|
|
6
|
-
* # Arguments
|
|
7
|
-
*
|
|
8
|
-
* * `html` - The HTML string to convert
|
|
9
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
10
|
-
*
|
|
11
|
-
* # Example
|
|
12
|
-
*
|
|
13
|
-
* ```javascript
|
|
14
|
-
* import { convert } from 'html-to-markdown-wasm';
|
|
15
|
-
*
|
|
16
|
-
* const html = '<h1>Hello World</h1>';
|
|
17
|
-
* const markdown = convert(html);
|
|
18
|
-
* console.log(markdown); // # Hello World
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export function convert(html: string, options: any): string;
|
|
22
|
-
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
23
|
-
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
24
|
-
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
25
|
-
export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
|
|
26
|
-
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
27
|
-
export function convertBytes(html: Uint8Array, options: any): string;
|
|
28
|
-
/**
|
|
29
|
-
* Initialize panic hook for better error messages in the browser
|
|
30
|
-
*/
|
|
31
|
-
export function init(): void;
|
|
3
|
+
|
|
32
4
|
export class WasmConversionOptionsHandle {
|
|
33
5
|
free(): void;
|
|
34
6
|
[Symbol.dispose](): void;
|
|
35
7
|
constructor(options: any);
|
|
36
8
|
}
|
|
37
|
-
|
|
38
|
-
* Result of HTML extraction with inline images
|
|
39
|
-
*/
|
|
9
|
+
|
|
40
10
|
export class WasmHtmlExtraction {
|
|
41
11
|
private constructor();
|
|
42
12
|
free(): void;
|
|
@@ -45,9 +15,7 @@ export class WasmHtmlExtraction {
|
|
|
45
15
|
readonly markdown: string;
|
|
46
16
|
readonly warnings: WasmInlineImageWarning[];
|
|
47
17
|
}
|
|
48
|
-
|
|
49
|
-
* Inline image data
|
|
50
|
-
*/
|
|
18
|
+
|
|
51
19
|
export class WasmInlineImage {
|
|
52
20
|
private constructor();
|
|
53
21
|
free(): void;
|
|
@@ -60,9 +28,7 @@ export class WasmInlineImage {
|
|
|
60
28
|
readonly source: string;
|
|
61
29
|
readonly filename: string | undefined;
|
|
62
30
|
}
|
|
63
|
-
|
|
64
|
-
* Inline image configuration
|
|
65
|
-
*/
|
|
31
|
+
|
|
66
32
|
export class WasmInlineImageConfig {
|
|
67
33
|
free(): void;
|
|
68
34
|
[Symbol.dispose](): void;
|
|
@@ -71,9 +37,7 @@ export class WasmInlineImageConfig {
|
|
|
71
37
|
set filenamePrefix(value: string | null | undefined);
|
|
72
38
|
set inferDimensions(value: boolean);
|
|
73
39
|
}
|
|
74
|
-
|
|
75
|
-
* Warning about inline image processing
|
|
76
|
-
*/
|
|
40
|
+
|
|
77
41
|
export class WasmInlineImageWarning {
|
|
78
42
|
private constructor();
|
|
79
43
|
free(): void;
|
|
@@ -81,3 +45,40 @@ export class WasmInlineImageWarning {
|
|
|
81
45
|
readonly index: number;
|
|
82
46
|
readonly message: string;
|
|
83
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Convert HTML to Markdown
|
|
51
|
+
*
|
|
52
|
+
* # Arguments
|
|
53
|
+
*
|
|
54
|
+
* * `html` - The HTML string to convert
|
|
55
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
56
|
+
*
|
|
57
|
+
* # Example
|
|
58
|
+
*
|
|
59
|
+
* ```javascript
|
|
60
|
+
* import { convert } from 'html-to-markdown-wasm';
|
|
61
|
+
*
|
|
62
|
+
* const html = '<h1>Hello World</h1>';
|
|
63
|
+
* const markdown = convert(html);
|
|
64
|
+
* console.log(markdown); // # Hello World
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function convert(html: string, options: any): string;
|
|
68
|
+
|
|
69
|
+
export function convertBytes(html: Uint8Array, options: any): string;
|
|
70
|
+
|
|
71
|
+
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
72
|
+
|
|
73
|
+
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
74
|
+
|
|
75
|
+
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
76
|
+
|
|
77
|
+
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
78
|
+
|
|
79
|
+
export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Initialize panic hook for better error messages in the browser
|
|
83
|
+
*/
|
|
84
|
+
export function init(): void;
|