@antora/document-converter 3.0.0-alpha.7 → 3.0.0-beta.2

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
@@ -3,7 +3,7 @@
3
3
  The Document Converter is a component in Antora responsible for converting AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline.
4
4
 
5
5
  [Antora](https://antora.org) is a modular static site generator designed for creating documentation sites from AsciiDoc documents.
6
- Its site generator pipeline aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
6
+ Its site generator aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
7
7
 
8
8
  ## Copyright and License
9
9
 
@@ -1,6 +1,9 @@
1
1
  'use strict'
2
2
 
3
- const { loadAsciiDoc, extractAsciiDocMetadata } = require('@antora/asciidoc-loader')
3
+ const {
4
+ loadAsciiDoc: _loadAsciiDoc,
5
+ extractAsciiDocMetadata: _extractAsciiDocMetadata,
6
+ } = require('@antora/asciidoc-loader')
4
7
 
5
8
  /**
6
9
  * Converts the contents on the specified file from AsciiDoc to embedded HTML.
@@ -24,6 +27,9 @@ const { loadAsciiDoc, extractAsciiDocMetadata } = require('@antora/asciidoc-load
24
27
  * @returns {File} The virtual file that was converted.
25
28
  */
26
29
  function convertDocument (file, contentCatalog = undefined, asciidocConfig = {}) {
30
+ const { extractAsciiDocMetadata = _extractAsciiDocMetadata, loadAsciiDoc = _loadAsciiDoc } = this
31
+ ? this.getFunctions(false)
32
+ : {}
27
33
  const doc = loadAsciiDoc(file, contentCatalog, asciidocConfig)
28
34
  if (!file.asciidoc) {
29
35
  file.asciidoc = extractAsciiDocMetadata(doc)
@@ -1,7 +1,10 @@
1
1
  'use strict'
2
2
 
3
- const convertDocument = require('./convert-document')
4
- const { loadAsciiDoc, extractAsciiDocMetadata } = require('@antora/asciidoc-loader')
3
+ const _convertDocument = require('./convert-document')
4
+ const {
5
+ loadAsciiDoc: _loadAsciiDoc,
6
+ extractAsciiDocMetadata: _extractAsciiDocMetadata,
7
+ } = require('@antora/asciidoc-loader')
5
8
 
6
9
  /**
7
10
  * Converts the contents of publishable pages with the media type text/asciidoc
@@ -26,6 +29,11 @@ const { loadAsciiDoc, extractAsciiDocMetadata } = require('@antora/asciidoc-load
26
29
  * @returns {Array<File>} The publishable virtual files in the page family taken from the content catalog.
27
30
  */
28
31
  function convertDocuments (contentCatalog, siteAsciiDocConfig = {}) {
32
+ const {
33
+ convertDocument = _convertDocument,
34
+ extractAsciiDocMetadata = _extractAsciiDocMetadata,
35
+ loadAsciiDoc = _loadAsciiDoc,
36
+ } = this ? this.getFunctions(false) : {}
29
37
  const mainAsciiDocConfigs = new Map()
30
38
  contentCatalog.getComponents().forEach(({ name: component, versions }) => {
31
39
  versions.forEach(({ version, asciidoc }) => {
@@ -74,4 +82,4 @@ function registerPageAliases (aliases, targetFile, contentCatalog) {
74
82
  .forEach((spec) => (spec = spec.trim()) && contentCatalog.registerPageAlias(spec, targetFile))
75
83
  }
76
84
 
77
- module.exports = Object.assign(convertDocuments, { convertDocuments, convertDocument })
85
+ module.exports = Object.assign(convertDocuments, { convertDocuments, convertDocument: _convertDocument })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/document-converter",
3
- "version": "3.0.0-alpha.7",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Converts AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "main": "lib/index.js",
19
19
  "dependencies": {
20
- "@antora/asciidoc-loader": "3.0.0-alpha.7"
20
+ "@antora/asciidoc-loader": "3.0.0-beta.2"
21
21
  },
22
22
  "engines": {
23
- "node": ">=10.17.0"
23
+ "node": ">=12.21.0"
24
24
  },
25
25
  "files": [
26
26
  "lib/"
@@ -35,5 +35,5 @@
35
35
  "static site",
36
36
  "web publishing"
37
37
  ],
38
- "gitHead": "fbd597b3680474f2083cda8a7facf1e2848c08e0"
38
+ "gitHead": "5cd3f9cc70622e465cb44daf1aa2035ed5a35f54"
39
39
  }