docxodus 3.1.3 → 3.1.4

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 CHANGED
@@ -109,14 +109,53 @@ Initialize the WASM runtime. Must be called before using any other functions.
109
109
  Convert a DOCX document to HTML.
110
110
 
111
111
  ```typescript
112
+ import { CommentRenderMode } from 'docxodus';
113
+
112
114
  interface ConversionOptions {
113
- pageTitle?: string; // HTML document title
114
- cssPrefix?: string; // CSS class prefix (default: "docx-")
115
- fabricateClasses?: boolean; // Generate CSS classes (default: true)
116
- additionalCss?: string; // Extra CSS to include
115
+ pageTitle?: string; // HTML document title
116
+ cssPrefix?: string; // CSS class prefix (default: "docx-")
117
+ fabricateClasses?: boolean; // Generate CSS classes (default: true)
118
+ additionalCss?: string; // Extra CSS to include
119
+ commentRenderMode?: CommentRenderMode; // How to render comments (default: Disabled)
120
+ commentCssClassPrefix?: string; // CSS prefix for comments (default: "comment-")
117
121
  }
118
122
  ```
119
123
 
124
+ ##### Comment Render Modes
125
+
126
+ Control how Word document comments are rendered in HTML output:
127
+
128
+ ```typescript
129
+ import { convertDocxToHtml, CommentRenderMode } from 'docxodus';
130
+
131
+ // Don't render comments (default)
132
+ const html = await convertDocxToHtml(docxFile, {
133
+ commentRenderMode: CommentRenderMode.Disabled
134
+ });
135
+
136
+ // Render as footnotes with bidirectional links
137
+ const htmlEndnote = await convertDocxToHtml(docxFile, {
138
+ commentRenderMode: CommentRenderMode.EndnoteStyle
139
+ });
140
+
141
+ // Render as inline tooltips (title attribute + data attributes)
142
+ const htmlInline = await convertDocxToHtml(docxFile, {
143
+ commentRenderMode: CommentRenderMode.Inline
144
+ });
145
+
146
+ // Render in a side margin column (CSS flexbox layout)
147
+ const htmlMargin = await convertDocxToHtml(docxFile, {
148
+ commentRenderMode: CommentRenderMode.Margin
149
+ });
150
+ ```
151
+
152
+ | Mode | Value | Description |
153
+ |------|-------|-------------|
154
+ | `Disabled` | -1 | Don't render comments (default) |
155
+ | `EndnoteStyle` | 0 | Comments at document end with `[1]` style links |
156
+ | `Inline` | 1 | Tooltips via `title` and `data-comment` attributes |
157
+ | `Margin` | 2 | Side column using CSS flexbox |
158
+
120
159
  #### `compareDocuments(original, modified, options?): Promise<Uint8Array>`
121
160
  Compare two DOCX documents and return a redlined DOCX with tracked changes.
122
161
 
Binary file
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mainAssemblyName": "DocxodusWasm.dll",
3
3
  "resources": {
4
- "hash": "sha256-slt/QAfPJMion2mDKV+ttPyFixcu+rD3WbFwQgAfGx8=",
4
+ "hash": "sha256-6n8P857iwGG+4JeTER3Zh1HQmC8y9qy8JGIjReXiBL0=",
5
5
  "jsModuleNative": {
6
6
  "dotnet.native.js": "sha256-YLwjs9CPwrZG7YKULjmqr5bYsmhxwcWJOhQNM4bG6Gc="
7
7
  },
@@ -17,8 +17,8 @@
17
17
  "assembly": {
18
18
  "DocumentFormat.OpenXml.wasm": "sha256-edAN2rIA7QQ8K5qp1o5QXplt8M80fEiVmuMgT/MBmLM=",
19
19
  "DocumentFormat.OpenXml.Framework.wasm": "sha256-CFdrD1dSpnkcOk0gxZcKb2T5p+q2ck9ivs+TOML6Jmw=",
20
- "Docxodus.wasm": "sha256-OfgeocLmfMl0RZ7DqZqVj5v9r6zOWvzYkwU8jFWgybg=",
21
- "DocxodusWasm.wasm": "sha256-XoBCAzSgzJ1nTl5Tv243gGnG5iVXlaD4OmMYE6JO/yg=",
20
+ "Docxodus.wasm": "sha256-y9b+WtsOMwVR2vRAWWmqBMaw7AdCgZ4a+yY8uB2J4sk=",
21
+ "DocxodusWasm.wasm": "sha256-XZgTaD8yAf7mT+EKYwhqtQExCENJTvuG7SB8K8Q90M8=",
22
22
  "SkiaSharp.wasm": "sha256-U6RbqUVBn8Vx8qpghJC5+r/DC1NSBY+EIRDxP8o6dsk=",
23
23
  "System.Collections.Concurrent.wasm": "sha256-xXJbJWNeQ2DSYvAGUoUHjF9y4Iajv2ed0eACOxWD19U=",
24
24
  "System.Collections.wasm": "sha256-J1FML3h2WBTlmekS0TVLGCvZGbIRG+AZnGmlZn3Y5+Q=",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docxodus",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "description": "DOCX document comparison and HTML conversion in the browser using WebAssembly",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",