@asciidoctor/core 2.2.4-rc.1 → 2.2.6
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/dist/browser/asciidoctor.js +1405 -1363
- package/dist/browser/asciidoctor.min.js +1467 -1458
- package/dist/css/asciidoctor.css +54 -53
- package/dist/graalvm/asciidoctor.js +1404 -1362
- package/dist/node/asciidoctor.js +1418 -1372
- package/package.json +23 -26
- package/types/index.d.ts +31 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asciidoctor/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "Asciidoctor - the core library",
|
|
5
5
|
"main": "dist/node/asciidoctor.js",
|
|
6
6
|
"browser": "dist/browser/asciidoctor.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"test:graalvm": "node tasks/graalvm.js",
|
|
21
21
|
"test:node": "mocha spec/*/*.spec.js",
|
|
22
22
|
"test:browser": "node spec/browser/run.js",
|
|
23
|
-
"test:types": "rm -f types/tests.js &&
|
|
23
|
+
"test:types": "rm -f types/tests.js && eslint types --ext .ts && tsc --build types/tsconfig.json && node types/tests.js",
|
|
24
24
|
"test": "node tasks/test/unsupported-features.js && npm run test:node && npm run test:browser && npm run test:types",
|
|
25
25
|
"build": "node tasks/build.js && npm run test && npm run lint",
|
|
26
26
|
"build:quick": "node tasks/build.js && npm run test:node && npm run code:lint",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clean:js": "node tasks/clean.js js",
|
|
32
32
|
"dist": "cross-env MINIFY=1 node tasks/dist.js",
|
|
33
33
|
"lint": "npm run code:lint && npm run docs:lint",
|
|
34
|
-
"code:lint": "
|
|
34
|
+
"code:lint": "eslint 'src/**/*.js' 'spec/**/*.js' 'spec/**/*.js' 'tasks/**/*.js' 'benchmark/**/*.js'",
|
|
35
35
|
"package": "cross-env MINIFY=1 COPY_DIST=1 node tasks/build.js && cross-env MINIFY=1 npm run test",
|
|
36
36
|
"examples": "node tasks/examples.js",
|
|
37
37
|
"server": "node tasks/server.js",
|
|
@@ -71,36 +71,33 @@
|
|
|
71
71
|
"unxhr": "1.0.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@types/node": "
|
|
75
|
-
"@types/nunjucks": "
|
|
74
|
+
"@types/node": "17.0.10",
|
|
75
|
+
"@types/nunjucks": "3.2.1",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "5.9.1",
|
|
77
|
+
"@typescript-eslint/parser": "5.9.1",
|
|
76
78
|
"bestikk-download": "1.0.0",
|
|
77
79
|
"bestikk-fs": "1.0.0",
|
|
78
80
|
"bestikk-log": "0.1.0",
|
|
79
81
|
"bestikk-uglify": "3.0.0",
|
|
80
|
-
"chai": "4.
|
|
81
|
-
"cross-env": "
|
|
82
|
+
"chai": "4.3.4",
|
|
83
|
+
"cross-env": "7.0.3",
|
|
82
84
|
"dirty-chai": "2.0.1",
|
|
83
|
-
"documentation": "
|
|
84
|
-
"dot": "
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"eslint": "
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
85
|
+
"documentation": "13.2.5",
|
|
86
|
+
"dot": "1.1.3",
|
|
87
|
+
"ejs": "3.1.6",
|
|
88
|
+
"eslint": "8.7.0",
|
|
89
|
+
"eslint-config-standard": "^16.0.3",
|
|
90
|
+
"eslint-plugin-import": "^2.25.4",
|
|
91
|
+
"handlebars": "4.7.7",
|
|
92
|
+
"http-server": "14.1.0",
|
|
93
|
+
"mocha": "9.1.4",
|
|
91
94
|
"module-alias": "2.2.2",
|
|
92
|
-
"nunjucks": "
|
|
95
|
+
"nunjucks": "3.2.3",
|
|
93
96
|
"opal-compiler": "1.0.13",
|
|
94
|
-
"pug": "
|
|
95
|
-
"puppeteer": "
|
|
96
|
-
"sinon": "
|
|
97
|
-
"
|
|
98
|
-
"typescript": "^4.1.2"
|
|
99
|
-
},
|
|
100
|
-
"standard": {
|
|
101
|
-
"ignore": [
|
|
102
|
-
"src/template-*.js"
|
|
103
|
-
]
|
|
97
|
+
"pug": "3.0.2",
|
|
98
|
+
"puppeteer": "13.1.1",
|
|
99
|
+
"sinon": "12.0.1",
|
|
100
|
+
"typescript": "4.5.4"
|
|
104
101
|
},
|
|
105
102
|
"_moduleAliases": {
|
|
106
103
|
"@asciidoctor/core": "build/asciidoctor-node.js"
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
// TypeScript Version:
|
|
2
|
+
// TypeScript Version: 3.7
|
|
3
3
|
export namespace Asciidoctor {
|
|
4
4
|
import Author = Document.Author;
|
|
5
5
|
import Title = Document.Title;
|
|
@@ -439,7 +439,7 @@ export namespace Asciidoctor {
|
|
|
439
439
|
* @param to - an optional output (by default stdout)
|
|
440
440
|
* @param subject - an optional subject (usually the file name)
|
|
441
441
|
*/
|
|
442
|
-
printReport(to
|
|
442
|
+
printReport(to?: Writer | BasicLogger | RubyLogger, subject?: string): void;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
namespace Document {
|
|
@@ -1958,7 +1958,7 @@ export namespace Asciidoctor {
|
|
|
1958
1958
|
/**
|
|
1959
1959
|
* Get the {Converter} instance being used to convert the current {Document}.
|
|
1960
1960
|
*/
|
|
1961
|
-
getConverter():
|
|
1961
|
+
getConverter(): AbstractConverter;
|
|
1962
1962
|
|
|
1963
1963
|
/**
|
|
1964
1964
|
* Get the activated {Extensions.Registry} associated with this document.
|
|
@@ -2006,7 +2006,7 @@ export namespace Asciidoctor {
|
|
|
2006
2006
|
*
|
|
2007
2007
|
* If a caption has already been assigned to this block, do nothing.
|
|
2008
2008
|
*
|
|
2009
|
-
* The parts of a complete caption are:
|
|
2009
|
+
* The parts of a complete caption are: `<prefix> <number>. <title>`
|
|
2010
2010
|
* This partial caption represents the part the precedes the title.
|
|
2011
2011
|
*
|
|
2012
2012
|
* @param value - the String caption to assign to this block or nil to use document attribute.
|
|
@@ -2272,7 +2272,7 @@ export namespace Asciidoctor {
|
|
|
2272
2272
|
* Create a new Inline element.
|
|
2273
2273
|
* @returns a new Inline element
|
|
2274
2274
|
*/
|
|
2275
|
-
static create(parent: AbstractBlock, context: string, text?: string, opts?:
|
|
2275
|
+
static create(parent: AbstractBlock, context: string, text?: string, opts?: Record<string, unknown>): Inline;
|
|
2276
2276
|
|
|
2277
2277
|
/**
|
|
2278
2278
|
* Get the converted content for this inline node.
|
|
@@ -2670,21 +2670,21 @@ export namespace Asciidoctor {
|
|
|
2670
2670
|
*
|
|
2671
2671
|
* @returns An Array of Strings representing the substitution operation or nothing if no subs are found.
|
|
2672
2672
|
*/
|
|
2673
|
-
resolveSubstitutions(subs: string, type?: string, defaults?: string[], subject?: string): string[] |
|
|
2673
|
+
resolveSubstitutions(subs: string, type?: string, defaults?: string[], subject?: string): string[] | undefined;
|
|
2674
2674
|
|
|
2675
2675
|
/**
|
|
2676
2676
|
* Call {@link AbstractNode#resolveSubstitutions} for the 'block' type.
|
|
2677
2677
|
*
|
|
2678
2678
|
* @see {@link AbstractNode#resolveSubstitutions}
|
|
2679
2679
|
*/
|
|
2680
|
-
resolveBlockSubstitutions(subs: string, defaults?: string[], subject?: string): string[] |
|
|
2680
|
+
resolveBlockSubstitutions(subs: string, defaults?: string[], subject?: string): string[] | undefined;
|
|
2681
2681
|
|
|
2682
2682
|
/**
|
|
2683
2683
|
* Call {@link AbstractNode#resolveSubstitutions} for the 'inline' type with the subject set as passthrough macro.
|
|
2684
2684
|
*
|
|
2685
2685
|
* @see {@link AbstractNode#resolveSubstitutions}
|
|
2686
2686
|
*/
|
|
2687
|
-
resolvePassSubstitutions(subs: string): string[] |
|
|
2687
|
+
resolvePassSubstitutions(subs: string): string[] | undefined;
|
|
2688
2688
|
|
|
2689
2689
|
/**
|
|
2690
2690
|
* Apply the specified substitutions to the text.
|
|
@@ -2744,7 +2744,7 @@ export namespace Asciidoctor {
|
|
|
2744
2744
|
*
|
|
2745
2745
|
* @returns a Boolean indicating whether the attribute exists and, if a truthy comparison value is specified, whether the value of the attribute matches the comparison value.
|
|
2746
2746
|
*/
|
|
2747
|
-
isAttribute(name: string, expectedValue?: any, fallbackName?: string):
|
|
2747
|
+
isAttribute(name: string, expectedValue?: any, fallbackName?: string): boolean;
|
|
2748
2748
|
|
|
2749
2749
|
/**
|
|
2750
2750
|
* Assign the value to the attribute name for the current node.
|
|
@@ -3053,7 +3053,26 @@ export namespace Asciidoctor {
|
|
|
3053
3053
|
function create(): Html5Converter;
|
|
3054
3054
|
}
|
|
3055
3055
|
|
|
3056
|
-
|
|
3056
|
+
interface AbstractConverter {
|
|
3057
|
+
/**
|
|
3058
|
+
* Converts an {AbstractNode} using the given transform.
|
|
3059
|
+
* This method must be implemented by a concrete converter class.
|
|
3060
|
+
*
|
|
3061
|
+
* @param node - The concrete instance of AbstractNode to convert.
|
|
3062
|
+
* @param [transform] - An optional String transform that hints at which transformation should be applied to this node.
|
|
3063
|
+
* If a transform is not given, the transform is often derived from the value of the {AbstractNode#getNodeName} property. (optional, default: undefined)
|
|
3064
|
+
* @param [opts]- An optional JSON of options hints about how to convert the node. (optional, default: undefined)
|
|
3065
|
+
*
|
|
3066
|
+
* @returns the {String} result.
|
|
3067
|
+
*/
|
|
3068
|
+
convert(node: AbstractNode, transform?: string, opts?: unknown): string;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
interface ConverterConstructor {
|
|
3072
|
+
new(backend?: string, opts?: unknown): AbstractConverter;
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
class Converter implements AbstractConverter {
|
|
3057
3076
|
/**
|
|
3058
3077
|
* Converts an {AbstractNode} using the given transform.
|
|
3059
3078
|
* This method must be implemented by a concrete converter class.
|
|
@@ -3082,7 +3101,7 @@ export namespace Asciidoctor {
|
|
|
3082
3101
|
* @param opts - a JSON of options to pass to the converter (default: {})
|
|
3083
3102
|
* @returns a {Converter} instance for converting nodes in an Asciidoctor AST.
|
|
3084
3103
|
*/
|
|
3085
|
-
function create(backend: string, opts?:
|
|
3104
|
+
function create(backend: string, opts?: unknown): Converter;
|
|
3086
3105
|
}
|
|
3087
3106
|
|
|
3088
3107
|
/**
|
|
@@ -3100,7 +3119,7 @@ export namespace Asciidoctor {
|
|
|
3100
3119
|
* @param converter - The {Converter} instance to register
|
|
3101
3120
|
* @param backends- A {string} {Array} of backend names that this converter should be registered to handle (optional, default: ['*'])
|
|
3102
3121
|
*/
|
|
3103
|
-
register(converter:
|
|
3122
|
+
register(converter: AbstractConverter | ConverterConstructor, backends?: string[]): void;
|
|
3104
3123
|
|
|
3105
3124
|
/**
|
|
3106
3125
|
* Retrieves the singleton instance of the converter factory.
|