@antora/document-converter
Advanced tools
Comparing version 2.2.0 to 2.3.0-alpha.1
@@ -16,11 +16,22 @@ 'use strict' | ||
* @param {ContentCatalog} contentCatalog - The catalog of all virtual content files in the site. | ||
* @param {Object} [asciidocConfig={}] - AsciiDoc processor configuration options. | ||
* @param {Object} [siteAsciiDocConfig={}] - Site-wide AsciiDoc processor configuration options. | ||
* | ||
* @returns {Array<File>} The virtual files in the page family taken from the content catalog. | ||
*/ | ||
function convertDocuments (contentCatalog, asciidocConfig = {}) { | ||
function convertDocuments (contentCatalog, siteAsciiDocConfig = {}) { | ||
const asciidocConfigs = new Map( | ||
contentCatalog.getComponents().reduce((accum, { name, versions }) => { | ||
return accum.concat(versions.map(({ version, asciidocConfig }) => [name + '@' + version, asciidocConfig])) | ||
}, []) | ||
) | ||
return contentCatalog | ||
.findBy({ family: 'page' }) | ||
.filter((page) => page.out) | ||
.map((page) => (page.mediaType === 'text/asciidoc' ? convertDocument(page, contentCatalog, asciidocConfig) : page)) | ||
.map((page) => { | ||
if (page.mediaType === 'text/asciidoc') { | ||
const asciidocConfig = asciidocConfigs.get(page.src.component + '@' + page.src.version) || siteAsciiDocConfig | ||
return convertDocument(page, contentCatalog, asciidocConfig) | ||
} | ||
return page | ||
}) | ||
.map((page) => delete page.src.contents && page) | ||
@@ -27,0 +38,0 @@ } |
{ | ||
"name": "@antora/document-converter", | ||
"version": "2.2.0", | ||
"version": "2.3.0-alpha.1", | ||
"description": "Converts AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline.", | ||
@@ -20,3 +20,3 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/asciidoc-loader": "2.2.0" | ||
"@antora/asciidoc-loader": "2.3.0-alpha.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5739
89
1
+ Added@antora/asciidoc-loader@2.3.0-alpha.1(transitive)
- Removed@antora/asciidoc-loader@2.2.0(transitive)