@quillmark/wasm 0.37.1 → 0.39.0
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 +8 -7
- package/bundler/wasm.d.ts +65 -65
- package/bundler/wasm_bg.js +105 -105
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +14 -14
- package/node-esm/wasm.d.ts +65 -65
- package/node-esm/wasm_bg.js +105 -105
- package/node-esm/wasm_bg.wasm +0 -0
- package/node-esm/wasm_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,7 +107,6 @@ The main workflow for rendering documents:
|
|
|
107
107
|
|
|
108
108
|
- `static parseMarkdown(markdown)` - Parse markdown into a ParsedDocument (Step 1)
|
|
109
109
|
- `registerQuill(quillJson)` - Register a Quill template bundle from JSON (Step 2)
|
|
110
|
-
- `getQuillInfo(name)` - Get shallow Quill metadata and configuration options (Step 3)
|
|
111
110
|
- `render(parsedDoc, options)` - Render a ParsedDocument to final artifacts. Note that the quill reference in `options` is optional to specify and can be inferred from the markdown content's frontmatter (Step 4)
|
|
112
111
|
|
|
113
112
|
### Utility Methods
|
|
@@ -115,17 +114,19 @@ The main workflow for rendering documents:
|
|
|
115
114
|
Additional methods for managing the engine and debugging:
|
|
116
115
|
|
|
117
116
|
- `new Quillmark()` - Create a new engine instance
|
|
118
|
-
- `
|
|
117
|
+
- `renderQuill(RenderOptions, markdown)` - Load markdown and map it onto an internally fetched Quill, resolving to `RenderResult` including output format, the artifact byte slice buffer, and time to render
|
|
118
|
+
- `processPlate(quillRef, markdown)` - Debug helper that processes markdown through the template engine and returns the intermediate template source code (e.g., Typst, LaTeX) without compiling to final artifacts. Useful for inspecting template output during development.
|
|
119
|
+
- `fetchQuillInfo(quillRef)` - Fetches metadata and schema about an available Quill from the configured registry without loading the full filesystem or rendering context.
|
|
119
120
|
- `listQuills()` - List all registered Quill names
|
|
120
121
|
- `unregisterQuill(name)` - Unregister a Quill to free memory
|
|
121
122
|
|
|
122
123
|
### Render Options
|
|
123
124
|
|
|
124
125
|
```typescript
|
|
125
|
-
{
|
|
126
|
-
format?: 'pdf' | 'svg' | 'txt'
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
type RenderOptions = {
|
|
127
|
+
format?: 'pdf' | 'svg' | 'txt'
|
|
128
|
+
quillRef?: string // Override quillRef from ParsedDocument
|
|
129
|
+
assets?: Record<string, Uint8Array | number[]>
|
|
129
130
|
}
|
|
130
131
|
```
|
|
131
132
|
|
|
@@ -136,7 +137,7 @@ Returned by `parseMarkdown()`:
|
|
|
136
137
|
```typescript
|
|
137
138
|
{
|
|
138
139
|
fields: object, // YAML frontmatter fields
|
|
139
|
-
|
|
140
|
+
quillRef: string // Quill reference from QUILL field (or "__default__")
|
|
140
141
|
}
|
|
141
142
|
```
|
|
142
143
|
|
package/bundler/wasm.d.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
format?: OutputFormat;
|
|
9
|
-
assets?: Record<string, Uint8Array | number[]>;
|
|
10
|
-
quillName?: string;
|
|
11
|
-
}
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
12
8
|
|
|
13
9
|
export type Severity = "error" | "warning" | "note";
|
|
14
10
|
|
|
15
|
-
export
|
|
11
|
+
export interface Location {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
export interface Diagnostic {
|
|
18
18
|
severity: Severity;
|
|
@@ -23,15 +23,17 @@ export interface Diagnostic {
|
|
|
23
23
|
sourceChain: string[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export interface
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
export interface Artifact {
|
|
27
|
+
format: OutputFormat;
|
|
28
|
+
bytes: Uint8Array;
|
|
29
|
+
mimeType: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export interface
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
export interface RenderResult {
|
|
33
|
+
artifacts: Artifact[];
|
|
34
|
+
warnings: Diagnostic[];
|
|
35
|
+
outputFormat: OutputFormat;
|
|
36
|
+
renderTimeMs: number;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface QuillInfo {
|
|
@@ -45,17 +47,15 @@ export interface QuillInfo {
|
|
|
45
47
|
supportedFormats: OutputFormat[];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
export interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
mimeType: string;
|
|
50
|
+
export interface ParsedDocument {
|
|
51
|
+
fields: Record<string, any>;
|
|
52
|
+
quillRef: string;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
export interface
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
renderTimeMs: number;
|
|
55
|
+
export interface RenderOptions {
|
|
56
|
+
format?: OutputFormat;
|
|
57
|
+
assets?: Record<string, Uint8Array | number[]>;
|
|
58
|
+
quillRef?: string;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -67,38 +67,14 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
73
|
-
*/
|
|
74
|
-
listQuills(): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Compile markdown to JSON data without rendering artifacts.
|
|
77
|
-
*
|
|
78
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
79
|
-
* Useful for debugging and validation.
|
|
80
|
-
*/
|
|
81
|
-
compileData(markdown: string): any;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
84
|
-
*
|
|
85
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
86
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
87
|
-
* locally, or null if an external fetch is needed.
|
|
88
|
-
*/
|
|
89
|
-
resolveQuill(quill_ref: string): any;
|
|
90
|
-
/**
|
|
91
|
-
* Get shallow information about a registered Quill
|
|
92
|
-
*
|
|
93
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
94
|
-
* that consumers need to configure render options for the next step.
|
|
70
|
+
* JavaScript constructor: `new Quillmark()`
|
|
95
71
|
*/
|
|
96
|
-
|
|
72
|
+
constructor();
|
|
97
73
|
/**
|
|
98
74
|
* Parse markdown into a ParsedDocument
|
|
99
75
|
*
|
|
100
76
|
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
101
|
-
* the parsed YAML frontmatter fields and the
|
|
77
|
+
* the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
|
|
102
78
|
*/
|
|
103
79
|
static parseMarkdown(markdown: string): ParsedDocument;
|
|
104
80
|
/**
|
|
@@ -109,13 +85,12 @@ export class Quillmark {
|
|
|
109
85
|
*/
|
|
110
86
|
registerQuill(quill_json: any): QuillInfo;
|
|
111
87
|
/**
|
|
112
|
-
*
|
|
88
|
+
* Get shallow information about a registered Quill
|
|
113
89
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Returns true if something was unregistered, false if not found.
|
|
90
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
+
* that consumers need to configure render options for the next step.
|
|
117
92
|
*/
|
|
118
|
-
|
|
93
|
+
getQuillInfo(name: string): QuillInfo;
|
|
119
94
|
/**
|
|
120
95
|
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
121
96
|
*
|
|
@@ -124,27 +99,52 @@ export class Quillmark {
|
|
|
124
99
|
*/
|
|
125
100
|
getStrippedSchema(name: string): any;
|
|
126
101
|
/**
|
|
127
|
-
*
|
|
102
|
+
* Perform a dry run validation without backend compilation.
|
|
103
|
+
*
|
|
104
|
+
* Executes parsing, schema validation, and template composition to
|
|
105
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
106
|
+
* or throws an error with diagnostic payload on failure.
|
|
107
|
+
*
|
|
108
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
109
|
+
*
|
|
110
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
128
111
|
*/
|
|
129
|
-
|
|
112
|
+
dryRun(markdown: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
115
|
+
*
|
|
116
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
117
|
+
* Useful for debugging and validation.
|
|
118
|
+
*/
|
|
119
|
+
compileData(markdown: string): any;
|
|
130
120
|
/**
|
|
131
121
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
132
122
|
*
|
|
133
123
|
* Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
|
|
134
|
-
* Uses the Quill specified in options.
|
|
135
|
-
* otherwise infers it from the ParsedDocument's
|
|
124
|
+
* Uses the Quill specified in options.quill_ref if provided,
|
|
125
|
+
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
136
126
|
*/
|
|
137
127
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
138
128
|
/**
|
|
139
|
-
*
|
|
129
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
140
130
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* or
|
|
131
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
132
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
133
|
+
* locally, or null if an external fetch is needed.
|
|
134
|
+
*/
|
|
135
|
+
resolveQuill(quill_ref: string): any;
|
|
136
|
+
/**
|
|
137
|
+
* List registered Quills with their exact versions
|
|
144
138
|
*
|
|
145
|
-
*
|
|
139
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
140
|
+
*/
|
|
141
|
+
listQuills(): string[];
|
|
142
|
+
/**
|
|
143
|
+
* Unregister a Quill by name or specific version
|
|
146
144
|
*
|
|
147
|
-
*
|
|
145
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
146
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
147
|
+
* Returns true if something was unregistered, false if not found.
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
unregisterQuill(name_or_ref: string): boolean;
|
|
150
150
|
}
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -207,12 +207,6 @@ function debugString(val) {
|
|
|
207
207
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
208
208
|
return className;
|
|
209
209
|
}
|
|
210
|
-
/**
|
|
211
|
-
* Initialize the WASM module with panic hooks for better error messages
|
|
212
|
-
*/
|
|
213
|
-
export function init() {
|
|
214
|
-
wasm.init();
|
|
215
|
-
}
|
|
216
210
|
|
|
217
211
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
218
212
|
ptr = ptr >>> 0;
|
|
@@ -223,6 +217,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
223
217
|
}
|
|
224
218
|
return result;
|
|
225
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Initialize the WASM module with panic hooks for better error messages
|
|
222
|
+
*/
|
|
223
|
+
export function init() {
|
|
224
|
+
wasm.init();
|
|
225
|
+
}
|
|
226
226
|
|
|
227
227
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
228
228
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -246,38 +246,51 @@ export class Quillmark {
|
|
|
246
246
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* JavaScript constructor: `new Quillmark()`
|
|
250
|
+
*/
|
|
251
|
+
constructor() {
|
|
252
|
+
const ret = wasm.quillmark_new();
|
|
253
|
+
this.__wbg_ptr = ret >>> 0;
|
|
254
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
255
|
+
return this;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parse markdown into a ParsedDocument
|
|
250
259
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
260
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
261
|
+
* the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
|
|
262
|
+
* @param {string} markdown
|
|
263
|
+
* @returns {ParsedDocument}
|
|
253
264
|
*/
|
|
254
|
-
|
|
265
|
+
static parseMarkdown(markdown) {
|
|
255
266
|
try {
|
|
256
267
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
257
|
-
wasm.
|
|
268
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
270
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
258
271
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
259
272
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
273
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
274
|
+
if (r2) {
|
|
275
|
+
throw takeObject(r1);
|
|
276
|
+
}
|
|
277
|
+
return takeObject(r0);
|
|
263
278
|
} finally {
|
|
264
279
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
265
280
|
}
|
|
266
281
|
}
|
|
267
282
|
/**
|
|
268
|
-
*
|
|
283
|
+
* Register a Quill template bundle
|
|
269
284
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* @param {
|
|
273
|
-
* @returns {
|
|
285
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
286
|
+
* Validation happens automatically on registration.
|
|
287
|
+
* @param {any} quill_json
|
|
288
|
+
* @returns {QuillInfo}
|
|
274
289
|
*/
|
|
275
|
-
|
|
290
|
+
registerQuill(quill_json) {
|
|
276
291
|
try {
|
|
277
292
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
278
|
-
|
|
279
|
-
const len0 = WASM_VECTOR_LEN;
|
|
280
|
-
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
293
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
281
294
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
282
295
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
283
296
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -289,21 +302,6 @@ export class Quillmark {
|
|
|
289
302
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
|
-
/**
|
|
293
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
294
|
-
*
|
|
295
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
296
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
297
|
-
* locally, or null if an external fetch is needed.
|
|
298
|
-
* @param {string} quill_ref
|
|
299
|
-
* @returns {any}
|
|
300
|
-
*/
|
|
301
|
-
resolveQuill(quill_ref) {
|
|
302
|
-
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
303
|
-
const len0 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
305
|
-
return takeObject(ret);
|
|
306
|
-
}
|
|
307
305
|
/**
|
|
308
306
|
* Get shallow information about a registered Quill
|
|
309
307
|
*
|
|
@@ -330,19 +328,19 @@ export class Quillmark {
|
|
|
330
328
|
}
|
|
331
329
|
}
|
|
332
330
|
/**
|
|
333
|
-
*
|
|
331
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
334
332
|
*
|
|
335
|
-
* This
|
|
336
|
-
*
|
|
337
|
-
* @param {string}
|
|
338
|
-
* @returns {
|
|
333
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
334
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
335
|
+
* @param {string} name
|
|
336
|
+
* @returns {any}
|
|
339
337
|
*/
|
|
340
|
-
|
|
338
|
+
getStrippedSchema(name) {
|
|
341
339
|
try {
|
|
342
340
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
343
|
-
const ptr0 = passStringToWasm0(
|
|
341
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
344
342
|
const len0 = WASM_VECTOR_LEN;
|
|
345
|
-
wasm.
|
|
343
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
346
344
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
347
345
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
348
346
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -355,57 +353,46 @@ export class Quillmark {
|
|
|
355
353
|
}
|
|
356
354
|
}
|
|
357
355
|
/**
|
|
358
|
-
*
|
|
356
|
+
* Perform a dry run validation without backend compilation.
|
|
359
357
|
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
358
|
+
* Executes parsing, schema validation, and template composition to
|
|
359
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
360
|
+
* or throws an error with diagnostic payload on failure.
|
|
361
|
+
*
|
|
362
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
363
|
+
*
|
|
364
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
365
|
+
* @param {string} markdown
|
|
364
366
|
*/
|
|
365
|
-
|
|
367
|
+
dryRun(markdown) {
|
|
366
368
|
try {
|
|
367
369
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
368
|
-
|
|
370
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
372
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
369
373
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
370
374
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
throw takeObject(r1);
|
|
375
|
+
if (r1) {
|
|
376
|
+
throw takeObject(r0);
|
|
374
377
|
}
|
|
375
|
-
return takeObject(r0);
|
|
376
378
|
} finally {
|
|
377
379
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
378
380
|
}
|
|
379
381
|
}
|
|
380
382
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
384
|
-
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
385
|
-
* Returns true if something was unregistered, false if not found.
|
|
386
|
-
* @param {string} name_or_ref
|
|
387
|
-
* @returns {boolean}
|
|
388
|
-
*/
|
|
389
|
-
unregisterQuill(name_or_ref) {
|
|
390
|
-
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
391
|
-
const len0 = WASM_VECTOR_LEN;
|
|
392
|
-
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
393
|
-
return ret !== 0;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
383
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
397
384
|
*
|
|
398
|
-
* This
|
|
399
|
-
*
|
|
400
|
-
* @param {string}
|
|
385
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
386
|
+
* Useful for debugging and validation.
|
|
387
|
+
* @param {string} markdown
|
|
401
388
|
* @returns {any}
|
|
402
389
|
*/
|
|
403
|
-
|
|
390
|
+
compileData(markdown) {
|
|
404
391
|
try {
|
|
405
392
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
406
|
-
const ptr0 = passStringToWasm0(
|
|
393
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
407
394
|
const len0 = WASM_VECTOR_LEN;
|
|
408
|
-
wasm.
|
|
395
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
409
396
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
410
397
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
411
398
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -417,21 +404,12 @@ export class Quillmark {
|
|
|
417
404
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
418
405
|
}
|
|
419
406
|
}
|
|
420
|
-
/**
|
|
421
|
-
* JavaScript constructor: `new Quillmark()`
|
|
422
|
-
*/
|
|
423
|
-
constructor() {
|
|
424
|
-
const ret = wasm.quillmark_new();
|
|
425
|
-
this.__wbg_ptr = ret >>> 0;
|
|
426
|
-
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
427
|
-
return this;
|
|
428
|
-
}
|
|
429
407
|
/**
|
|
430
408
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
431
409
|
*
|
|
432
410
|
* Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
|
|
433
|
-
* Uses the Quill specified in options.
|
|
434
|
-
* otherwise infers it from the ParsedDocument's
|
|
411
|
+
* Uses the Quill specified in options.quill_ref if provided,
|
|
412
|
+
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
435
413
|
* @param {ParsedDocument} parsed
|
|
436
414
|
* @param {RenderOptions} opts
|
|
437
415
|
* @returns {RenderResult}
|
|
@@ -452,32 +430,54 @@ export class Quillmark {
|
|
|
452
430
|
}
|
|
453
431
|
}
|
|
454
432
|
/**
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
* Executes parsing, schema validation, and template composition to
|
|
458
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
459
|
-
* or throws an error with diagnostic payload on failure.
|
|
433
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
460
434
|
*
|
|
461
|
-
*
|
|
435
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
436
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
437
|
+
* locally, or null if an external fetch is needed.
|
|
438
|
+
* @param {string} quill_ref
|
|
439
|
+
* @returns {any}
|
|
440
|
+
*/
|
|
441
|
+
resolveQuill(quill_ref) {
|
|
442
|
+
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
443
|
+
const len0 = WASM_VECTOR_LEN;
|
|
444
|
+
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
445
|
+
return takeObject(ret);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* List registered Quills with their exact versions
|
|
462
449
|
*
|
|
463
|
-
*
|
|
464
|
-
* @
|
|
450
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
451
|
+
* @returns {string[]}
|
|
465
452
|
*/
|
|
466
|
-
|
|
453
|
+
listQuills() {
|
|
467
454
|
try {
|
|
468
455
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
469
|
-
|
|
470
|
-
const len0 = WASM_VECTOR_LEN;
|
|
471
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
456
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
472
457
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
473
458
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
459
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
460
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
461
|
+
return v1;
|
|
477
462
|
} finally {
|
|
478
463
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
479
464
|
}
|
|
480
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Unregister a Quill by name or specific version
|
|
468
|
+
*
|
|
469
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
470
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
471
|
+
* Returns true if something was unregistered, false if not found.
|
|
472
|
+
* @param {string} name_or_ref
|
|
473
|
+
* @returns {boolean}
|
|
474
|
+
*/
|
|
475
|
+
unregisterQuill(name_or_ref) {
|
|
476
|
+
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
477
|
+
const len0 = WASM_VECTOR_LEN;
|
|
478
|
+
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
479
|
+
return ret !== 0;
|
|
480
|
+
}
|
|
481
481
|
}
|
|
482
482
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
483
483
|
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
5
|
-
export const init: () => void;
|
|
6
|
-
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
|
-
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
|
-
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
-
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
11
5
|
export const quillmark_new: () => number;
|
|
12
6
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
13
7
|
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
8
|
+
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
14
12
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
15
13
|
export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
|
|
14
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
16
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const init: () => void;
|
|
17
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
19
18
|
export const qcms_white_point_sRGB: (a: number) => void;
|
|
20
|
-
export const
|
|
21
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
19
|
+
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
25
22
|
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
23
|
+
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
29
26
|
export const qcms_transform_release: (a: number) => void;
|
|
27
|
+
export const qcms_enable_iccv4: () => void;
|
|
28
|
+
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
29
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
30
30
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
31
31
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
32
32
|
export const __wbindgen_export_2: (a: number) => void;
|
package/node-esm/wasm.d.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
format?: OutputFormat;
|
|
9
|
-
assets?: Record<string, Uint8Array | number[]>;
|
|
10
|
-
quillName?: string;
|
|
11
|
-
}
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
12
8
|
|
|
13
9
|
export type Severity = "error" | "warning" | "note";
|
|
14
10
|
|
|
15
|
-
export
|
|
11
|
+
export interface Location {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
export interface Diagnostic {
|
|
18
18
|
severity: Severity;
|
|
@@ -23,15 +23,17 @@ export interface Diagnostic {
|
|
|
23
23
|
sourceChain: string[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export interface
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
export interface Artifact {
|
|
27
|
+
format: OutputFormat;
|
|
28
|
+
bytes: Uint8Array;
|
|
29
|
+
mimeType: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export interface
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
export interface RenderResult {
|
|
33
|
+
artifacts: Artifact[];
|
|
34
|
+
warnings: Diagnostic[];
|
|
35
|
+
outputFormat: OutputFormat;
|
|
36
|
+
renderTimeMs: number;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface QuillInfo {
|
|
@@ -45,17 +47,15 @@ export interface QuillInfo {
|
|
|
45
47
|
supportedFormats: OutputFormat[];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
export interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
mimeType: string;
|
|
50
|
+
export interface ParsedDocument {
|
|
51
|
+
fields: Record<string, any>;
|
|
52
|
+
quillRef: string;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
export interface
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
renderTimeMs: number;
|
|
55
|
+
export interface RenderOptions {
|
|
56
|
+
format?: OutputFormat;
|
|
57
|
+
assets?: Record<string, Uint8Array | number[]>;
|
|
58
|
+
quillRef?: string;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -67,38 +67,14 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
73
|
-
*/
|
|
74
|
-
listQuills(): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Compile markdown to JSON data without rendering artifacts.
|
|
77
|
-
*
|
|
78
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
79
|
-
* Useful for debugging and validation.
|
|
80
|
-
*/
|
|
81
|
-
compileData(markdown: string): any;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
84
|
-
*
|
|
85
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
86
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
87
|
-
* locally, or null if an external fetch is needed.
|
|
88
|
-
*/
|
|
89
|
-
resolveQuill(quill_ref: string): any;
|
|
90
|
-
/**
|
|
91
|
-
* Get shallow information about a registered Quill
|
|
92
|
-
*
|
|
93
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
94
|
-
* that consumers need to configure render options for the next step.
|
|
70
|
+
* JavaScript constructor: `new Quillmark()`
|
|
95
71
|
*/
|
|
96
|
-
|
|
72
|
+
constructor();
|
|
97
73
|
/**
|
|
98
74
|
* Parse markdown into a ParsedDocument
|
|
99
75
|
*
|
|
100
76
|
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
101
|
-
* the parsed YAML frontmatter fields and the
|
|
77
|
+
* the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
|
|
102
78
|
*/
|
|
103
79
|
static parseMarkdown(markdown: string): ParsedDocument;
|
|
104
80
|
/**
|
|
@@ -109,13 +85,12 @@ export class Quillmark {
|
|
|
109
85
|
*/
|
|
110
86
|
registerQuill(quill_json: any): QuillInfo;
|
|
111
87
|
/**
|
|
112
|
-
*
|
|
88
|
+
* Get shallow information about a registered Quill
|
|
113
89
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Returns true if something was unregistered, false if not found.
|
|
90
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
+
* that consumers need to configure render options for the next step.
|
|
117
92
|
*/
|
|
118
|
-
|
|
93
|
+
getQuillInfo(name: string): QuillInfo;
|
|
119
94
|
/**
|
|
120
95
|
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
121
96
|
*
|
|
@@ -124,27 +99,52 @@ export class Quillmark {
|
|
|
124
99
|
*/
|
|
125
100
|
getStrippedSchema(name: string): any;
|
|
126
101
|
/**
|
|
127
|
-
*
|
|
102
|
+
* Perform a dry run validation without backend compilation.
|
|
103
|
+
*
|
|
104
|
+
* Executes parsing, schema validation, and template composition to
|
|
105
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
106
|
+
* or throws an error with diagnostic payload on failure.
|
|
107
|
+
*
|
|
108
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
109
|
+
*
|
|
110
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
128
111
|
*/
|
|
129
|
-
|
|
112
|
+
dryRun(markdown: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
115
|
+
*
|
|
116
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
117
|
+
* Useful for debugging and validation.
|
|
118
|
+
*/
|
|
119
|
+
compileData(markdown: string): any;
|
|
130
120
|
/**
|
|
131
121
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
132
122
|
*
|
|
133
123
|
* Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
|
|
134
|
-
* Uses the Quill specified in options.
|
|
135
|
-
* otherwise infers it from the ParsedDocument's
|
|
124
|
+
* Uses the Quill specified in options.quill_ref if provided,
|
|
125
|
+
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
136
126
|
*/
|
|
137
127
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
138
128
|
/**
|
|
139
|
-
*
|
|
129
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
140
130
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* or
|
|
131
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
132
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
133
|
+
* locally, or null if an external fetch is needed.
|
|
134
|
+
*/
|
|
135
|
+
resolveQuill(quill_ref: string): any;
|
|
136
|
+
/**
|
|
137
|
+
* List registered Quills with their exact versions
|
|
144
138
|
*
|
|
145
|
-
*
|
|
139
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
140
|
+
*/
|
|
141
|
+
listQuills(): string[];
|
|
142
|
+
/**
|
|
143
|
+
* Unregister a Quill by name or specific version
|
|
146
144
|
*
|
|
147
|
-
*
|
|
145
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
146
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
147
|
+
* Returns true if something was unregistered, false if not found.
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
unregisterQuill(name_or_ref: string): boolean;
|
|
150
150
|
}
|
package/node-esm/wasm_bg.js
CHANGED
|
@@ -201,12 +201,6 @@ function debugString(val) {
|
|
|
201
201
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Initialize the WASM module with panic hooks for better error messages
|
|
206
|
-
*/
|
|
207
|
-
export function init() {
|
|
208
|
-
wasm.init();
|
|
209
|
-
}
|
|
210
204
|
|
|
211
205
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
212
206
|
ptr = ptr >>> 0;
|
|
@@ -217,6 +211,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
217
211
|
}
|
|
218
212
|
return result;
|
|
219
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Initialize the WASM module with panic hooks for better error messages
|
|
216
|
+
*/
|
|
217
|
+
export function init() {
|
|
218
|
+
wasm.init();
|
|
219
|
+
}
|
|
220
220
|
|
|
221
221
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
222
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -240,38 +240,51 @@ export class Quillmark {
|
|
|
240
240
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* JavaScript constructor: `new Quillmark()`
|
|
244
|
+
*/
|
|
245
|
+
constructor() {
|
|
246
|
+
const ret = wasm.quillmark_new();
|
|
247
|
+
this.__wbg_ptr = ret >>> 0;
|
|
248
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Parse markdown into a ParsedDocument
|
|
244
253
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
254
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
255
|
+
* the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
|
|
256
|
+
* @param {string} markdown
|
|
257
|
+
* @returns {ParsedDocument}
|
|
247
258
|
*/
|
|
248
|
-
|
|
259
|
+
static parseMarkdown(markdown) {
|
|
249
260
|
try {
|
|
250
261
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
251
|
-
wasm.
|
|
262
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
263
|
+
const len0 = WASM_VECTOR_LEN;
|
|
264
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
252
265
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
253
266
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
|
|
267
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
268
|
+
if (r2) {
|
|
269
|
+
throw takeObject(r1);
|
|
270
|
+
}
|
|
271
|
+
return takeObject(r0);
|
|
257
272
|
} finally {
|
|
258
273
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
259
274
|
}
|
|
260
275
|
}
|
|
261
276
|
/**
|
|
262
|
-
*
|
|
277
|
+
* Register a Quill template bundle
|
|
263
278
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @param {
|
|
267
|
-
* @returns {
|
|
279
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
280
|
+
* Validation happens automatically on registration.
|
|
281
|
+
* @param {any} quill_json
|
|
282
|
+
* @returns {QuillInfo}
|
|
268
283
|
*/
|
|
269
|
-
|
|
284
|
+
registerQuill(quill_json) {
|
|
270
285
|
try {
|
|
271
286
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
-
|
|
273
|
-
const len0 = WASM_VECTOR_LEN;
|
|
274
|
-
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
287
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
275
288
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
276
289
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
277
290
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -283,21 +296,6 @@ export class Quillmark {
|
|
|
283
296
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
284
297
|
}
|
|
285
298
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
288
|
-
*
|
|
289
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
290
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
291
|
-
* locally, or null if an external fetch is needed.
|
|
292
|
-
* @param {string} quill_ref
|
|
293
|
-
* @returns {any}
|
|
294
|
-
*/
|
|
295
|
-
resolveQuill(quill_ref) {
|
|
296
|
-
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
297
|
-
const len0 = WASM_VECTOR_LEN;
|
|
298
|
-
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
299
|
-
return takeObject(ret);
|
|
300
|
-
}
|
|
301
299
|
/**
|
|
302
300
|
* Get shallow information about a registered Quill
|
|
303
301
|
*
|
|
@@ -324,19 +322,19 @@ export class Quillmark {
|
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
/**
|
|
327
|
-
*
|
|
325
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
328
326
|
*
|
|
329
|
-
* This
|
|
330
|
-
*
|
|
331
|
-
* @param {string}
|
|
332
|
-
* @returns {
|
|
327
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
328
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
329
|
+
* @param {string} name
|
|
330
|
+
* @returns {any}
|
|
333
331
|
*/
|
|
334
|
-
|
|
332
|
+
getStrippedSchema(name) {
|
|
335
333
|
try {
|
|
336
334
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
337
|
-
const ptr0 = passStringToWasm0(
|
|
335
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
338
336
|
const len0 = WASM_VECTOR_LEN;
|
|
339
|
-
wasm.
|
|
337
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
340
338
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
341
339
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
342
340
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -349,57 +347,46 @@ export class Quillmark {
|
|
|
349
347
|
}
|
|
350
348
|
}
|
|
351
349
|
/**
|
|
352
|
-
*
|
|
350
|
+
* Perform a dry run validation without backend compilation.
|
|
353
351
|
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
352
|
+
* Executes parsing, schema validation, and template composition to
|
|
353
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
354
|
+
* or throws an error with diagnostic payload on failure.
|
|
355
|
+
*
|
|
356
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
357
|
+
*
|
|
358
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
359
|
+
* @param {string} markdown
|
|
358
360
|
*/
|
|
359
|
-
|
|
361
|
+
dryRun(markdown) {
|
|
360
362
|
try {
|
|
361
363
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
|
|
364
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
365
|
+
const len0 = WASM_VECTOR_LEN;
|
|
366
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
363
367
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
364
368
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
throw takeObject(r1);
|
|
369
|
+
if (r1) {
|
|
370
|
+
throw takeObject(r0);
|
|
368
371
|
}
|
|
369
|
-
return takeObject(r0);
|
|
370
372
|
} finally {
|
|
371
373
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
372
374
|
}
|
|
373
375
|
}
|
|
374
376
|
/**
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
378
|
-
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
379
|
-
* Returns true if something was unregistered, false if not found.
|
|
380
|
-
* @param {string} name_or_ref
|
|
381
|
-
* @returns {boolean}
|
|
382
|
-
*/
|
|
383
|
-
unregisterQuill(name_or_ref) {
|
|
384
|
-
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
385
|
-
const len0 = WASM_VECTOR_LEN;
|
|
386
|
-
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
387
|
-
return ret !== 0;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
377
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
391
378
|
*
|
|
392
|
-
* This
|
|
393
|
-
*
|
|
394
|
-
* @param {string}
|
|
379
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
380
|
+
* Useful for debugging and validation.
|
|
381
|
+
* @param {string} markdown
|
|
395
382
|
* @returns {any}
|
|
396
383
|
*/
|
|
397
|
-
|
|
384
|
+
compileData(markdown) {
|
|
398
385
|
try {
|
|
399
386
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
400
|
-
const ptr0 = passStringToWasm0(
|
|
387
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
401
388
|
const len0 = WASM_VECTOR_LEN;
|
|
402
|
-
wasm.
|
|
389
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
403
390
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
404
391
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
405
392
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -411,21 +398,12 @@ export class Quillmark {
|
|
|
411
398
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
412
399
|
}
|
|
413
400
|
}
|
|
414
|
-
/**
|
|
415
|
-
* JavaScript constructor: `new Quillmark()`
|
|
416
|
-
*/
|
|
417
|
-
constructor() {
|
|
418
|
-
const ret = wasm.quillmark_new();
|
|
419
|
-
this.__wbg_ptr = ret >>> 0;
|
|
420
|
-
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
421
|
-
return this;
|
|
422
|
-
}
|
|
423
401
|
/**
|
|
424
402
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
425
403
|
*
|
|
426
404
|
* Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
|
|
427
|
-
* Uses the Quill specified in options.
|
|
428
|
-
* otherwise infers it from the ParsedDocument's
|
|
405
|
+
* Uses the Quill specified in options.quill_ref if provided,
|
|
406
|
+
* otherwise infers it from the ParsedDocument's quill_ref field.
|
|
429
407
|
* @param {ParsedDocument} parsed
|
|
430
408
|
* @param {RenderOptions} opts
|
|
431
409
|
* @returns {RenderResult}
|
|
@@ -446,32 +424,54 @@ export class Quillmark {
|
|
|
446
424
|
}
|
|
447
425
|
}
|
|
448
426
|
/**
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
* Executes parsing, schema validation, and template composition to
|
|
452
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
453
|
-
* or throws an error with diagnostic payload on failure.
|
|
427
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
454
428
|
*
|
|
455
|
-
*
|
|
429
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
430
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
431
|
+
* locally, or null if an external fetch is needed.
|
|
432
|
+
* @param {string} quill_ref
|
|
433
|
+
* @returns {any}
|
|
434
|
+
*/
|
|
435
|
+
resolveQuill(quill_ref) {
|
|
436
|
+
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
437
|
+
const len0 = WASM_VECTOR_LEN;
|
|
438
|
+
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
439
|
+
return takeObject(ret);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* List registered Quills with their exact versions
|
|
456
443
|
*
|
|
457
|
-
*
|
|
458
|
-
* @
|
|
444
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
445
|
+
* @returns {string[]}
|
|
459
446
|
*/
|
|
460
|
-
|
|
447
|
+
listQuills() {
|
|
461
448
|
try {
|
|
462
449
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
463
|
-
|
|
464
|
-
const len0 = WASM_VECTOR_LEN;
|
|
465
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
450
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
466
451
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
467
452
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
453
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
454
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
455
|
+
return v1;
|
|
471
456
|
} finally {
|
|
472
457
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
473
458
|
}
|
|
474
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* Unregister a Quill by name or specific version
|
|
462
|
+
*
|
|
463
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
464
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
465
|
+
* Returns true if something was unregistered, false if not found.
|
|
466
|
+
* @param {string} name_or_ref
|
|
467
|
+
* @returns {boolean}
|
|
468
|
+
*/
|
|
469
|
+
unregisterQuill(name_or_ref) {
|
|
470
|
+
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
471
|
+
const len0 = WASM_VECTOR_LEN;
|
|
472
|
+
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
473
|
+
return ret !== 0;
|
|
474
|
+
}
|
|
475
475
|
}
|
|
476
476
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
477
477
|
|
package/node-esm/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
5
|
-
export const init: () => void;
|
|
6
|
-
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
|
-
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
|
-
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
-
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
11
5
|
export const quillmark_new: () => number;
|
|
12
6
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
13
7
|
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
8
|
+
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
14
12
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
15
13
|
export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
|
|
14
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
16
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const init: () => void;
|
|
17
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
19
18
|
export const qcms_white_point_sRGB: (a: number) => void;
|
|
20
|
-
export const
|
|
21
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
19
|
+
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
25
22
|
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
23
|
+
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
29
26
|
export const qcms_transform_release: (a: number) => void;
|
|
27
|
+
export const qcms_enable_iccv4: () => void;
|
|
28
|
+
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
29
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
30
30
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
31
31
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
32
32
|
export const __wbindgen_export_2: (a: number) => void;
|