@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
package/types/table.d.ts
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export class Table extends AbstractBlock<string> {
|
|
2
|
+
constructor(parent: any, attributes: any);
|
|
3
|
+
rows: {
|
|
4
|
+
head: any[];
|
|
5
|
+
foot: any[];
|
|
6
|
+
body: any[];
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the rows grouped by section as a nested Array.
|
|
9
|
+
* @returns {Array<[string, Array]>}
|
|
10
|
+
*/
|
|
11
|
+
bySection(): Array<[string, any[]]>;
|
|
12
|
+
toObject(): {
|
|
13
|
+
head: any[];
|
|
14
|
+
body: any[];
|
|
15
|
+
foot: any[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
columns: any[];
|
|
19
|
+
hasHeaderOption: boolean;
|
|
20
|
+
}
|
|
21
|
+
export namespace Table {
|
|
22
|
+
export { Rows };
|
|
23
|
+
export { Column };
|
|
24
|
+
export { Cell };
|
|
25
|
+
export { ParserContext };
|
|
26
|
+
}
|
|
27
|
+
import { AbstractBlock } from './abstract_block.js';
|
|
28
|
+
import { AbstractNode } from './abstract_node.js';
|
|
29
|
+
declare class Rows {
|
|
30
|
+
constructor(head?: any[], foot?: any[], body?: any[]);
|
|
31
|
+
head: any[];
|
|
32
|
+
foot: any[];
|
|
33
|
+
body: any[];
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve the rows grouped by section as a nested Array.
|
|
36
|
+
* @returns {Array<[string, Array]>}
|
|
37
|
+
*/
|
|
38
|
+
bySection(): Array<[string, any[]]>;
|
|
39
|
+
toObject(): {
|
|
40
|
+
head: any[];
|
|
41
|
+
body: any[];
|
|
42
|
+
foot: any[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
declare class Column extends AbstractNode {
|
|
46
|
+
constructor(table: any, index: any, attributes?: {});
|
|
47
|
+
style: any;
|
|
48
|
+
/** Alias for parent (always a Table). */
|
|
49
|
+
get table(): AbstractNode;
|
|
50
|
+
/**
|
|
51
|
+
* Get the parent table of this column.
|
|
52
|
+
* @returns {Table}
|
|
53
|
+
*/
|
|
54
|
+
getTable(): Table;
|
|
55
|
+
}
|
|
56
|
+
/** @extends {AbstractBlock<string | string[]>} */
|
|
57
|
+
declare class Cell extends AbstractBlock<string | string[]> {
|
|
58
|
+
static get DOUBLE_LF(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Factory — create and fully initialize a Cell asynchronously.
|
|
61
|
+
* For AsciiDoc cells, parses the nested document.
|
|
62
|
+
*
|
|
63
|
+
* NOTE: _innerContent is NOT pre-computed here. Document.convert() will call
|
|
64
|
+
* _convertAsciiDocCells() after parse completes (so callouts are rewound and
|
|
65
|
+
* all cross-references from the parent document are already registered).
|
|
66
|
+
* @param {Table.Column} column
|
|
67
|
+
* @param {string} cellText
|
|
68
|
+
* @param {Object} [attributes={}]
|
|
69
|
+
* @param {Object} [opts={}]
|
|
70
|
+
* @returns {Promise<Table.Cell>}
|
|
71
|
+
*/
|
|
72
|
+
static create(column: {
|
|
73
|
+
style: any;
|
|
74
|
+
/** Alias for parent (always a Table). */
|
|
75
|
+
get table(): AbstractNode;
|
|
76
|
+
isBlock(): boolean;
|
|
77
|
+
isInline(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get the parent table of this column.
|
|
80
|
+
* @returns {Table}
|
|
81
|
+
*/
|
|
82
|
+
getTable(): Table;
|
|
83
|
+
document: Document;
|
|
84
|
+
context: string;
|
|
85
|
+
nodeName: string;
|
|
86
|
+
id: string;
|
|
87
|
+
attributes: any;
|
|
88
|
+
passthroughs: any[];
|
|
89
|
+
get parent(): AbstractNode;
|
|
90
|
+
set parent(parent: AbstractNode);
|
|
91
|
+
get role(): string | string[];
|
|
92
|
+
set role(names: string | string[]);
|
|
93
|
+
get roles(): any;
|
|
94
|
+
get converter(): object;
|
|
95
|
+
getAttribute(name: string, defaultValue?: any, fallbackName?: string | boolean | null): any;
|
|
96
|
+
hasAttribute(name: string, expectedValue?: any, fallbackName?: string | boolean | null): boolean;
|
|
97
|
+
setAttribute(name: string, value?: any, overwrite?: boolean): string | boolean | null;
|
|
98
|
+
isAttribute(name: any, expectedValue?: any): boolean;
|
|
99
|
+
removeAttribute(name: string): any;
|
|
100
|
+
hasOption(name: string): boolean;
|
|
101
|
+
setOption(name: string): void;
|
|
102
|
+
enabledOptions(): Set<string>;
|
|
103
|
+
updateAttributes(newAttributes: any): any;
|
|
104
|
+
hasRoleAttribute(expectedValue?: string | null): boolean;
|
|
105
|
+
hasRole(name: string): boolean;
|
|
106
|
+
addRole(name: string): boolean;
|
|
107
|
+
removeRole(name: string): boolean;
|
|
108
|
+
get reftext(): string | null;
|
|
109
|
+
precomputeReftext(): Promise<void>;
|
|
110
|
+
hasReftext(): boolean;
|
|
111
|
+
isReftext(): boolean;
|
|
112
|
+
iconUri(name: string): Promise<string>;
|
|
113
|
+
imageUri(targetImage: string, assetDirKey?: string): Promise<string>;
|
|
114
|
+
mediaUri(target: string, assetDirKey?: string): string;
|
|
115
|
+
generateDataUri(targetImage: string, assetDirKey?: string | null): Promise<string>;
|
|
116
|
+
generateDataUriFromUri(imageUri: string, cacheUri?: boolean): Promise<string>;
|
|
117
|
+
normalizeAssetPath(assetRef: string, assetName?: string, autocorrect?: boolean): string;
|
|
118
|
+
normalizeSystemPath(target: string, start?: string | null, jail?: string | null, opts?: any): string;
|
|
119
|
+
normalizeWebPath(target: string, start?: string | null, preserveUriTarget?: boolean): string;
|
|
120
|
+
readAsset(path: string, opts?: any): Promise<string | null>;
|
|
121
|
+
readContents(target: string, opts?: any): Promise<string | null>;
|
|
122
|
+
isUri(str: string): boolean;
|
|
123
|
+
readonly logger: any;
|
|
124
|
+
getLogger(): object;
|
|
125
|
+
getRole(): string | undefined;
|
|
126
|
+
setRole(...names: (string | string[])[]): string;
|
|
127
|
+
getRoles(): string[];
|
|
128
|
+
getAttributes(): any;
|
|
129
|
+
getDocument(): Document;
|
|
130
|
+
getParent(): AbstractNode | undefined;
|
|
131
|
+
setParent(parent: any): void;
|
|
132
|
+
getNodeName(): string;
|
|
133
|
+
getId(): string | undefined;
|
|
134
|
+
setId(id: string): void;
|
|
135
|
+
getContext(): string;
|
|
136
|
+
getConverter(): object;
|
|
137
|
+
getIconUri(name: string): Promise<string>;
|
|
138
|
+
getMediaUri(target: string, assetDirKey?: string): string;
|
|
139
|
+
getImageUri(targetImage: string, assetDirKey?: string | null): Promise<string>;
|
|
140
|
+
getReftext(): string | undefined;
|
|
141
|
+
}, cellText: string, attributes?: any, opts?: any): Promise<typeof Cell>;
|
|
142
|
+
constructor(column: any, cellText: any, attributes?: {}, opts?: {});
|
|
143
|
+
_cursor: any;
|
|
144
|
+
sourceLocation: any;
|
|
145
|
+
colspan: number;
|
|
146
|
+
rowspan: number;
|
|
147
|
+
style: any;
|
|
148
|
+
/** Alias for parent (always a Column). */
|
|
149
|
+
get column(): AbstractNode;
|
|
150
|
+
/** @returns {Promise<Table.Cell>} */
|
|
151
|
+
reinitialize(hasHeader: any): Promise<typeof Cell>;
|
|
152
|
+
_catalogInlineAnchor(cellText?: any, cursor?: any): void;
|
|
153
|
+
set text(val: string | null);
|
|
154
|
+
/**
|
|
155
|
+
* Get the text with substitutions applied.
|
|
156
|
+
* The result is pre-computed during Document.parse() via precomputeText().
|
|
157
|
+
* Falls back to the raw text if precomputeText() has not been called yet.
|
|
158
|
+
* @returns {string|null}
|
|
159
|
+
*/
|
|
160
|
+
get text(): string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Pre-compute the converted text asynchronously.
|
|
163
|
+
* Called during Document.parse() so the synchronous getter works during conversion.
|
|
164
|
+
* @returns {Promise<void>}
|
|
165
|
+
*/
|
|
166
|
+
precomputeText(): Promise<void>;
|
|
167
|
+
lines(): any;
|
|
168
|
+
source(): any;
|
|
169
|
+
get innerDocument(): any;
|
|
170
|
+
get file(): any;
|
|
171
|
+
get lineno(): any;
|
|
172
|
+
/**
|
|
173
|
+
* Get the text with substitutions applied.
|
|
174
|
+
* @returns {string|null}
|
|
175
|
+
*/
|
|
176
|
+
getText(): string | null;
|
|
177
|
+
/**
|
|
178
|
+
* Set the raw text of this cell.
|
|
179
|
+
* @param {string|null} val
|
|
180
|
+
*/
|
|
181
|
+
setText(val: string | null): void;
|
|
182
|
+
/**
|
|
183
|
+
* Get the inner document for AsciiDoc-style cells.
|
|
184
|
+
* @returns {Document|null}
|
|
185
|
+
*/
|
|
186
|
+
getInnerDocument(): Document | null;
|
|
187
|
+
}
|
|
188
|
+
declare class ParserContext {
|
|
189
|
+
static get FORMATS(): Set<string>;
|
|
190
|
+
static get DELIMITERS(): {
|
|
191
|
+
psv: (string | RegExp)[];
|
|
192
|
+
csv: (string | RegExp)[];
|
|
193
|
+
dsv: (string | RegExp)[];
|
|
194
|
+
tsv: (string | RegExp)[];
|
|
195
|
+
'!sv': (string | RegExp)[];
|
|
196
|
+
};
|
|
197
|
+
constructor(reader: any, table: any, attributes?: {});
|
|
198
|
+
_reader: any;
|
|
199
|
+
_startCursor: any;
|
|
200
|
+
table: any;
|
|
201
|
+
buffer: string;
|
|
202
|
+
format: unknown;
|
|
203
|
+
delimiter: any;
|
|
204
|
+
delimiterRe: any;
|
|
205
|
+
colcount: any;
|
|
206
|
+
_cellspecs: any[];
|
|
207
|
+
_cellOpen: boolean;
|
|
208
|
+
_activeRowspans: number[];
|
|
209
|
+
_columnVisits: number;
|
|
210
|
+
_currentRow: any[];
|
|
211
|
+
_linenum: number;
|
|
212
|
+
startsWith(line: any): any;
|
|
213
|
+
matchDelimiter(line: any): any;
|
|
214
|
+
skipPastDelimiter(pre: any): void;
|
|
215
|
+
skipPastEscapedDelimiter(pre: any): void;
|
|
216
|
+
bufferHasUnclosedQuotesInText(text: any, q?: string): boolean;
|
|
217
|
+
bufferHasUnclosedQuotes(append?: any, q?: string): boolean;
|
|
218
|
+
takeCellspec(): any;
|
|
219
|
+
pushCellspec(cellspec?: {}): void;
|
|
220
|
+
keepCellOpen(): void;
|
|
221
|
+
markCellClosed(): void;
|
|
222
|
+
isCellOpen(): boolean;
|
|
223
|
+
isCellClosed(): boolean;
|
|
224
|
+
closeOpenCell(nextCellspec?: {}): Promise<void>;
|
|
225
|
+
closeCell(eol?: boolean): Promise<void>;
|
|
226
|
+
closeTable(): void;
|
|
227
|
+
_activateRowspan(rowspan: any, colspan: any): void;
|
|
228
|
+
_endOfRow(): 0 | 1 | -1;
|
|
229
|
+
_advance(): void;
|
|
230
|
+
}
|
|
231
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class Timings {
|
|
2
|
+
static create(): Timings;
|
|
3
|
+
_log: {};
|
|
4
|
+
_timers: {};
|
|
5
|
+
start(key: any): void;
|
|
6
|
+
record(key: any): void;
|
|
7
|
+
time(...keys: any[]): any;
|
|
8
|
+
read(): any;
|
|
9
|
+
parse(): any;
|
|
10
|
+
readParse(): any;
|
|
11
|
+
convert(): any;
|
|
12
|
+
readParseConvert(): any;
|
|
13
|
+
write(): any;
|
|
14
|
+
total(): any;
|
|
15
|
+
/**
|
|
16
|
+
* Print a summary report.
|
|
17
|
+
* @param {{ write?: (s: string) => void, log?: (s: string) => void }} [out=console] - Output sink.
|
|
18
|
+
* @param {string|null} [subject=null] - Optional label for the input file.
|
|
19
|
+
*/
|
|
20
|
+
printReport(out?: {
|
|
21
|
+
write?: (s: string) => void;
|
|
22
|
+
log?: (s: string) => void;
|
|
23
|
+
}, subject?: string | null): void;
|
|
24
|
+
_now(): any;
|
|
25
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (C) 2019 Dan Allen, Guillaume Grossetie, Anthonny Quérouil and the Asciidoctor Project
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|