@antora/document-converter
Advanced tools
Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -5,2 +5,4 @@ 'use strict' | ||
const CommaDelimiterRx = /\s*,\s*/ | ||
/** | ||
@@ -10,3 +12,3 @@ * Converts the contents on the specified file from AsciiDoc to embeddable HTML. | ||
* Delegates to the AsciiDoc Loader to load the AsciiDoc contents on the | ||
* specified virtual file to a Document object. It then graps the document | ||
* specified virtual file to a Document object. It grabs the document | ||
* attributes from that Document and assigns them to the asciidoc.attributes | ||
@@ -30,2 +32,3 @@ * property on the file. It then converts the Document to embeddable HTML, | ||
const attributes = doc.getAttributes() | ||
registerAliases(attributes['page-aliases'], file, contentCatalog) | ||
// Q: should we backup the AsciiDoc contents for all pages? what's the impact? | ||
@@ -39,2 +42,9 @@ if ('page-partial' in attributes) file.src.contents = file.contents | ||
function registerAliases (aliases, targetFile, contentCatalog) { | ||
if (!aliases) return | ||
aliases | ||
.split(CommaDelimiterRx) | ||
.forEach((aliasSpec) => aliasSpec && contentCatalog.registerPageAlias(aliasSpec, targetFile)) | ||
} | ||
module.exports = convertDocument |
@@ -10,3 +10,3 @@ 'use strict' | ||
* those files to embeddable HTML by delegating to the convertDocument function. The function then | ||
* returns all the files in the page family. All the files returns from this function are expected | ||
* returns all the files in the page family. All the files returned from this function are expected | ||
* be composed (i.e., wrapped in an HTML layout) by the page composer. | ||
@@ -13,0 +13,0 @@ * |
{ | ||
"name": "@antora/document-converter", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"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": "1.0.0-alpha.8" | ||
"@antora/asciidoc-loader": "1.0.0-alpha.9" | ||
}, | ||
@@ -23,0 +23,0 @@ "engines": { |
# Antora Document Converter | ||
The document converter is a component in Antora responsible for converting AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline. | ||
The Document Converter is a component in Antora responsible for converting AsciiDoc documents to embeddable HTML for use in an Antora documentation pipeline. | ||
@@ -5,0 +5,0 @@ [Antora](https://antora.org) is a modular static site generator designed for creating documentation sites from AsciiDoc documents. |
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
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
5165
75
+ Added@antora/asciidoc-loader@1.0.0-alpha.9(transitive)
- Removed@antora/asciidoc-loader@1.0.0-alpha.8(transitive)