@asciidoctor/core 4.0.0-alpha.2 → 4.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browser/index.js +649 -131
- package/build/node/index.cjs +652 -131
- package/package.json +3 -2
- package/src/abstract_node.js +8 -13
- package/src/attribute_entry.js +17 -1
- package/src/browser/reader.js +2 -2
- package/src/browser.js +21 -0
- package/src/convert.js +10 -3
- package/src/converter/html5.js +8 -27
- package/src/converter/template.js +1 -1
- package/src/document.js +19 -9
- package/src/extensions.js +266 -8
- package/src/helpers.js +20 -2
- package/src/http_cache.js +139 -0
- package/src/index.js +16 -0
- package/src/load.js +30 -13
- package/src/logging.js +65 -5
- package/src/parser.js +1 -1
- package/src/path_resolver.js +20 -15
- package/src/reader.js +3 -2
- package/src/stylesheets.js +15 -0
- package/types/abstract_node.d.ts +1 -2
- package/types/attribute_entry.d.ts +8 -0
- package/types/browser/reader.d.ts +1 -1
- package/types/extensions.d.ts +203 -9
- package/types/http_cache.d.ts +59 -0
- package/types/index.d.cts +12 -1
- package/types/index.d.ts +12 -1
- package/types/logging.d.ts +15 -4
- package/types/path_resolver.d.ts +0 -5
- package/types/stylesheets.d.ts +1 -0
- package/types/table.d.ts +1 -1
package/types/index.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ export function load(input: string | string[] | Buffer, options?: any): Promise<
|
|
|
26
26
|
* @returns {Promise<Document>} - the parsed Document
|
|
27
27
|
*/
|
|
28
28
|
export function loadFile(filename: string, options?: any): Promise<Document>;
|
|
29
|
+
export type ProcessorDslInterface = import("./extensions.js").ProcessorDslInterface;
|
|
30
|
+
export type DocumentProcessorDslInterface = import("./extensions.js").DocumentProcessorDslInterface;
|
|
31
|
+
export type SyntaxProcessorDslInterface = import("./extensions.js").SyntaxProcessorDslInterface;
|
|
32
|
+
export type IncludeProcessorDslInterface = import("./extensions.js").IncludeProcessorDslInterface;
|
|
33
|
+
export type DocinfoProcessorDslInterface = import("./extensions.js").DocinfoProcessorDslInterface;
|
|
34
|
+
export type BlockProcessorDslInterface = import("./extensions.js").BlockProcessorDslInterface;
|
|
35
|
+
export type MacroProcessorDslInterface = import("./extensions.js").MacroProcessorDslInterface;
|
|
36
|
+
export type InlineMacroProcessorDslInterface = import("./extensions.js").InlineMacroProcessorDslInterface;
|
|
29
37
|
import { Document } from './document.js';
|
|
30
38
|
import { convert } from './convert.js';
|
|
31
39
|
import { convertFile } from './convert.js';
|
|
@@ -47,6 +55,9 @@ import { SyntaxHighlighterBase } from './syntax_highlighter.js';
|
|
|
47
55
|
import { LoggerManager } from './logging.js';
|
|
48
56
|
import { MemoryLogger } from './logging.js';
|
|
49
57
|
import { NullLogger } from './logging.js';
|
|
58
|
+
import { HttpCache } from './http_cache.js';
|
|
59
|
+
import { MemoryHttpCache } from './http_cache.js';
|
|
60
|
+
import { HttpCacheManager } from './http_cache.js';
|
|
50
61
|
import { SafeMode } from './constants.js';
|
|
51
62
|
import { ContentModel } from './constants.js';
|
|
52
63
|
import { Timings } from './timings.js';
|
|
@@ -71,4 +82,4 @@ import { deriveBackendTraits } from './converter.js';
|
|
|
71
82
|
import { DefaultFactory as DefaultSyntaxHighlighterFactory } from './syntax_highlighter.js';
|
|
72
83
|
import Html5Converter from './converter/html5.js';
|
|
73
84
|
import { SyntaxHighlighter } from './syntax_highlighter.js';
|
|
74
|
-
export { convert, convertFile, Document, DocumentTitle, Author, Footnote, ImageReference, RevisionInfo, Logger, AbstractNode, AbstractBlock, Inline, Block, List, ListItem, Section, Reader, SyntaxHighlighterBase, LoggerManager, MemoryLogger, NullLogger, SafeMode, ContentModel, Timings, Registry, Processor, ProcessorExtension, Preprocessor, TreeProcessor, Postprocessor, IncludeProcessor, DocinfoProcessor, BlockProcessor, InlineMacroProcessor, BlockMacroProcessor, Extensions, Cursor, Converter as ConverterFactory, ConverterBase, CustomFactory as ConverterCustomFactory, DefaultConverterFactory, deriveBackendTraits, DefaultSyntaxHighlighterFactory, Html5Converter, SyntaxHighlighter };
|
|
85
|
+
export { convert, convertFile, Document, DocumentTitle, Author, Footnote, ImageReference, RevisionInfo, Logger, AbstractNode, AbstractBlock, Inline, Block, List, ListItem, Section, Reader, SyntaxHighlighterBase, LoggerManager, MemoryLogger, NullLogger, HttpCache, MemoryHttpCache, HttpCacheManager, SafeMode, ContentModel, Timings, Registry, Processor, ProcessorExtension, Preprocessor, TreeProcessor, Postprocessor, IncludeProcessor, DocinfoProcessor, BlockProcessor, InlineMacroProcessor, BlockMacroProcessor, Extensions, Cursor, Converter as ConverterFactory, ConverterBase, CustomFactory as ConverterCustomFactory, DefaultConverterFactory, deriveBackendTraits, DefaultSyntaxHighlighterFactory, Html5Converter, SyntaxHighlighter };
|
package/types/logging.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Run fn() within an async-local logger context so that all log calls via
|
|
4
|
+
* `this.logger` (from applyLogging) automatically route to the provided logger
|
|
5
|
+
* for the duration of the async execution chain.
|
|
6
|
+
*
|
|
7
|
+
* Falls back to global mutation in environments without node:async_hooks (e.g. browsers).
|
|
8
|
+
*
|
|
9
|
+
* @param {Logger|MemoryLogger|NullLogger} logger - The logger to activate.
|
|
10
|
+
* @param {() => any} fn - The function to execute within the logger context.
|
|
11
|
+
* @returns {Promise<any>}
|
|
12
|
+
*/
|
|
13
|
+
export function withLogger(logger: Logger | MemoryLogger | NullLogger, fn: () => any): Promise<any>;
|
|
1
14
|
/**
|
|
2
15
|
* Apply the Logging mixin to a class prototype.
|
|
3
16
|
*
|
|
@@ -120,12 +133,10 @@ export class MemoryLogger {
|
|
|
120
133
|
empty(): boolean;
|
|
121
134
|
}
|
|
122
135
|
/** Logger that discards all messages but still tracks the maximum severity. */
|
|
123
|
-
export class NullLogger {
|
|
136
|
+
export class NullLogger extends Logger {
|
|
124
137
|
static create(): NullLogger;
|
|
138
|
+
constructor();
|
|
125
139
|
level: number;
|
|
126
|
-
_maxSeverity: number;
|
|
127
|
-
get maxSeverity(): number;
|
|
128
|
-
getMaxSeverity(): number;
|
|
129
140
|
add(severity: any): boolean;
|
|
130
141
|
log(severity: any): boolean;
|
|
131
142
|
debug(): boolean;
|
package/types/path_resolver.d.ts
CHANGED
|
@@ -54,11 +54,6 @@ export class PathResolver {
|
|
|
54
54
|
* @returns {string} The posixified path.
|
|
55
55
|
*/
|
|
56
56
|
posixify(path: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* @param {string} path
|
|
59
|
-
* @returns {string}
|
|
60
|
-
*/
|
|
61
|
-
posixfy(path: string): string;
|
|
62
57
|
/**
|
|
63
58
|
* Expand the path by resolving parent references (..) and removing self references (.).
|
|
64
59
|
* @param {string} path
|
package/types/stylesheets.d.ts
CHANGED
package/types/table.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ declare class Cell extends AbstractBlock<string | string[]> {
|
|
|
113
113
|
imageUri(targetImage: string, assetDirKey?: string): Promise<string>;
|
|
114
114
|
mediaUri(target: string, assetDirKey?: string): string;
|
|
115
115
|
generateDataUri(targetImage: string, assetDirKey?: string | null): Promise<string>;
|
|
116
|
-
generateDataUriFromUri(imageUri: string
|
|
116
|
+
generateDataUriFromUri(imageUri: string): Promise<string>;
|
|
117
117
|
normalizeAssetPath(assetRef: string, assetName?: string, autocorrect?: boolean): string;
|
|
118
118
|
normalizeSystemPath(target: string, start?: string | null, jail?: string | null, opts?: any): string;
|
|
119
119
|
normalizeWebPath(target: string, start?: string | null, preserveUriTarget?: boolean): string;
|