@asciidoctor/core 3.0.3 → 4.0.0-alpha.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/README.md +42 -10
- package/build/browser/index.js +24154 -0
- package/build/node/index.cjs +24735 -0
- package/{dist/css/asciidoctor.css → data/asciidoctor-default.css} +54 -53
- package/package.json +53 -100
- package/src/abstract_block.js +849 -0
- package/src/abstract_node.js +954 -0
- package/src/attribute_entry.js +12 -0
- package/src/attribute_list.js +380 -0
- package/src/block.js +168 -0
- package/src/browser/asset.js +22 -0
- package/src/browser/reader.js +138 -0
- package/src/browser.js +121 -0
- package/src/callouts.js +85 -0
- package/src/compliance.js +54 -0
- package/src/constants.js +665 -0
- package/src/convert.js +370 -0
- package/src/converter/composite.js +83 -0
- package/src/converter/docbook5.js +1031 -0
- package/src/converter/html5.js +1899 -0
- package/src/converter/manpage.js +935 -0
- package/src/converter/template.js +459 -0
- package/src/converter.js +478 -0
- package/src/data/stylesheet-data.js +2 -0
- package/src/document.js +2134 -0
- package/src/extensions.js +1952 -0
- package/src/footnote.js +28 -0
- package/src/helpers.js +355 -0
- package/src/index.js +138 -0
- package/src/inline.js +158 -0
- package/src/list.js +240 -0
- package/src/load.js +276 -0
- package/src/logging.js +526 -0
- package/src/parser.js +3661 -0
- package/src/path_resolver.js +472 -0
- package/src/reader.js +1755 -0
- package/src/rx.js +829 -0
- package/src/section.js +354 -0
- package/src/stylesheets.js +30 -0
- package/src/substitutors.js +2241 -0
- package/src/syntaxHighlighter/highlightjs.js +90 -0
- package/src/syntaxHighlighter/html_pipeline.js +33 -0
- package/src/syntax_highlighter.js +304 -0
- package/src/table.js +952 -0
- package/src/timings.js +78 -0
- package/types/abstract_block.d.ts +343 -0
- package/types/abstract_node.d.ts +471 -0
- package/types/attribute_entry.d.ts +7 -0
- package/types/attribute_list.d.ts +52 -0
- package/types/block.d.ts +55 -0
- package/types/browser/asset.d.ts +7 -0
- package/types/browser/reader.d.ts +29 -0
- package/types/callouts.d.ts +36 -0
- package/types/compliance.d.ts +23 -0
- package/types/constants.d.ts +268 -0
- package/types/convert.d.ts +34 -0
- package/types/converter/composite.d.ts +20 -0
- package/types/converter/docbook5.d.ts +41 -0
- package/types/converter/html5.d.ts +51 -0
- package/types/converter/manpage.d.ts +59 -0
- package/types/converter/template.d.ts +83 -0
- package/types/converter.d.ts +150 -0
- package/types/data/stylesheet-data.d.ts +2 -0
- package/types/document.d.ts +495 -0
- package/types/extensions.d.ts +876 -0
- package/types/footnote.d.ts +18 -0
- package/types/helpers.d.ts +146 -0
- package/types/index.d.ts +73 -3731
- package/types/inline.d.ts +69 -0
- package/types/list.d.ts +114 -0
- package/types/load.d.ts +39 -0
- package/types/logging.d.ts +187 -0
- package/types/parser.d.ts +114 -0
- package/types/path_resolver.d.ts +103 -0
- package/types/reader.d.ts +184 -0
- package/types/rx.d.ts +513 -0
- package/types/section.d.ts +122 -0
- package/types/stylesheets.d.ts +10 -0
- package/types/substitutors.d.ts +208 -0
- package/types/syntaxHighlighter/highlightjs.d.ts +33 -0
- package/types/syntaxHighlighter/html_pipeline.d.ts +16 -0
- package/types/syntax_highlighter.d.ts +167 -0
- package/types/table.d.ts +231 -0
- package/types/timings.d.ts +25 -0
- package/types/tsconfig.json +9 -0
- package/LICENSE +0 -21
- package/dist/browser/asciidoctor.js +0 -47654
- package/dist/browser/asciidoctor.min.js +0 -1452
- package/dist/graalvm/asciidoctor.js +0 -47402
- package/dist/node/asciidoctor.cjs +0 -21567
- package/dist/node/asciidoctor.js +0 -23037
|
@@ -0,0 +1,876 @@
|
|
|
1
|
+
export namespace ProcessorDsl {
|
|
2
|
+
function option(key: any, value: any): void;
|
|
3
|
+
function process(...args: any[]): any;
|
|
4
|
+
function processBlockGiven(): boolean;
|
|
5
|
+
}
|
|
6
|
+
export namespace DocumentProcessorDsl {
|
|
7
|
+
function prefer(): void;
|
|
8
|
+
/** Alias for {@link prefer}. */
|
|
9
|
+
function prepend(): void;
|
|
10
|
+
}
|
|
11
|
+
export namespace SyntaxProcessorDsl {
|
|
12
|
+
function named(value: any): void;
|
|
13
|
+
function contentModel(value: any): void;
|
|
14
|
+
/** Alias for {@link contentModel}. */
|
|
15
|
+
function parseContentAs(value: any): void;
|
|
16
|
+
function positionalAttributes(...value: any[]): void;
|
|
17
|
+
/** Alias for {@link positionalAttributes}. */
|
|
18
|
+
function namePositionalAttributes(...value: any[]): void;
|
|
19
|
+
function positionalAttrs(...value: any[]): void;
|
|
20
|
+
function defaultAttributes(value: any): void;
|
|
21
|
+
/** @deprecated Alias for {@link defaultAttributes}. */
|
|
22
|
+
function defaultAttrs(value: any): void;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve and register positional attribute names and default values.
|
|
25
|
+
*
|
|
26
|
+
* Accepts any of:
|
|
27
|
+
* resolveAttributes() → positional_attrs: [], default_attrs: {}
|
|
28
|
+
* resolveAttributes('foo', 'bar') → positional maps (Array-style)
|
|
29
|
+
* resolveAttributes({...}) → positional maps (Object-style)
|
|
30
|
+
*
|
|
31
|
+
* Array-style tokens understand positional-index notation (e.g. '1:name',
|
|
32
|
+
* '@:name') and default-value notation (e.g. 'name=value', '1:name=value').
|
|
33
|
+
*
|
|
34
|
+
* @param {...*} args - Positional attribute specifications.
|
|
35
|
+
*/
|
|
36
|
+
function resolveAttributes(...args: any[]): void;
|
|
37
|
+
/** @deprecated Alias for {@link resolveAttributes}. */
|
|
38
|
+
function resolvesAttributes(...args: any[]): void;
|
|
39
|
+
}
|
|
40
|
+
export namespace IncludeProcessorDsl {
|
|
41
|
+
function handles(...args: any[]): any;
|
|
42
|
+
}
|
|
43
|
+
export namespace DocinfoProcessorDsl {
|
|
44
|
+
function atLocation(value: any): void;
|
|
45
|
+
}
|
|
46
|
+
export namespace BlockProcessorDsl {
|
|
47
|
+
function contexts(...value: any[]): void;
|
|
48
|
+
function onContexts(...value: any[]): void;
|
|
49
|
+
function onContext(...value: any[]): void;
|
|
50
|
+
function bindTo(...value: any[]): void;
|
|
51
|
+
}
|
|
52
|
+
export namespace MacroProcessorDsl {
|
|
53
|
+
/**
|
|
54
|
+
* Override: passing a falsy value sets content_model to :text instead of
|
|
55
|
+
* configuring positional attributes.
|
|
56
|
+
*
|
|
57
|
+
* @param {...*} args - Positional attribute specifications.
|
|
58
|
+
*/
|
|
59
|
+
function resolveAttributes(...args: any[]): void;
|
|
60
|
+
/** @deprecated Alias for {@link resolveAttributes}. */
|
|
61
|
+
function resolvesAttributes(...args: any[]): void;
|
|
62
|
+
}
|
|
63
|
+
export namespace InlineMacroProcessorDsl {
|
|
64
|
+
function format(value: any): void;
|
|
65
|
+
/** Alias for {@link format}. */
|
|
66
|
+
function matchFormat(value: any): void;
|
|
67
|
+
/** @deprecated Alias for {@link format}. */
|
|
68
|
+
function usingFormat(value: any): void;
|
|
69
|
+
function match(value: any): void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Abstract base class for document and syntax processors.
|
|
73
|
+
*
|
|
74
|
+
* Provides a class-level config map (via static config / static option) and a
|
|
75
|
+
* set of convenience factory methods for creating AST nodes.
|
|
76
|
+
*/
|
|
77
|
+
export class Processor {
|
|
78
|
+
/**
|
|
79
|
+
* Get the static configuration map for this processor class.
|
|
80
|
+
* Uses hasOwnProperty to avoid inheriting a parent class's config object
|
|
81
|
+
* through the prototype chain when a subclass first accesses config.
|
|
82
|
+
*
|
|
83
|
+
* @returns {object}
|
|
84
|
+
*/
|
|
85
|
+
static get config(): object;
|
|
86
|
+
/**
|
|
87
|
+
* Set a default option value for all instances of this processor class.
|
|
88
|
+
*
|
|
89
|
+
* @param {string} key - The option key.
|
|
90
|
+
* @param {*} value - The option value.
|
|
91
|
+
*/
|
|
92
|
+
static option(key: string, value: any): void;
|
|
93
|
+
/**
|
|
94
|
+
* Mix the DSL object for this processor class into its prototype.
|
|
95
|
+
*/
|
|
96
|
+
static enableDsl(): void;
|
|
97
|
+
/** Alias for {@link enableDsl}. */
|
|
98
|
+
static useDsl(): void;
|
|
99
|
+
constructor(config?: {});
|
|
100
|
+
config: any;
|
|
101
|
+
updateConfig(config: any): void;
|
|
102
|
+
process(..._args: any[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Create a Section node in the same manner as the parser.
|
|
105
|
+
*
|
|
106
|
+
* @param {Section|Document} parent - The parent Section or Document of this new Section.
|
|
107
|
+
* @param {string} title - The String title of the new Section.
|
|
108
|
+
* @param {object} attrs - A plain object of attributes to control how the section is built.
|
|
109
|
+
* Use the style attribute to set the name of a special section (e.g. appendix).
|
|
110
|
+
* Use the id attribute to assign an explicit ID, or set it to false to
|
|
111
|
+
* disable automatic ID generation (when sectids document attribute is set).
|
|
112
|
+
* @param {object} [opts={}] - An optional plain object of options:
|
|
113
|
+
* - level {number} - The Integer level to assign; defaults to parent.level + 1.
|
|
114
|
+
* - numbered {boolean} - Flag to force numbering.
|
|
115
|
+
* @returns {Section} a Section node with all properties properly initialized.
|
|
116
|
+
*/
|
|
117
|
+
createSection(parent: Section | Document, title: string, attrs: object, opts?: object): Section;
|
|
118
|
+
/**
|
|
119
|
+
* Create a generic block node and link it to the specified parent.
|
|
120
|
+
*
|
|
121
|
+
* @param {Block|Section} parent - The parent node.
|
|
122
|
+
* @param {string} context - The block context (e.g. 'paragraph', 'listing').
|
|
123
|
+
* @param {string|string[]|null} source - The source content.
|
|
124
|
+
* @param {object} attrs - A plain object of attributes.
|
|
125
|
+
* @param {object} [opts={}] - An optional plain object of options.
|
|
126
|
+
* @returns {Block} a Block node with all properties properly initialized.
|
|
127
|
+
*/
|
|
128
|
+
createBlock(parent: Block | Section, context: string, source: string | string[] | null, attrs: object, opts?: object): Block;
|
|
129
|
+
/**
|
|
130
|
+
* Create a list node and link it to the specified parent.
|
|
131
|
+
*
|
|
132
|
+
* @param {Block|Section|Document} parent - The parent of this new list.
|
|
133
|
+
* @param {string} context - The list context ('ulist', 'olist', 'colist', 'dlist').
|
|
134
|
+
* @param {object|null} [attrs=null] - A plain object of attributes to set on this list block.
|
|
135
|
+
* @returns {List} a List node with all properties properly initialized.
|
|
136
|
+
*/
|
|
137
|
+
createList(parent: Block | Section | Document, context: string, attrs?: object | null): List;
|
|
138
|
+
/**
|
|
139
|
+
* Create a list item node and link it to the specified parent.
|
|
140
|
+
*
|
|
141
|
+
* @param {List} parent - The parent List of this new list item.
|
|
142
|
+
* @param {string|null} [text=null] - The text of the list item.
|
|
143
|
+
* @returns {ListItem} a ListItem node with all properties properly initialized.
|
|
144
|
+
*/
|
|
145
|
+
createListItem(parent: List, text?: string | null): ListItem;
|
|
146
|
+
/**
|
|
147
|
+
* Create an image block node and link it to the specified parent.
|
|
148
|
+
*
|
|
149
|
+
* @param {Block|Section|Document} parent - The parent of this new image block.
|
|
150
|
+
* @param {object} attrs - A plain object of attributes to control how the image block is built.
|
|
151
|
+
* The target attribute sets the image source; alt sets the alt text.
|
|
152
|
+
* @param {object} [opts={}] - An optional plain object of options.
|
|
153
|
+
* @returns {Block} a Block node with all properties properly initialized.
|
|
154
|
+
*/
|
|
155
|
+
createImageBlock(parent: Block | Section | Document, attrs: object, opts?: object): Block;
|
|
156
|
+
/**
|
|
157
|
+
* Create an inline node and bind it to the specified parent.
|
|
158
|
+
*
|
|
159
|
+
* @param {Block} parent - The parent Block of this new inline node.
|
|
160
|
+
* @param {string} context - The context of the inline node ('quoted', 'anchor', etc.).
|
|
161
|
+
* @param {string} text - The text of the inline node.
|
|
162
|
+
* @param {object} [opts={}] - An optional plain object of options:
|
|
163
|
+
* - type {string} - The subtype of the inline node context.
|
|
164
|
+
* - attributes {object} - Attributes to set on the inline node.
|
|
165
|
+
* @returns {Inline} an Inline node with all properties properly initialized.
|
|
166
|
+
*/
|
|
167
|
+
createInline(parent: Block, context: string, text: string, opts?: object): Inline;
|
|
168
|
+
/**
|
|
169
|
+
* Parse blocks in the content and attach them to the parent.
|
|
170
|
+
*
|
|
171
|
+
* @param {Block|Section} parent - The parent node.
|
|
172
|
+
* @param {string[]|Reader} content - Lines or a Reader.
|
|
173
|
+
* @param {object|null} [attributes=null] - Attributes to pass to the parser.
|
|
174
|
+
* @returns {Promise<Block|Section>} the parent node into which the blocks are parsed.
|
|
175
|
+
*/
|
|
176
|
+
parseContent(parent: Block | Section, content: string[] | Reader, attributes?: object | null): Promise<Block | Section>;
|
|
177
|
+
/**
|
|
178
|
+
* Parse the attrlist String into a plain object of attributes.
|
|
179
|
+
*
|
|
180
|
+
* @param {Block|Section} block - The current block (used for applying subs).
|
|
181
|
+
* @param {string} attrlist - The list of attributes as a String.
|
|
182
|
+
* @param {object} [opts={}] - An optional plain object of options:
|
|
183
|
+
* - positional_attributes {string[]} - Array of attribute names to map positional args to.
|
|
184
|
+
* - sub_attributes {boolean} - Enables attribute substitution on attrlist.
|
|
185
|
+
* @returns {Promise<object>} a plain object of parsed attributes.
|
|
186
|
+
*/
|
|
187
|
+
parseAttributes(block: Block | Section, attrlist: string, opts?: object): Promise<object>;
|
|
188
|
+
/** Shorthand for {@link createBlock} with context 'paragraph'. */
|
|
189
|
+
createParagraph(parent: any, ...rest: any[]): Block;
|
|
190
|
+
/** Shorthand for {@link createBlock} with context 'open'. */
|
|
191
|
+
createOpenBlock(parent: any, ...rest: any[]): Block;
|
|
192
|
+
/** Shorthand for {@link createBlock} with context 'example'. */
|
|
193
|
+
createExampleBlock(parent: any, ...rest: any[]): Block;
|
|
194
|
+
/** Shorthand for {@link createBlock} with context 'pass'. */
|
|
195
|
+
createPassBlock(parent: any, ...rest: any[]): Block;
|
|
196
|
+
/** Shorthand for {@link createBlock} with context 'listing'. */
|
|
197
|
+
createListingBlock(parent: any, ...rest: any[]): Block;
|
|
198
|
+
/** Shorthand for {@link createBlock} with context 'literal'. */
|
|
199
|
+
createLiteralBlock(parent: any, ...rest: any[]): Block;
|
|
200
|
+
/** Shorthand for {@link createInline} with context 'anchor'. */
|
|
201
|
+
createAnchor(parent: any, ...rest: any[]): Inline;
|
|
202
|
+
/** Shorthand for {@link createInline} with context 'quoted'. */
|
|
203
|
+
createInlinePass(parent: any, ...rest: any[]): Inline;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Preprocessors are run after the source text is split into lines and
|
|
207
|
+
* normalised, but before parsing begins.
|
|
208
|
+
*
|
|
209
|
+
* Asciidoctor passes the document and the document's Reader to the process
|
|
210
|
+
* method of the Preprocessor instance. The Preprocessor can modify the Reader
|
|
211
|
+
* as necessary and either return the same Reader (or falsy) or a substitute Reader.
|
|
212
|
+
*
|
|
213
|
+
* Implementations must extend Preprocessor and override {@link process}.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* class CommentStripPreprocessor extends Preprocessor {
|
|
217
|
+
* process(document, reader) {
|
|
218
|
+
* const lines = reader.getLines().filter((l) => !l.startsWith('//'))
|
|
219
|
+
* reader.pushInclude(lines, null, null, 1, {})
|
|
220
|
+
* return reader
|
|
221
|
+
* }
|
|
222
|
+
* }
|
|
223
|
+
* // Register:
|
|
224
|
+
* Extensions.register(function () { this.preprocessor(CommentStripPreprocessor) })
|
|
225
|
+
*/
|
|
226
|
+
export class Preprocessor extends Processor {
|
|
227
|
+
process(_document: any, _reader: any): void;
|
|
228
|
+
}
|
|
229
|
+
export namespace Preprocessor {
|
|
230
|
+
export { DocumentProcessorDsl as DSL };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* TreeProcessors are run on the Document after the source has been
|
|
234
|
+
* parsed into an abstract syntax tree (AST).
|
|
235
|
+
*
|
|
236
|
+
* Implementations must extend TreeProcessor and override {@link process}.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* class ShoutTreeProcessor extends TreeProcessor {
|
|
240
|
+
* process(document) {
|
|
241
|
+
* for (const block of document.findBy({ context: 'paragraph' })) {
|
|
242
|
+
* block.source = block.source.toUpperCase()
|
|
243
|
+
* }
|
|
244
|
+
* }
|
|
245
|
+
* }
|
|
246
|
+
* Extensions.register(function () { this.treeProcessor(ShoutTreeProcessor) })
|
|
247
|
+
*/
|
|
248
|
+
export class TreeProcessor extends Processor {
|
|
249
|
+
process(_document: any): void;
|
|
250
|
+
}
|
|
251
|
+
export namespace TreeProcessor {
|
|
252
|
+
export { DocumentProcessorDsl as DSL };
|
|
253
|
+
}
|
|
254
|
+
/** @deprecated Alias for {@link TreeProcessor} kept for backwards compatibility. */
|
|
255
|
+
export const Treeprocessor: typeof TreeProcessor;
|
|
256
|
+
/**
|
|
257
|
+
* Postprocessors are run after the document is converted, but before
|
|
258
|
+
* it is written to the output stream.
|
|
259
|
+
*
|
|
260
|
+
* The `process` method receives the document and the converted output string, and
|
|
261
|
+
* must return the (possibly modified) output string.
|
|
262
|
+
*
|
|
263
|
+
* Implementations must extend Postprocessor and override {@link process}.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* class FooterPostprocessor extends Postprocessor {
|
|
267
|
+
* process(document, output) {
|
|
268
|
+
* return output.replace('</body>', '<footer>Generated by Acme</footer></body>')
|
|
269
|
+
* }
|
|
270
|
+
* }
|
|
271
|
+
* Extensions.register(function () { this.postprocessor(FooterPostprocessor) })
|
|
272
|
+
*/
|
|
273
|
+
export class Postprocessor extends Processor {
|
|
274
|
+
process(_document: any, _output: any): void;
|
|
275
|
+
}
|
|
276
|
+
export namespace Postprocessor {
|
|
277
|
+
export { DocumentProcessorDsl as DSL };
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* IncludeProcessors handle include::<target>[] directives.
|
|
281
|
+
*
|
|
282
|
+
* Implementations must extend IncludeProcessor.
|
|
283
|
+
*/
|
|
284
|
+
export class IncludeProcessor extends Processor {
|
|
285
|
+
process(_document: any, _reader: any, _target: any, _attributes: any): void;
|
|
286
|
+
handles(_doc: any, _target: any): boolean;
|
|
287
|
+
}
|
|
288
|
+
export namespace IncludeProcessor {
|
|
289
|
+
export { IncludeProcessorDsl as DSL };
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* DocinfoProcessors add additional content to the header and/or footer
|
|
293
|
+
* of the generated document.
|
|
294
|
+
*
|
|
295
|
+
* Implementations must extend DocinfoProcessor.
|
|
296
|
+
*/
|
|
297
|
+
export class DocinfoProcessor extends Processor {
|
|
298
|
+
process(_document: any): void;
|
|
299
|
+
}
|
|
300
|
+
export namespace DocinfoProcessor {
|
|
301
|
+
export { DocinfoProcessorDsl as DSL };
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* BlockProcessors handle delimited blocks and paragraphs with a custom name.
|
|
305
|
+
*
|
|
306
|
+
* The `process(parent, reader, attributes)` method receives:
|
|
307
|
+
* - `parent` {AbstractBlock} — the enclosing block
|
|
308
|
+
* - `reader` {Reader} — positioned at the block content
|
|
309
|
+
* - `attributes` {Object} — parsed block attributes
|
|
310
|
+
*
|
|
311
|
+
* It must return a block node (created with `this.createBlock(...)`, etc.)
|
|
312
|
+
* or call `this.parseContent(parent, reader)` to delegate parsing.
|
|
313
|
+
*
|
|
314
|
+
* Use the static `config` object or the DSL helpers (`contexts()`,
|
|
315
|
+
* `contentModel()`, `resolveAttributes()`, …) to declare the block's behaviour
|
|
316
|
+
* before registering.
|
|
317
|
+
*
|
|
318
|
+
* Implementations must extend BlockProcessor and override {@link process}.
|
|
319
|
+
*
|
|
320
|
+
* @example <caption>Custom delimited block that wraps content in a div</caption>
|
|
321
|
+
* class ShoutBlock extends BlockProcessor {
|
|
322
|
+
* process(parent, reader, attrs) {
|
|
323
|
+
* const block = this.createBlock(parent, 'paragraph', reader.readLines().join('\n').toUpperCase(), attrs)
|
|
324
|
+
* return block
|
|
325
|
+
* }
|
|
326
|
+
* }
|
|
327
|
+
* ShoutBlock.config = { name: 'shout', contexts: ['paragraph'], content_model: 'simple' }
|
|
328
|
+
* Extensions.register(function () { this.block(ShoutBlock) })
|
|
329
|
+
* // AsciiDoc usage: [shout]\nHello world
|
|
330
|
+
*/
|
|
331
|
+
export class BlockProcessor extends Processor {
|
|
332
|
+
constructor(name?: any, config?: {});
|
|
333
|
+
name: any;
|
|
334
|
+
process(_parent: any, _reader: any, _attributes: any): void;
|
|
335
|
+
}
|
|
336
|
+
export namespace BlockProcessor {
|
|
337
|
+
export { BlockProcessorDsl as DSL };
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Base class shared by BlockMacroProcessor and InlineMacroProcessor.
|
|
341
|
+
*/
|
|
342
|
+
export class MacroProcessor extends Processor {
|
|
343
|
+
constructor(name?: any, config?: {});
|
|
344
|
+
name: any;
|
|
345
|
+
process(_parent: any, _target: any, _attributes: any): void;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* BlockMacroProcessors handle block macros with a custom name.
|
|
349
|
+
*
|
|
350
|
+
* The `process(parent, target, attributes)` method receives:
|
|
351
|
+
* - `parent` {AbstractBlock} — the enclosing block
|
|
352
|
+
* - `target` {string} — the macro target (text between `name:` and `[`)
|
|
353
|
+
* - `attributes` {Object} — parsed macro attributes
|
|
354
|
+
*
|
|
355
|
+
* It must return a block node created with one of the `createBlock`,
|
|
356
|
+
* `createImage`, etc. helpers inherited from {@link Processor}.
|
|
357
|
+
*
|
|
358
|
+
* Implementations must extend BlockMacroProcessor and override {@link process}.
|
|
359
|
+
*
|
|
360
|
+
* @example <caption>Block macro that embeds a GitHub Gist</caption>
|
|
361
|
+
* class GistBlockMacro extends BlockMacroProcessor {
|
|
362
|
+
* process(parent, target, attrs) {
|
|
363
|
+
* const html = `<script src="https://gist.github.com/${target}.js"></script>`
|
|
364
|
+
* return this.createBlock(parent, 'pass', html)
|
|
365
|
+
* }
|
|
366
|
+
* }
|
|
367
|
+
* GistBlockMacro.config = { name: 'gist' }
|
|
368
|
+
* Extensions.register(function () { this.blockMacro(GistBlockMacro) })
|
|
369
|
+
* // AsciiDoc usage: gist::abc123[]
|
|
370
|
+
*/
|
|
371
|
+
export class BlockMacroProcessor extends MacroProcessor {
|
|
372
|
+
_name: any;
|
|
373
|
+
}
|
|
374
|
+
export namespace BlockMacroProcessor {
|
|
375
|
+
export { MacroProcessorDsl as DSL };
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* InlineMacroProcessors handle inline macros with a custom name.
|
|
379
|
+
*
|
|
380
|
+
* The `process(parent, target, attributes)` method receives:
|
|
381
|
+
* - `parent` {AbstractBlock} — the enclosing block
|
|
382
|
+
* - `target` {string} — the macro target (text between `name:` and `[`)
|
|
383
|
+
* - `attributes` {Object} — parsed macro attributes (first positional attr is `attributes[1]`)
|
|
384
|
+
*
|
|
385
|
+
* It must return an {@link Inline} node created with `this.createInline(parent, 'quoted', text, opts)`.
|
|
386
|
+
*
|
|
387
|
+
* By default the macro format is `'long'` (`name:target[attrs]`). Set
|
|
388
|
+
* `config.format = 'short'` for a no-target form (`name:[attrs]`).
|
|
389
|
+
*
|
|
390
|
+
* Implementations must extend InlineMacroProcessor and override {@link process}.
|
|
391
|
+
*
|
|
392
|
+
* @example <caption>Inline macro that generates a keyboard shortcut span</caption>
|
|
393
|
+
* class KbdInlineMacro extends InlineMacroProcessor {
|
|
394
|
+
* process(parent, target, attrs) {
|
|
395
|
+
* return this.createInline(parent, 'quoted', target, { type: 'monospaced' })
|
|
396
|
+
* }
|
|
397
|
+
* }
|
|
398
|
+
* KbdInlineMacro.config = { name: 'kbd', format: 'short' }
|
|
399
|
+
* Extensions.register(function () { this.inlineMacro(KbdInlineMacro) })
|
|
400
|
+
* // AsciiDoc usage: kbd:[Ctrl+C]
|
|
401
|
+
*/
|
|
402
|
+
export class InlineMacroProcessor extends MacroProcessor {
|
|
403
|
+
static rxCache: Map<any, any>;
|
|
404
|
+
/**
|
|
405
|
+
* Look up (and memoize) the regexp for this inline macro processor.
|
|
406
|
+
*
|
|
407
|
+
* @returns {RegExp}
|
|
408
|
+
*/
|
|
409
|
+
get regexp(): RegExp;
|
|
410
|
+
resolveRegexp(name: any, format: any): any;
|
|
411
|
+
}
|
|
412
|
+
export namespace InlineMacroProcessor {
|
|
413
|
+
export { InlineMacroProcessorDsl as DSL };
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Proxy that encapsulates the extension kind, config, and instance.
|
|
417
|
+
* This is what gets stored in the extension registry when activated.
|
|
418
|
+
*/
|
|
419
|
+
export class Extension {
|
|
420
|
+
constructor(kind: any, instance: any, config: any);
|
|
421
|
+
kind: any;
|
|
422
|
+
instance: any;
|
|
423
|
+
config: any;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Specialisation of Extension that additionally stores a reference
|
|
427
|
+
* to the process method, accommodating both class-based processors and function blocks.
|
|
428
|
+
*/
|
|
429
|
+
export class ProcessorExtension extends Extension {
|
|
430
|
+
processMethod: any;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* A Group registers one or more extensions with a Registry.
|
|
434
|
+
*
|
|
435
|
+
* Subclass Group and pass the subclass to Extensions.register(), or call
|
|
436
|
+
* the static register() method directly.
|
|
437
|
+
*/
|
|
438
|
+
export class Group {
|
|
439
|
+
static register(name?: any): void;
|
|
440
|
+
activate(_registry: any): void;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* The primary entry point into the extension system.
|
|
444
|
+
*
|
|
445
|
+
* Registry holds the extensions which have been registered and activated, has
|
|
446
|
+
* methods for registering or defining a processor and looks up extensions
|
|
447
|
+
* stored in the registry during parsing.
|
|
448
|
+
*/
|
|
449
|
+
export class Registry {
|
|
450
|
+
constructor(groups?: {});
|
|
451
|
+
groups: {};
|
|
452
|
+
/**
|
|
453
|
+
* Activate all global extension Groups and the Groups associated with this registry.
|
|
454
|
+
*
|
|
455
|
+
* @param {Document} document - The Document on which the extensions are to be used.
|
|
456
|
+
* @returns {Registry} this Registry.
|
|
457
|
+
*/
|
|
458
|
+
activate(document: Document): Registry;
|
|
459
|
+
document: any;
|
|
460
|
+
/**
|
|
461
|
+
* Register a Preprocessor with the extension registry.
|
|
462
|
+
*
|
|
463
|
+
* The processor may be:
|
|
464
|
+
* - A Preprocessor subclass (constructor function)
|
|
465
|
+
* - An instance of a Preprocessor subclass
|
|
466
|
+
* - A Function that configures the processor via the DSL (block style)
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* // class style
|
|
470
|
+
* preprocessor(FrontMatterPreprocessor)
|
|
471
|
+
* // instance style
|
|
472
|
+
* preprocessor(new FrontMatterPreprocessor())
|
|
473
|
+
* // block style
|
|
474
|
+
* preprocessor(function () {
|
|
475
|
+
* this.process(function (doc, reader) { ... })
|
|
476
|
+
* })
|
|
477
|
+
*
|
|
478
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
479
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
480
|
+
*/
|
|
481
|
+
preprocessor(...args: any[]): ProcessorExtension;
|
|
482
|
+
/**
|
|
483
|
+
* Return the registered Preprocessor extensions, or null if none.
|
|
484
|
+
*
|
|
485
|
+
* @returns {ProcessorExtension[]|null}
|
|
486
|
+
*/
|
|
487
|
+
preprocessors(): ProcessorExtension[] | null;
|
|
488
|
+
/**
|
|
489
|
+
* Check whether any Preprocessor extensions have been registered.
|
|
490
|
+
*
|
|
491
|
+
* @returns {boolean}
|
|
492
|
+
*/
|
|
493
|
+
hasPreprocessors(): boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Register a TreeProcessor with the extension registry.
|
|
496
|
+
*
|
|
497
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
498
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
499
|
+
*/
|
|
500
|
+
treeProcessor(...args: any[]): ProcessorExtension;
|
|
501
|
+
/** @deprecated Alias for {@link treeProcessor}. */
|
|
502
|
+
treeprocessor(...args: any[]): ProcessorExtension;
|
|
503
|
+
/** Alias for {@link treeProcessor} (snake_case for prefer() / Registry method dispatch). */
|
|
504
|
+
tree_processor(...args: any[]): ProcessorExtension;
|
|
505
|
+
/**
|
|
506
|
+
* Return the registered TreeProcessor extensions, or null if none.
|
|
507
|
+
*
|
|
508
|
+
* @returns {ProcessorExtension[]|null}
|
|
509
|
+
*/
|
|
510
|
+
treeProcessors(): ProcessorExtension[] | null;
|
|
511
|
+
/**
|
|
512
|
+
* Check whether any TreeProcessor extensions have been registered.
|
|
513
|
+
*
|
|
514
|
+
* @returns {boolean}
|
|
515
|
+
*/
|
|
516
|
+
hasTreeProcessors(): boolean;
|
|
517
|
+
/** @deprecated Typo alias kept for backward compatibility. Use {@link hasTreeProcessors}. */
|
|
518
|
+
hasTeeProcessors(): boolean;
|
|
519
|
+
/** @deprecated Alias for {@link treeProcessors}. */
|
|
520
|
+
treeprocessors(): any;
|
|
521
|
+
/**
|
|
522
|
+
* Register a Postprocessor with the extension registry.
|
|
523
|
+
*
|
|
524
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
525
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
526
|
+
*/
|
|
527
|
+
postprocessor(...args: any[]): ProcessorExtension;
|
|
528
|
+
/**
|
|
529
|
+
* Return the registered Postprocessor extensions, or null if none.
|
|
530
|
+
*
|
|
531
|
+
* @returns {ProcessorExtension[]|null}
|
|
532
|
+
*/
|
|
533
|
+
postprocessors(): ProcessorExtension[] | null;
|
|
534
|
+
/**
|
|
535
|
+
* Check whether any Postprocessor extensions have been registered.
|
|
536
|
+
*
|
|
537
|
+
* @returns {boolean}
|
|
538
|
+
*/
|
|
539
|
+
hasPostprocessors(): boolean;
|
|
540
|
+
/**
|
|
541
|
+
* Register an IncludeProcessor with the extension registry.
|
|
542
|
+
*
|
|
543
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
544
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
545
|
+
*/
|
|
546
|
+
includeProcessor(...args: any[]): ProcessorExtension;
|
|
547
|
+
/**
|
|
548
|
+
* Return the registered IncludeProcessor extensions, or null if none.
|
|
549
|
+
*
|
|
550
|
+
* @returns {ProcessorExtension[]|null}
|
|
551
|
+
*/
|
|
552
|
+
includeProcessors(): ProcessorExtension[] | null;
|
|
553
|
+
/**
|
|
554
|
+
* Check whether any IncludeProcessor extensions have been registered.
|
|
555
|
+
*
|
|
556
|
+
* @returns {boolean}
|
|
557
|
+
*/
|
|
558
|
+
hasIncludeProcessors(): boolean;
|
|
559
|
+
/** Alias for {@link includeProcessor} (snake_case for prefer() / Registry method dispatch). */
|
|
560
|
+
include_processor(...args: any[]): ProcessorExtension;
|
|
561
|
+
/**
|
|
562
|
+
* Register a DocinfoProcessor with the extension registry.
|
|
563
|
+
*
|
|
564
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
565
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
566
|
+
*/
|
|
567
|
+
docinfoProcessor(...args: any[]): ProcessorExtension;
|
|
568
|
+
/**
|
|
569
|
+
* Check whether any DocinfoProcessor extensions have been registered.
|
|
570
|
+
*
|
|
571
|
+
* @param {string|null} [location=null] - Optional location ('head' or 'footer') to filter by.
|
|
572
|
+
* @returns {boolean}
|
|
573
|
+
*/
|
|
574
|
+
hasDocinfoProcessors(location?: string | null): boolean;
|
|
575
|
+
/**
|
|
576
|
+
* Retrieve Extension proxy objects for DocinfoProcessor instances.
|
|
577
|
+
*
|
|
578
|
+
* @param {string|null} [location=null] - Optional location ('head' or 'footer') to filter by.
|
|
579
|
+
* @returns {ProcessorExtension[]} array of Extension proxy objects.
|
|
580
|
+
*/
|
|
581
|
+
docinfoProcessors(location?: string | null): ProcessorExtension[];
|
|
582
|
+
/** Alias for {@link docinfoProcessor} (snake_case for prefer() / Registry method dispatch). */
|
|
583
|
+
docinfo_processor(...args: any[]): ProcessorExtension;
|
|
584
|
+
/**
|
|
585
|
+
* Register a BlockProcessor with the extension registry.
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* // class style
|
|
589
|
+
* block(ShoutBlock)
|
|
590
|
+
* // class style with explicit name
|
|
591
|
+
* block(ShoutBlock, 'shout')
|
|
592
|
+
* // block style
|
|
593
|
+
* block(function () {
|
|
594
|
+
* this.named('shout')
|
|
595
|
+
* this.process(function (parent, reader, attrs) { ... })
|
|
596
|
+
* })
|
|
597
|
+
* // block style with explicit name
|
|
598
|
+
* block('shout', function () {
|
|
599
|
+
* this.process(function (parent, reader, attrs) { ... })
|
|
600
|
+
* })
|
|
601
|
+
*
|
|
602
|
+
* @param {...*} args - Class constructor, instance, block function, or name + one of those.
|
|
603
|
+
* @returns {ProcessorExtension} an Extension proxy object.
|
|
604
|
+
*/
|
|
605
|
+
block(...args: any[]): ProcessorExtension;
|
|
606
|
+
/**
|
|
607
|
+
* Check whether any BlockProcessor extensions have been registered.
|
|
608
|
+
*
|
|
609
|
+
* @returns {boolean}
|
|
610
|
+
*/
|
|
611
|
+
hasBlocks(): boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Check whether a BlockProcessor is registered for the given name and context.
|
|
614
|
+
*
|
|
615
|
+
* @param {string} name - The block name.
|
|
616
|
+
* @param {string} context - The block context.
|
|
617
|
+
* @returns {ProcessorExtension|false} the Extension proxy or false.
|
|
618
|
+
*/
|
|
619
|
+
registeredForBlock(name: string, context: string): ProcessorExtension | false;
|
|
620
|
+
/**
|
|
621
|
+
* Retrieve the Extension proxy for the BlockProcessor registered with the given name.
|
|
622
|
+
*
|
|
623
|
+
* @param {string} name - The block name.
|
|
624
|
+
* @returns {ProcessorExtension|null}
|
|
625
|
+
*/
|
|
626
|
+
findBlockExtension(name: string): ProcessorExtension | null;
|
|
627
|
+
/**
|
|
628
|
+
* Register a BlockMacroProcessor with the extension registry.
|
|
629
|
+
*
|
|
630
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
631
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
632
|
+
*/
|
|
633
|
+
blockMacro(...args: any[]): ProcessorExtension;
|
|
634
|
+
/** @deprecated Alias for {@link blockMacro}. */
|
|
635
|
+
block_macro(...args: any[]): ProcessorExtension;
|
|
636
|
+
/**
|
|
637
|
+
* Check whether any BlockMacroProcessor extensions have been registered.
|
|
638
|
+
*
|
|
639
|
+
* @returns {boolean}
|
|
640
|
+
*/
|
|
641
|
+
hasBlockMacros(): boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Check whether a BlockMacroProcessor is registered for the given name.
|
|
644
|
+
*
|
|
645
|
+
* @param {string} name - The macro name.
|
|
646
|
+
* @returns {ProcessorExtension|false}
|
|
647
|
+
*/
|
|
648
|
+
registeredForBlockMacro(name: string): ProcessorExtension | false;
|
|
649
|
+
/**
|
|
650
|
+
* Retrieve the Extension proxy for the BlockMacroProcessor registered with the given name.
|
|
651
|
+
*
|
|
652
|
+
* @param {string} name - The macro name.
|
|
653
|
+
* @returns {ProcessorExtension|null}
|
|
654
|
+
*/
|
|
655
|
+
findBlockMacroExtension(name: string): ProcessorExtension | null;
|
|
656
|
+
/**
|
|
657
|
+
* Register an InlineMacroProcessor with the extension registry.
|
|
658
|
+
*
|
|
659
|
+
* @param {...*} args - Class constructor, instance, or block function.
|
|
660
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
661
|
+
*/
|
|
662
|
+
inlineMacro(...args: any[]): ProcessorExtension;
|
|
663
|
+
/** @deprecated Alias for {@link inlineMacro}. */
|
|
664
|
+
inline_macro(...args: any[]): ProcessorExtension;
|
|
665
|
+
/**
|
|
666
|
+
* Check whether any InlineMacroProcessor extensions have been registered.
|
|
667
|
+
*
|
|
668
|
+
* @returns {boolean}
|
|
669
|
+
*/
|
|
670
|
+
hasInlineMacros(): boolean;
|
|
671
|
+
/**
|
|
672
|
+
* Check whether an InlineMacroProcessor is registered for the given name.
|
|
673
|
+
*
|
|
674
|
+
* @param {string} name - The macro name.
|
|
675
|
+
* @returns {ProcessorExtension|false}
|
|
676
|
+
*/
|
|
677
|
+
registeredForInlineMacro(name: string): ProcessorExtension | false;
|
|
678
|
+
/**
|
|
679
|
+
* Retrieve the Extension proxy for the InlineMacroProcessor registered with the given name.
|
|
680
|
+
*
|
|
681
|
+
* @param {string} name - The macro name.
|
|
682
|
+
* @returns {ProcessorExtension|null}
|
|
683
|
+
*/
|
|
684
|
+
findInlineMacroExtension(name: string): ProcessorExtension | null;
|
|
685
|
+
/**
|
|
686
|
+
* Retrieve all InlineMacroProcessor Extension proxy objects.
|
|
687
|
+
*
|
|
688
|
+
* @returns {ProcessorExtension[]}
|
|
689
|
+
*/
|
|
690
|
+
inlineMacros(): ProcessorExtension[];
|
|
691
|
+
/**
|
|
692
|
+
* Insert the document-processor Extension as the first of its kind in the extension registry.
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* registry.prefer('includeProcessor', function () {
|
|
696
|
+
* this.process(function (document, reader, target, attrs) { ... })
|
|
697
|
+
* })
|
|
698
|
+
*
|
|
699
|
+
* @param {...*} args - A ProcessorExtension, or a method name followed by processor args.
|
|
700
|
+
* @returns {ProcessorExtension} the Extension stored in the registry.
|
|
701
|
+
*/
|
|
702
|
+
prefer(...args: any[]): ProcessorExtension;
|
|
703
|
+
}
|
|
704
|
+
export namespace Extensions {
|
|
705
|
+
/**
|
|
706
|
+
* Return the plain Object that maps names to registered groups.
|
|
707
|
+
*
|
|
708
|
+
* @returns {object}
|
|
709
|
+
*/
|
|
710
|
+
function groups(): object;
|
|
711
|
+
/**
|
|
712
|
+
* Create a new Registry, optionally pre-populated with a named block.
|
|
713
|
+
*
|
|
714
|
+
* @param {string|null} [name=null] - Optional name for the group; auto-generated if omitted.
|
|
715
|
+
* @param {Function|null} [block=null] - Optional function to register as the group.
|
|
716
|
+
* @returns {Registry}
|
|
717
|
+
*/
|
|
718
|
+
function create(name?: string | null, block?: Function | null): Registry;
|
|
719
|
+
/**
|
|
720
|
+
* Register an extension Group that subsequently registers extensions.
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* Extensions.register(UmlExtensions)
|
|
724
|
+
* Extensions.register('uml', UmlExtensions)
|
|
725
|
+
* Extensions.register(function () { this.blockMacro('plantuml', PlantUmlBlock) })
|
|
726
|
+
* Extensions.register('uml', function () { this.blockMacro('plantuml', PlantUmlBlock) })
|
|
727
|
+
*
|
|
728
|
+
* @param {...*} args - Optional name followed by a Group class, instance, or function.
|
|
729
|
+
* @returns {Function|object} the registered group.
|
|
730
|
+
*/
|
|
731
|
+
function register(...args: any[]): Function | object;
|
|
732
|
+
/**
|
|
733
|
+
* Unregister all statically-registered extension groups.
|
|
734
|
+
*/
|
|
735
|
+
function unregisterAll(): void;
|
|
736
|
+
/**
|
|
737
|
+
* Unregister statically-registered extension groups by name.
|
|
738
|
+
*
|
|
739
|
+
* @param {...string} names - One or more group names to unregister.
|
|
740
|
+
*/
|
|
741
|
+
function unregister(...names: string[]): void;
|
|
742
|
+
/**
|
|
743
|
+
* Create a Preprocessor subclass with the given prototype functions.
|
|
744
|
+
*
|
|
745
|
+
* @param {string} [name] - Optional class name.
|
|
746
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
747
|
+
* @returns {typeof Preprocessor}
|
|
748
|
+
*/
|
|
749
|
+
function createPreprocessor(name?: string, functions?: object, ...args: any[]): typeof Preprocessor;
|
|
750
|
+
/**
|
|
751
|
+
* Create and return a new Preprocessor instance with the given prototype functions.
|
|
752
|
+
*
|
|
753
|
+
* @param {string} [name] - Optional class name.
|
|
754
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
755
|
+
* @returns {Preprocessor}
|
|
756
|
+
*/
|
|
757
|
+
function newPreprocessor(name?: string, functions?: object, ...args: any[]): Preprocessor;
|
|
758
|
+
/**
|
|
759
|
+
* Create a TreeProcessor subclass with the given prototype functions.
|
|
760
|
+
*
|
|
761
|
+
* @param {string} [name] - Optional class name.
|
|
762
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
763
|
+
* @returns {typeof TreeProcessor}
|
|
764
|
+
*/
|
|
765
|
+
function createTreeProcessor(name?: string, functions?: object, ...args: any[]): typeof TreeProcessor;
|
|
766
|
+
/**
|
|
767
|
+
* Create and return a new TreeProcessor instance with the given prototype functions.
|
|
768
|
+
*
|
|
769
|
+
* @param {string} [name] - Optional class name.
|
|
770
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
771
|
+
* @returns {TreeProcessor}
|
|
772
|
+
*/
|
|
773
|
+
function newTreeProcessor(name?: string, functions?: object, ...args: any[]): TreeProcessor;
|
|
774
|
+
/**
|
|
775
|
+
* Create a Postprocessor subclass with the given prototype functions.
|
|
776
|
+
*
|
|
777
|
+
* @param {string} [name] - Optional class name.
|
|
778
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
779
|
+
* @returns {typeof Postprocessor}
|
|
780
|
+
*/
|
|
781
|
+
function createPostprocessor(name?: string, functions?: object, ...args: any[]): typeof Postprocessor;
|
|
782
|
+
/**
|
|
783
|
+
* Create and return a new Postprocessor instance with the given prototype functions.
|
|
784
|
+
*
|
|
785
|
+
* @param {string} [name] - Optional class name.
|
|
786
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
787
|
+
* @returns {Postprocessor}
|
|
788
|
+
*/
|
|
789
|
+
function newPostprocessor(name?: string, functions?: object, ...args: any[]): Postprocessor;
|
|
790
|
+
/**
|
|
791
|
+
* Create an IncludeProcessor subclass with the given prototype functions.
|
|
792
|
+
*
|
|
793
|
+
* @param {string} [name] - Optional class name.
|
|
794
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
795
|
+
* @returns {typeof IncludeProcessor}
|
|
796
|
+
*/
|
|
797
|
+
function createIncludeProcessor(name?: string, functions?: object, ...args: any[]): typeof IncludeProcessor;
|
|
798
|
+
/**
|
|
799
|
+
* Create and return a new IncludeProcessor instance with the given prototype functions.
|
|
800
|
+
*
|
|
801
|
+
* @param {string} [name] - Optional class name.
|
|
802
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
803
|
+
* @returns {IncludeProcessor}
|
|
804
|
+
*/
|
|
805
|
+
function newIncludeProcessor(name?: string, functions?: object, ...args: any[]): IncludeProcessor;
|
|
806
|
+
/**
|
|
807
|
+
* Create a DocinfoProcessor subclass with the given prototype functions.
|
|
808
|
+
*
|
|
809
|
+
* @param {string} [name] - Optional class name.
|
|
810
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
811
|
+
* @returns {typeof DocinfoProcessor}
|
|
812
|
+
*/
|
|
813
|
+
function createDocinfoProcessor(name?: string, functions?: object, ...args: any[]): typeof DocinfoProcessor;
|
|
814
|
+
/**
|
|
815
|
+
* Create and return a new DocinfoProcessor instance with the given prototype functions.
|
|
816
|
+
*
|
|
817
|
+
* @param {string} [name] - Optional class name.
|
|
818
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
819
|
+
* @returns {DocinfoProcessor}
|
|
820
|
+
*/
|
|
821
|
+
function newDocinfoProcessor(name?: string, functions?: object, ...args: any[]): DocinfoProcessor;
|
|
822
|
+
/**
|
|
823
|
+
* Create a BlockProcessor subclass with the given prototype functions.
|
|
824
|
+
*
|
|
825
|
+
* @param {string} [name] - Optional class name.
|
|
826
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
827
|
+
* @returns {typeof BlockProcessor}
|
|
828
|
+
*/
|
|
829
|
+
function createBlockProcessor(name?: string, functions?: object, ...args: any[]): typeof BlockProcessor;
|
|
830
|
+
/**
|
|
831
|
+
* Create and return a new BlockProcessor instance with the given prototype functions.
|
|
832
|
+
*
|
|
833
|
+
* @param {string} [name] - Optional class name.
|
|
834
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
835
|
+
* @returns {BlockProcessor}
|
|
836
|
+
*/
|
|
837
|
+
function newBlockProcessor(name?: string, functions?: object, ...args: any[]): BlockProcessor;
|
|
838
|
+
/**
|
|
839
|
+
* Create an InlineMacroProcessor subclass with the given prototype functions.
|
|
840
|
+
*
|
|
841
|
+
* @param {string} [name] - Optional class name.
|
|
842
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
843
|
+
* @returns {typeof InlineMacroProcessor}
|
|
844
|
+
*/
|
|
845
|
+
function createInlineMacroProcessor(name?: string, functions?: object, ...args: any[]): typeof InlineMacroProcessor;
|
|
846
|
+
/**
|
|
847
|
+
* Create and return a new InlineMacroProcessor instance with the given prototype functions.
|
|
848
|
+
*
|
|
849
|
+
* @param {string} [name] - Optional class name.
|
|
850
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
851
|
+
* @returns {InlineMacroProcessor}
|
|
852
|
+
*/
|
|
853
|
+
function newInlineMacroProcessor(name?: string, functions?: object, ...args: any[]): InlineMacroProcessor;
|
|
854
|
+
/**
|
|
855
|
+
* Create a BlockMacroProcessor subclass with the given prototype functions.
|
|
856
|
+
*
|
|
857
|
+
* @param {string} [name] - Optional class name.
|
|
858
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
859
|
+
* @returns {typeof BlockMacroProcessor}
|
|
860
|
+
*/
|
|
861
|
+
function createBlockMacroProcessor(name?: string, functions?: object, ...args: any[]): typeof BlockMacroProcessor;
|
|
862
|
+
/**
|
|
863
|
+
* Create and return a new BlockMacroProcessor instance with the given prototype functions.
|
|
864
|
+
*
|
|
865
|
+
* @param {string} [name] - Optional class name.
|
|
866
|
+
* @param {object} [functions] - Methods to mix into the prototype.
|
|
867
|
+
* @returns {BlockMacroProcessor}
|
|
868
|
+
*/
|
|
869
|
+
function newBlockMacroProcessor(name?: string, functions?: object, ...args: any[]): BlockMacroProcessor;
|
|
870
|
+
}
|
|
871
|
+
import { Section } from './section.js';
|
|
872
|
+
import { Block } from './block.js';
|
|
873
|
+
import { List } from './list.js';
|
|
874
|
+
import { ListItem } from './list.js';
|
|
875
|
+
import { Inline } from './inline.js';
|
|
876
|
+
import { Reader } from './reader.js';
|