asciidoctor 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/README.md CHANGED
@@ -47,13 +47,13 @@ In the spirit of [free software](https://www.gnu.org/philosophy/free-sw.html), _
47
47
  If you discover errors or omissions in the source code, documentation, or website content, please don't hesitate to submit an issue or open a pull request with a fix.
48
48
  New contributors are always welcome!
49
49
 
50
- The [Contributing](https://github.com/asciidoctor/asciidoctor.js/blob/master/CONTRIBUTING.adoc) guide provides information on how to contribute.
50
+ The [Contributing](https://github.com/asciidoctor/asciidoctor.js/blob/main/CONTRIBUTING.adoc) guide provides information on how to contribute.
51
51
 
52
- If you want to write code, the [Contributing Code](https://github.com/asciidoctor/asciidoctor.js/blob/master/CONTRIBUTING-CODE.adoc) guide will help you to get started quickly.
52
+ If you want to write code, the [Contributing Code](https://github.com/asciidoctor/asciidoctor.js/blob/main/CONTRIBUTING-CODE.adoc) guide will help you to get started quickly.
53
53
 
54
54
  ## Copyright
55
55
 
56
56
  Copyright (C) 2019 Dan Allen, Guillaume Grossetie, Anthonny Quérouil and the Asciidoctor Project.
57
57
  Free use of this software is granted under the terms of the MIT License.
58
58
 
59
- See the [LICENSE](https://github.com/asciidoctor/asciidoctor.js/blob/master/LICENSE) file for details.
59
+ See the [LICENSE](https://github.com/asciidoctor/asciidoctor.js/blob/main/LICENSE) file for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciidoctor",
3
- "version": "2.2.4-rc.1",
3
+ "version": "2.2.6",
4
4
  "description": "A JavaScript AsciiDoc processor, cross-compiled from the Ruby-based AsciiDoc implementation, Asciidoctor, using Opal",
5
5
  "main": "index.js",
6
6
  "types": "types",
@@ -46,10 +46,10 @@
46
46
  },
47
47
  "homepage": "https://github.com/asciidoctor/asciidoctor.js",
48
48
  "dependencies": {
49
- "@asciidoctor/cli": "3.4.0",
50
- "@asciidoctor/core": "2.2.4-rc.1"
49
+ "@asciidoctor/cli": "3.5.0",
50
+ "@asciidoctor/core": "2.2.6"
51
51
  },
52
52
  "devDependencies": {
53
- "pkg": "^4.4.7"
53
+ "pkg": "5.2.1"
54
54
  }
55
55
  }
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- // TypeScript Version: 2.9
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: undefined | Writer | BasicLogger | RubyLogger, subject: string): void;
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(): object;
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: <prefix> <number>. <title>
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?: any): Inline;
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[] | void;
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[] | void;
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[] | void;
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): void;
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
- class Converter {
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?: any): Converter;
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: any, backends?: string[]): void;
3122
+ register(converter: AbstractConverter | ConverterConstructor, backends?: string[]): void;
3104
3123
 
3105
3124
  /**
3106
3125
  * Retrieves the singleton instance of the converter factory.