@kreuzberg/html-to-markdown-wasm 3.4.1 → 3.5.0-rc.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/LICENSE +21 -0
- package/README.md +233 -0
- package/package.json +1 -1
- package/pkg/bundler/LICENSE +21 -0
- package/pkg/bundler/README.md +233 -0
- package/pkg/bundler/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/bundler/html_to_markdown_wasm.js +1 -1
- package/pkg/bundler/html_to_markdown_wasm_bg.js +798 -591
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/bundler/package.json +1 -1
- package/pkg/deno/LICENSE +21 -0
- package/pkg/deno/README.md +233 -0
- package/pkg/deno/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/deno/html_to_markdown_wasm.js +798 -591
- package/pkg/deno/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/deno/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/nodejs/LICENSE +21 -0
- package/pkg/nodejs/README.md +233 -0
- package/pkg/nodejs/html_to_markdown_wasm.d.ts +107 -266
- package/pkg/nodejs/html_to_markdown_wasm.js +798 -592
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/nodejs/package.json +1 -1
- package/pkg/web/LICENSE +21 -0
- package/pkg/web/README.md +233 -0
- package/pkg/web/html_to_markdown_wasm.d.ts +161 -286
- package/pkg/web/html_to_markdown_wasm.js +798 -591
- package/pkg/web/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/web/html_to_markdown_wasm_bg.wasm.d.ts +54 -20
- package/pkg/web/package.json +1 -1
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_wasmannotationkind_free: (a: number, b: number) => void;
|
|
4
5
|
export const __wbg_wasmconversionoptions_free: (a: number, b: number) => void;
|
|
5
|
-
export const __wbg_wasmconversionoptionsbuilder_free: (a: number, b: number) => void;
|
|
6
6
|
export const __wbg_wasmconversionoptionsupdate_free: (a: number, b: number) => void;
|
|
7
7
|
export const __wbg_wasmconversionresult_free: (a: number, b: number) => void;
|
|
8
8
|
export const __wbg_wasmdocumentmetadata_free: (a: number, b: number) => void;
|
|
@@ -13,6 +13,7 @@ export const __wbg_wasmheadermetadata_free: (a: number, b: number) => void;
|
|
|
13
13
|
export const __wbg_wasmhtmlmetadata_free: (a: number, b: number) => void;
|
|
14
14
|
export const __wbg_wasmimagemetadata_free: (a: number, b: number) => void;
|
|
15
15
|
export const __wbg_wasmlinkmetadata_free: (a: number, b: number) => void;
|
|
16
|
+
export const __wbg_wasmnodecontent_free: (a: number, b: number) => void;
|
|
16
17
|
export const __wbg_wasmnodecontext_free: (a: number, b: number) => void;
|
|
17
18
|
export const __wbg_wasmpreprocessingoptions_free: (a: number, b: number) => void;
|
|
18
19
|
export const __wbg_wasmprocessingwarning_free: (a: number, b: number) => void;
|
|
@@ -22,14 +23,20 @@ export const __wbg_wasmtablegrid_free: (a: number, b: number) => void;
|
|
|
22
23
|
export const __wbg_wasmtextannotation_free: (a: number, b: number) => void;
|
|
23
24
|
export const __wbg_wasmvisitorhandle_free: (a: number, b: number) => void;
|
|
24
25
|
export const convert: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
-
export const
|
|
26
|
+
export const wasmannotationkind_annotationType: (a: number, b: number) => void;
|
|
27
|
+
export const wasmannotationkind_default: () => number;
|
|
28
|
+
export const wasmannotationkind_set_annotationType: (a: number, b: number, c: number) => void;
|
|
29
|
+
export const wasmannotationkind_set_title: (a: number, b: number, c: number) => void;
|
|
30
|
+
export const wasmannotationkind_set_url: (a: number, b: number, c: number) => void;
|
|
31
|
+
export const wasmannotationkind_title: (a: number, b: number) => void;
|
|
32
|
+
export const wasmannotationkind_url: (a: number, b: number) => void;
|
|
26
33
|
export const wasmconversionoptions_autolinks: (a: number) => number;
|
|
27
34
|
export const wasmconversionoptions_brInTables: (a: number) => number;
|
|
28
|
-
export const wasmconversionoptions_builder: () => number;
|
|
29
35
|
export const wasmconversionoptions_bullets: (a: number, b: number) => void;
|
|
30
36
|
export const wasmconversionoptions_captureSvg: (a: number) => number;
|
|
31
37
|
export const wasmconversionoptions_codeBlockStyle: (a: number, b: number) => void;
|
|
32
38
|
export const wasmconversionoptions_codeLanguage: (a: number, b: number) => void;
|
|
39
|
+
export const wasmconversionoptions_compactTables: (a: number) => number;
|
|
33
40
|
export const wasmconversionoptions_convertAsInline: (a: number) => number;
|
|
34
41
|
export const wasmconversionoptions_debug: (a: number) => number;
|
|
35
42
|
export const wasmconversionoptions_default: () => number;
|
|
@@ -42,8 +49,6 @@ export const wasmconversionoptions_escapeUnderscores: (a: number) => number;
|
|
|
42
49
|
export const wasmconversionoptions_excludeSelectors: (a: number, b: number) => void;
|
|
43
50
|
export const wasmconversionoptions_extractImages: (a: number) => number;
|
|
44
51
|
export const wasmconversionoptions_extractMetadata: (a: number) => number;
|
|
45
|
-
export const wasmconversionoptions_from: (a: number) => number;
|
|
46
|
-
export const wasmconversionoptions_fromUpdate: (a: number) => number;
|
|
47
52
|
export const wasmconversionoptions_headingStyle: (a: number, b: number) => void;
|
|
48
53
|
export const wasmconversionoptions_highlightStyle: (a: number, b: number) => void;
|
|
49
54
|
export const wasmconversionoptions_includeDocumentStructure: (a: number) => number;
|
|
@@ -54,7 +59,7 @@ export const wasmconversionoptions_listIndentType: (a: number, b: number) => voi
|
|
|
54
59
|
export const wasmconversionoptions_listIndentWidth: (a: number) => number;
|
|
55
60
|
export const wasmconversionoptions_maxDepth: (a: number) => number;
|
|
56
61
|
export const wasmconversionoptions_maxImageSize: (a: number) => bigint;
|
|
57
|
-
export const wasmconversionoptions_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1:
|
|
62
|
+
export const wasmconversionoptions_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: bigint, v1: number, w1: number, x1: number, y1: number, z1: number) => number;
|
|
58
63
|
export const wasmconversionoptions_newlineStyle: (a: number, b: number) => void;
|
|
59
64
|
export const wasmconversionoptions_outputFormat: (a: number, b: number) => void;
|
|
60
65
|
export const wasmconversionoptions_preprocessing: (a: number) => number;
|
|
@@ -65,6 +70,7 @@ export const wasmconversionoptions_set_bullets: (a: number, b: number, c: number
|
|
|
65
70
|
export const wasmconversionoptions_set_captureSvg: (a: number, b: number) => void;
|
|
66
71
|
export const wasmconversionoptions_set_codeBlockStyle: (a: number, b: number) => void;
|
|
67
72
|
export const wasmconversionoptions_set_codeLanguage: (a: number, b: number, c: number) => void;
|
|
73
|
+
export const wasmconversionoptions_set_compactTables: (a: number, b: number) => void;
|
|
68
74
|
export const wasmconversionoptions_set_convertAsInline: (a: number, b: number) => void;
|
|
69
75
|
export const wasmconversionoptions_set_debug: (a: number, b: number) => void;
|
|
70
76
|
export const wasmconversionoptions_set_defaultTitle: (a: number, b: number) => void;
|
|
@@ -110,19 +116,13 @@ export const wasmconversionoptions_visitor: (a: number) => number;
|
|
|
110
116
|
export const wasmconversionoptions_whitespaceMode: (a: number, b: number) => void;
|
|
111
117
|
export const wasmconversionoptions_wrap: (a: number) => number;
|
|
112
118
|
export const wasmconversionoptions_wrapWidth: (a: number) => number;
|
|
113
|
-
export const wasmconversionoptionsbuilder_build: (a: number) => number;
|
|
114
|
-
export const wasmconversionoptionsbuilder_excludeSelectors: (a: number, b: number, c: number) => number;
|
|
115
|
-
export const wasmconversionoptionsbuilder_keepInlineImagesIn: (a: number, b: number, c: number) => number;
|
|
116
|
-
export const wasmconversionoptionsbuilder_preprocessing: (a: number, b: number) => number;
|
|
117
|
-
export const wasmconversionoptionsbuilder_preserveTags: (a: number, b: number, c: number) => number;
|
|
118
|
-
export const wasmconversionoptionsbuilder_stripTags: (a: number, b: number, c: number) => number;
|
|
119
|
-
export const wasmconversionoptionsbuilder_visitor: (a: number, b: number) => number;
|
|
120
119
|
export const wasmconversionoptionsupdate_autolinks: (a: number) => number;
|
|
121
120
|
export const wasmconversionoptionsupdate_brInTables: (a: number) => number;
|
|
122
121
|
export const wasmconversionoptionsupdate_bullets: (a: number, b: number) => void;
|
|
123
122
|
export const wasmconversionoptionsupdate_captureSvg: (a: number) => number;
|
|
124
123
|
export const wasmconversionoptionsupdate_codeBlockStyle: (a: number, b: number) => void;
|
|
125
124
|
export const wasmconversionoptionsupdate_codeLanguage: (a: number, b: number) => void;
|
|
125
|
+
export const wasmconversionoptionsupdate_compactTables: (a: number) => number;
|
|
126
126
|
export const wasmconversionoptionsupdate_convertAsInline: (a: number) => number;
|
|
127
127
|
export const wasmconversionoptionsupdate_debug: (a: number) => number;
|
|
128
128
|
export const wasmconversionoptionsupdate_default: () => number;
|
|
@@ -145,7 +145,7 @@ export const wasmconversionoptionsupdate_listIndentType: (a: number, b: number)
|
|
|
145
145
|
export const wasmconversionoptionsupdate_listIndentWidth: (a: number) => number;
|
|
146
146
|
export const wasmconversionoptionsupdate_maxDepth: (a: number) => number;
|
|
147
147
|
export const wasmconversionoptionsupdate_maxImageSize: (a: number, b: number) => void;
|
|
148
|
-
export const wasmconversionoptionsupdate_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1:
|
|
148
|
+
export const wasmconversionoptionsupdate_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: bigint, v1: number, w1: number, x1: number, y1: number, z1: number) => number;
|
|
149
149
|
export const wasmconversionoptionsupdate_newlineStyle: (a: number, b: number) => void;
|
|
150
150
|
export const wasmconversionoptionsupdate_outputFormat: (a: number, b: number) => void;
|
|
151
151
|
export const wasmconversionoptionsupdate_preprocessing: (a: number) => number;
|
|
@@ -156,6 +156,7 @@ export const wasmconversionoptionsupdate_set_bullets: (a: number, b: number, c:
|
|
|
156
156
|
export const wasmconversionoptionsupdate_set_captureSvg: (a: number, b: number) => void;
|
|
157
157
|
export const wasmconversionoptionsupdate_set_codeBlockStyle: (a: number, b: number) => void;
|
|
158
158
|
export const wasmconversionoptionsupdate_set_codeLanguage: (a: number, b: number, c: number) => void;
|
|
159
|
+
export const wasmconversionoptionsupdate_set_compactTables: (a: number, b: number) => void;
|
|
159
160
|
export const wasmconversionoptionsupdate_set_convertAsInline: (a: number, b: number) => void;
|
|
160
161
|
export const wasmconversionoptionsupdate_set_debug: (a: number, b: number) => void;
|
|
161
162
|
export const wasmconversionoptionsupdate_set_defaultTitle: (a: number, b: number) => void;
|
|
@@ -242,7 +243,7 @@ export const wasmdocumentmetadata_twitterCard: (a: number) => number;
|
|
|
242
243
|
export const wasmdocumentnode_annotations: (a: number, b: number) => void;
|
|
243
244
|
export const wasmdocumentnode_attributes: (a: number) => number;
|
|
244
245
|
export const wasmdocumentnode_children: (a: number, b: number) => void;
|
|
245
|
-
export const wasmdocumentnode_content: (a: number
|
|
246
|
+
export const wasmdocumentnode_content: (a: number) => number;
|
|
246
247
|
export const wasmdocumentnode_default: () => number;
|
|
247
248
|
export const wasmdocumentnode_id: (a: number, b: number) => void;
|
|
248
249
|
export const wasmdocumentnode_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
@@ -311,7 +312,6 @@ export const wasmimagemetadata_set_title: (a: number, b: number, c: number) => v
|
|
|
311
312
|
export const wasmimagemetadata_src: (a: number, b: number) => void;
|
|
312
313
|
export const wasmimagemetadata_title: (a: number, b: number) => void;
|
|
313
314
|
export const wasmlinkmetadata_attributes: (a: number) => number;
|
|
314
|
-
export const wasmlinkmetadata_classifyLink: (a: number, b: number) => number;
|
|
315
315
|
export const wasmlinkmetadata_default: () => number;
|
|
316
316
|
export const wasmlinkmetadata_href: (a: number, b: number) => void;
|
|
317
317
|
export const wasmlinkmetadata_linkType: (a: number, b: number) => void;
|
|
@@ -325,6 +325,39 @@ export const wasmlinkmetadata_set_text: (a: number, b: number, c: number) => voi
|
|
|
325
325
|
export const wasmlinkmetadata_set_title: (a: number, b: number, c: number) => void;
|
|
326
326
|
export const wasmlinkmetadata_text: (a: number, b: number) => void;
|
|
327
327
|
export const wasmlinkmetadata_title: (a: number, b: number) => void;
|
|
328
|
+
export const wasmnodecontent_content: (a: number, b: number) => void;
|
|
329
|
+
export const wasmnodecontent_default: () => number;
|
|
330
|
+
export const wasmnodecontent_definition: (a: number, b: number) => void;
|
|
331
|
+
export const wasmnodecontent_description: (a: number, b: number) => void;
|
|
332
|
+
export const wasmnodecontent_entries: (a: number) => number;
|
|
333
|
+
export const wasmnodecontent_format: (a: number, b: number) => void;
|
|
334
|
+
export const wasmnodecontent_grid: (a: number) => number;
|
|
335
|
+
export const wasmnodecontent_headingLevel: (a: number) => number;
|
|
336
|
+
export const wasmnodecontent_headingText: (a: number, b: number) => void;
|
|
337
|
+
export const wasmnodecontent_label: (a: number, b: number) => void;
|
|
338
|
+
export const wasmnodecontent_language: (a: number, b: number) => void;
|
|
339
|
+
export const wasmnodecontent_level: (a: number) => number;
|
|
340
|
+
export const wasmnodecontent_nodeType: (a: number, b: number) => void;
|
|
341
|
+
export const wasmnodecontent_ordered: (a: number) => number;
|
|
342
|
+
export const wasmnodecontent_set_content: (a: number, b: number, c: number) => void;
|
|
343
|
+
export const wasmnodecontent_set_definition: (a: number, b: number, c: number) => void;
|
|
344
|
+
export const wasmnodecontent_set_description: (a: number, b: number, c: number) => void;
|
|
345
|
+
export const wasmnodecontent_set_entries: (a: number, b: number) => void;
|
|
346
|
+
export const wasmnodecontent_set_format: (a: number, b: number, c: number) => void;
|
|
347
|
+
export const wasmnodecontent_set_grid: (a: number, b: number) => void;
|
|
348
|
+
export const wasmnodecontent_set_headingLevel: (a: number, b: number) => void;
|
|
349
|
+
export const wasmnodecontent_set_headingText: (a: number, b: number, c: number) => void;
|
|
350
|
+
export const wasmnodecontent_set_label: (a: number, b: number, c: number) => void;
|
|
351
|
+
export const wasmnodecontent_set_language: (a: number, b: number, c: number) => void;
|
|
352
|
+
export const wasmnodecontent_set_level: (a: number, b: number) => void;
|
|
353
|
+
export const wasmnodecontent_set_nodeType: (a: number, b: number, c: number) => void;
|
|
354
|
+
export const wasmnodecontent_set_ordered: (a: number, b: number) => void;
|
|
355
|
+
export const wasmnodecontent_set_src: (a: number, b: number, c: number) => void;
|
|
356
|
+
export const wasmnodecontent_set_term: (a: number, b: number, c: number) => void;
|
|
357
|
+
export const wasmnodecontent_set_text: (a: number, b: number, c: number) => void;
|
|
358
|
+
export const wasmnodecontent_src: (a: number, b: number) => void;
|
|
359
|
+
export const wasmnodecontent_term: (a: number, b: number) => void;
|
|
360
|
+
export const wasmnodecontent_text: (a: number, b: number) => void;
|
|
328
361
|
export const wasmnodecontext_attributes: (a: number) => number;
|
|
329
362
|
export const wasmnodecontext_default: () => number;
|
|
330
363
|
export const wasmnodecontext_indexInParent: (a: number) => number;
|
|
@@ -339,10 +372,8 @@ export const wasmnodecontext_set_nodeType: (a: number, b: number) => void;
|
|
|
339
372
|
export const wasmnodecontext_set_parentTag: (a: number, b: number, c: number) => void;
|
|
340
373
|
export const wasmnodecontext_set_tagName: (a: number, b: number, c: number) => void;
|
|
341
374
|
export const wasmnodecontext_tagName: (a: number, b: number) => void;
|
|
342
|
-
export const wasmpreprocessingoptions_applyUpdate: (a: number, b: number) => void;
|
|
343
375
|
export const wasmpreprocessingoptions_default: () => number;
|
|
344
376
|
export const wasmpreprocessingoptions_enabled: (a: number) => number;
|
|
345
|
-
export const wasmpreprocessingoptions_from: (a: number) => number;
|
|
346
377
|
export const wasmpreprocessingoptions_new: (a: number, b: number, c: number, d: number) => number;
|
|
347
378
|
export const wasmpreprocessingoptions_preset: (a: number, b: number) => void;
|
|
348
379
|
export const wasmpreprocessingoptions_removeForms: (a: number) => number;
|
|
@@ -387,22 +418,25 @@ export const wasmtablegrid_new: (a: number, b: number, c: number, d: number) =>
|
|
|
387
418
|
export const wasmtablegrid_set_cells: (a: number, b: number, c: number) => void;
|
|
388
419
|
export const wasmtextannotation_default: () => number;
|
|
389
420
|
export const wasmtextannotation_end: (a: number) => number;
|
|
390
|
-
export const wasmtextannotation_kind: (a: number
|
|
421
|
+
export const wasmtextannotation_kind: (a: number) => number;
|
|
391
422
|
export const wasmtextannotation_new: (a: number, b: number, c: number) => number;
|
|
392
423
|
export const wasmtextannotation_set_end: (a: number, b: number) => void;
|
|
393
424
|
export const wasmtextannotation_set_kind: (a: number, b: number) => void;
|
|
394
425
|
export const wasmtextannotation_set_start: (a: number, b: number) => void;
|
|
395
426
|
export const wasmtextannotation_start: (a: number) => number;
|
|
396
427
|
export const wasmvisitorhandle_new: (a: number) => number;
|
|
397
|
-
export const
|
|
428
|
+
export const wasmnodecontent_new: () => number;
|
|
398
429
|
export const wasmheadermetadata_set_depth: (a: number, b: number) => void;
|
|
399
430
|
export const wasmnodecontext_set_depth: (a: number, b: number) => void;
|
|
400
431
|
export const wasmtablegrid_set_cols: (a: number, b: number) => void;
|
|
401
432
|
export const wasmtablegrid_set_rows: (a: number, b: number) => void;
|
|
433
|
+
export const wasmnodecontent_set_imageIndex: (a: number, b: number) => void;
|
|
402
434
|
export const wasmheadermetadata_depth: (a: number) => number;
|
|
403
435
|
export const wasmnodecontext_depth: (a: number) => number;
|
|
404
436
|
export const wasmtablegrid_cols: (a: number) => number;
|
|
405
437
|
export const wasmtablegrid_rows: (a: number) => number;
|
|
438
|
+
export const wasmannotationkind_new: () => number;
|
|
439
|
+
export const wasmnodecontent_imageIndex: (a: number) => number;
|
|
406
440
|
export const __wbg_wasmpreprocessingoptionsupdate_free: (a: number, b: number) => void;
|
|
407
441
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
408
442
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2024-2025 Na'aman Hirschfeld
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# html-to-markdown
|
|
2
|
+
|
|
3
|
+
<div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
|
|
4
|
+
<a href="https://github.com/kreuzberg-dev/alef">
|
|
5
|
+
<img src="https://img.shields.io/badge/Bindings-alef%20%D7%90-007ec6" alt="Bindings">
|
|
6
|
+
</a>
|
|
7
|
+
<!-- Language Bindings -->
|
|
8
|
+
<a href="https://crates.io/crates/html-to-markdown-rs">
|
|
9
|
+
<img src="https://img.shields.io/crates/v/html-to-markdown-rs?label=Rust&color=007ec6" alt="Rust">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://pypi.org/project/html-to-markdown/">
|
|
12
|
+
<img src="https://img.shields.io/pypi/v/html-to-markdown?label=Python&color=007ec6" alt="Python">
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@kreuzberg/html-to-markdown-node">
|
|
15
|
+
<img src="https://img.shields.io/npm/v/@kreuzberg/html-to-markdown-node?label=Node.js&color=007ec6" alt="Node.js">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@kreuzberg/html-to-markdown-wasm">
|
|
18
|
+
<img src="https://img.shields.io/npm/v/@kreuzberg/html-to-markdown-wasm?label=WASM&color=007ec6" alt="WASM">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://central.sonatype.com/artifact/dev.kreuzberg/html-to-markdown">
|
|
21
|
+
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/html-to-markdown?label=Java&color=007ec6" alt="Java">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://pkg.go.dev/github.com/kreuzberg-dev/html-to-markdown/packages/go/v3/htmltomarkdown">
|
|
24
|
+
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/html-to-markdown?label=Go&color=007ec6&filter=v3*" alt="Go">
|
|
25
|
+
</a>
|
|
26
|
+
<a href="https://www.nuget.org/packages/KreuzbergDev.HtmlToMarkdown/">
|
|
27
|
+
<img src="https://img.shields.io/nuget/v/KreuzbergDev.HtmlToMarkdown?label=C%23&color=007ec6" alt="C#">
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://packagist.org/packages/kreuzberg-dev/html-to-markdown">
|
|
30
|
+
<img src="https://img.shields.io/packagist/v/kreuzberg-dev/html-to-markdown?label=PHP&color=007ec6" alt="PHP">
|
|
31
|
+
</a>
|
|
32
|
+
<a href="https://rubygems.org/gems/html-to-markdown">
|
|
33
|
+
<img src="https://img.shields.io/gem/v/html-to-markdown?label=Ruby&color=007ec6" alt="Ruby">
|
|
34
|
+
</a>
|
|
35
|
+
<a href="https://hex.pm/packages/html_to_markdown">
|
|
36
|
+
<img src="https://img.shields.io/hexpm/v/html_to_markdown?label=Elixir&color=007ec6" alt="Elixir">
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://kreuzberg-dev.r-universe.dev/htmltomarkdown">
|
|
39
|
+
<img src="https://img.shields.io/badge/R-htmltomarkdown-007ec6" alt="R">
|
|
40
|
+
</a>
|
|
41
|
+
<a href="https://pub.dev/packages/h2m">
|
|
42
|
+
<img src="https://img.shields.io/pub/v/h2m?label=Dart&color=007ec6" alt="Dart">
|
|
43
|
+
</a>
|
|
44
|
+
<a href="https://central.sonatype.com/artifact/dev.kreuzberg/html-to-markdown-android">
|
|
45
|
+
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/html-to-markdown-android?label=Kotlin&color=007ec6" alt="Kotlin">
|
|
46
|
+
</a>
|
|
47
|
+
<a href="https://github.com/kreuzberg-dev/html-to-markdown/tree/main/packages/swift">
|
|
48
|
+
<img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift">
|
|
49
|
+
</a>
|
|
50
|
+
<a href="https://github.com/kreuzberg-dev/html-to-markdown/tree/main/packages/zig">
|
|
51
|
+
<img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig">
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://github.com/kreuzberg-dev/html-to-markdown/releases">
|
|
54
|
+
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI">
|
|
55
|
+
</a>
|
|
56
|
+
|
|
57
|
+
<!-- Project Info -->
|
|
58
|
+
<a href="https://github.com/kreuzberg-dev/html-to-markdown/blob/main/LICENSE">
|
|
59
|
+
<img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License">
|
|
60
|
+
</a>
|
|
61
|
+
<a href="https://docs.html-to-markdown.kreuzberg.dev">
|
|
62
|
+
<img src="https://img.shields.io/badge/Docs-html--to--markdown-007ec6" alt="Documentation">
|
|
63
|
+
</a>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div align="center" style="margin: 24px 0 0;">
|
|
67
|
+
<a href="https://kreuzberg.dev">
|
|
68
|
+
<img alt="html-to-markdown" src="https://github.com/user-attachments/assets/478a83da-237b-446b-b3a8-e564c13e00a8" />
|
|
69
|
+
</a>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px;">
|
|
73
|
+
<a href="https://discord.gg/xt9WY3GnKR">
|
|
74
|
+
<img height="22" src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white" alt="Join Discord">
|
|
75
|
+
</a>
|
|
76
|
+
<a href="https://docs.html-to-markdown.kreuzberg.dev/demo/">
|
|
77
|
+
<img height="22" src="https://img.shields.io/badge/Live%20Demo-Open-007ec6?logo=webassembly&logoColor=white" alt="Live Demo">
|
|
78
|
+
</a>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
Pure WebAssembly build of html-to-markdown for browsers, Deno, Cloudflare Workers, and other JS
|
|
82
|
+
runtimes without a Node.js native-addon ABI. Single `.wasm` artifact loaded via `wasm-bindgen`,
|
|
83
|
+
shipped with TypeScript types and dist targets for nodejs, web, bundler, and deno.
|
|
84
|
+
|
|
85
|
+
## What This Package Provides
|
|
86
|
+
|
|
87
|
+
- **Same renderer as every binding** — output matches Rust, Python, Node.js, Ruby, PHP, Go, Java, .NET, Elixir, R, Dart, Swift, Zig, C FFI, and WASM.
|
|
88
|
+
- **Structured conversion result** — Markdown plus metadata, links, headings, images, tables, and warnings where the binding exposes them.
|
|
89
|
+
- **Production defaults** — HTML is parsed with the Rust core, sanitized by default, and rendered without runtime-specific Markdown drift.
|
|
90
|
+
|
|
91
|
+
## Installation
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm add @kreuzberg/html-to-markdown-wasm
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Performance Snapshot
|
|
98
|
+
|
|
99
|
+
## Quick Start
|
|
100
|
+
|
|
101
|
+
Basic conversion:
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
import init, { convert } from "@kreuzberg/html-to-markdown-wasm";
|
|
105
|
+
|
|
106
|
+
await init();
|
|
107
|
+
|
|
108
|
+
const html = "<h1>Hello</h1><p>This is <strong>fast</strong>!</p>";
|
|
109
|
+
const result = convert(html);
|
|
110
|
+
const markdown = result.content;
|
|
111
|
+
console.log(markdown);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
With conversion options:
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
import init, { convert } from "@kreuzberg/html-to-markdown-wasm";
|
|
118
|
+
|
|
119
|
+
await init();
|
|
120
|
+
|
|
121
|
+
const result = convert('<h1>Hello</h1><img src="pic.jpg">', {
|
|
122
|
+
headingStyle: "atx",
|
|
123
|
+
skipImages: true,
|
|
124
|
+
});
|
|
125
|
+
const markdown = result.content;
|
|
126
|
+
console.log(markdown);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## API Reference
|
|
130
|
+
|
|
131
|
+
### Core Function
|
|
132
|
+
|
|
133
|
+
### Options
|
|
134
|
+
|
|
135
|
+
**`ConversionOptions`** – Key configuration fields:
|
|
136
|
+
|
|
137
|
+
- `heading_style`: Heading format (`"underlined"` | `"atx"` | `"atx_closed"`) — default: `"underlined"`
|
|
138
|
+
- `list_indent_width`: Spaces per indent level — default: `2`
|
|
139
|
+
- `bullets`: Bullet characters cycle — default: `"*+-"`
|
|
140
|
+
- `wrap`: Enable text wrapping — default: `false`
|
|
141
|
+
- `wrap_width`: Wrap at column — default: `80`
|
|
142
|
+
- `code_language`: Default fenced code block language — default: none
|
|
143
|
+
- `extract_metadata`: Enable metadata extraction into `result.metadata` — default: `false`
|
|
144
|
+
- `extract_tables`: Enable structured table extraction into `result.tables` — default: `false`
|
|
145
|
+
- `output_format`: Output markup format (`"markdown"` | `"djot"` | `"plain"`) — default: `"markdown"`
|
|
146
|
+
|
|
147
|
+
## Djot Output Format
|
|
148
|
+
|
|
149
|
+
The library supports converting HTML to [Djot](https://djot.net/), a lightweight markup language similar to Markdown but with a different syntax for some elements. Set `output_format` to `"djot"` to use this format.
|
|
150
|
+
|
|
151
|
+
### Syntax Differences
|
|
152
|
+
|
|
153
|
+
| Element | Markdown | Djot |
|
|
154
|
+
| -------------- | ---------- | ---------- |
|
|
155
|
+
| Strong | `**text**` | `*text*` |
|
|
156
|
+
| Emphasis | `*text*` | `_text_` |
|
|
157
|
+
| Strikethrough | `~~text~~` | `{-text-}` |
|
|
158
|
+
| Inserted/Added | N/A | `{+text+}` |
|
|
159
|
+
| Highlighted | N/A | `{=text=}` |
|
|
160
|
+
| Subscript | N/A | `~text~` |
|
|
161
|
+
| Superscript | N/A | `^text^` |
|
|
162
|
+
|
|
163
|
+
### Example Usage
|
|
164
|
+
|
|
165
|
+
Djot's extended syntax allows you to express more semantic meaning in lightweight text, making it useful for documents that require strikethrough, insertion tracking, or mathematical notation.
|
|
166
|
+
|
|
167
|
+
## Plain Text Output
|
|
168
|
+
|
|
169
|
+
Set `output_format` to `"plain"` to strip all markup and return only visible text. This bypasses the Markdown conversion pipeline entirely for maximum speed.
|
|
170
|
+
|
|
171
|
+
Plain text mode is useful for search indexing, text extraction, and feeding content to LLMs.
|
|
172
|
+
|
|
173
|
+
## Metadata Extraction
|
|
174
|
+
|
|
175
|
+
The metadata extraction feature enables comprehensive document analysis during conversion. Extract document properties, headers, links, images, and structured data in a single pass — all via the standard `convert()` function.
|
|
176
|
+
|
|
177
|
+
**Use Cases:**
|
|
178
|
+
|
|
179
|
+
- **SEO analysis** – Extract title, description, Open Graph tags, Twitter cards
|
|
180
|
+
- **Table of contents generation** – Build structured outlines from heading hierarchy
|
|
181
|
+
- **Content migration** – Document all external links and resources
|
|
182
|
+
- **Accessibility audits** – Check for images without alt text, empty links, invalid heading hierarchy
|
|
183
|
+
- **Link validation** – Classify and validate anchor, internal, external, email, and phone links
|
|
184
|
+
|
|
185
|
+
**Zero Overhead When Disabled:** Metadata extraction adds negligible overhead and happens during the HTML parsing pass. Pass `extract_metadata: true` in `ConversionOptions` to enable it; the result is available at `result.metadata`.
|
|
186
|
+
|
|
187
|
+
### Example: Quick Start
|
|
188
|
+
|
|
189
|
+
## Examples
|
|
190
|
+
|
|
191
|
+
## Links
|
|
192
|
+
|
|
193
|
+
- **GitHub:** [github.com/kreuzberg-dev/html-to-markdown](https://github.com/kreuzberg-dev/html-to-markdown)
|
|
194
|
+
- **Discord:** [discord.gg/xt9WY3GnKR](https://discord.gg/xt9WY3GnKR)
|
|
195
|
+
|
|
196
|
+
## Part of Kreuzberg.dev
|
|
197
|
+
|
|
198
|
+
- [Kreuzberg](https://github.com/kreuzberg-dev/kreuzberg) — document intelligence: text, tables, metadata from 90+ formats with optional OCR.
|
|
199
|
+
- [Kreuzberg Cloud](https://github.com/kreuzberg-dev/kreuzberg-cloud) — managed extraction API with SDKs, dashboards, and observability.
|
|
200
|
+
- [kreuzcrawl](https://github.com/kreuzberg-dev/kreuzcrawl) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
|
|
201
|
+
- [liter-llm](https://github.com/kreuzberg-dev/liter-llm) — universal LLM API client with native bindings for 14 languages and 143 providers.
|
|
202
|
+
- [tree-sitter-language-pack](https://github.com/kreuzberg-dev/tree-sitter-language-pack) — tree-sitter grammars and code-intelligence primitives.
|
|
203
|
+
- [alef](https://github.com/kreuzberg-dev/alef) — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.
|
|
204
|
+
- [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
|
|
205
|
+
|
|
206
|
+
## Contributing
|
|
207
|
+
|
|
208
|
+
We welcome contributions! Please see our [Contributing Guide](https://github.com/kreuzberg-dev/html-to-markdown/blob/main/CONTRIBUTING.md) for details on:
|
|
209
|
+
|
|
210
|
+
- Setting up the development environment
|
|
211
|
+
- Running tests locally
|
|
212
|
+
- Submitting pull requests
|
|
213
|
+
- Reporting issues
|
|
214
|
+
|
|
215
|
+
All contributions must follow our code quality standards (enforced via pre-commit hooks):
|
|
216
|
+
|
|
217
|
+
- Proper test coverage (Rust 95%+, language bindings 80%+)
|
|
218
|
+
- Formatting and linting checks
|
|
219
|
+
- Documentation for public APIs
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MIT License – see [LICENSE](https://github.com/kreuzberg-dev/html-to-markdown/blob/main/LICENSE). Copyright © Kreuzberg, Inc.
|
|
224
|
+
|
|
225
|
+
## Support
|
|
226
|
+
|
|
227
|
+
If you find this library useful, consider [sponsoring the project](https://github.com/sponsors/kreuzberg-dev).
|
|
228
|
+
|
|
229
|
+
Have questions or run into issues? We're here to help:
|
|
230
|
+
|
|
231
|
+
- **GitHub Issues:** [github.com/kreuzberg-dev/html-to-markdown/issues](https://github.com/kreuzberg-dev/html-to-markdown/issues)
|
|
232
|
+
- **Issues:** [github.com/kreuzberg-dev/html-to-markdown/issues](https://github.com/kreuzberg-dev/html-to-markdown/issues)
|
|
233
|
+
- **Discord Community:** [discord.gg/xt9WY3GnKR](https://discord.gg/xt9WY3GnKR)
|