@antora/asciidoc-loader
Advanced tools
Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -6,3 +6,3 @@ 'use strict' | ||
* | ||
* Uses Asciidoctor.js to loads AsciiDoc content in a way that integrates with | ||
* Uses Asciidoctor.js to load AsciiDoc content in a way that integrates with | ||
* the Antora environment. In particular, it resolves include files and page | ||
@@ -9,0 +9,0 @@ * references from Antora's virtual content catalog. |
'use strict' | ||
const computeRelativeUrlPath = require('../util/compute-relative-url-path') | ||
const resolvePage = require('./resolve-page') | ||
const splitOnce = require('../util/split-once') | ||
@@ -20,11 +19,11 @@ | ||
* @param {File} currentPage - The virtual file for the current page. | ||
* @param {ContentCatalog} catalog - The content catalog that contains the virtual files in the site. | ||
* @param {ContentCatalog} contentCatalog - The content catalog that contains the virtual files in the site. | ||
* @param {Boolean} [relativize=true] - Compute the target relative to the current page. | ||
* @returns {Object} A map ({ content, target }) with the resolved content and target to make an HTML link. | ||
*/ | ||
function convertPageRef (refSpec, content, currentPage, catalog, relativize = true) { | ||
function convertPageRef (refSpec, content, currentPage, contentCatalog, relativize = true) { | ||
let targetPage | ||
const [pageIdSpec, fragment] = splitOnce(refSpec, '#') | ||
try { | ||
if (!(targetPage = resolvePage(pageIdSpec, catalog, currentPage.src))) { | ||
if (!(targetPage = contentCatalog.resolvePage(pageIdSpec, currentPage.src))) { | ||
// TODO log "Unresolved page ID" | ||
@@ -31,0 +30,0 @@ return { content: `${pageIdSpec}.adoc${fragment ? '#' + fragment : ''}`, target: '#' } |
{ | ||
"name": "@antora/asciidoc-loader", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"description": "Loads AsciiDoc content into an Asciidoctor Document object (AST) for use in an Antora documentation pipeline.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
# Antora AsciiDoc Loader | ||
The AsciiDoc loader is a reusable library for handling AsciiDoc content in Antora. | ||
The AsciiDoc Loader is a reusable library for handling AsciiDoc content in Antora. | ||
It loads AsciiDoc content into an AsciiDoc Document object (AST) for use in an Antora documentation pipeline. | ||
The AsciiDoc loader wraps [Asciidoctor.js](https://asciidoctor.org/docs/asciidoctor.js/), adding several extensions that enable AsciiDoc to work in an Antora environment. | ||
The AsciiDoc loader wraps [Asciidoctor.js](https://asciidoctor.org/docs/asciidoctor.js/) and adds several extensions that enable AsciiDoc to work in an Antora environment. | ||
These extensions include: | ||
@@ -8,0 +8,0 @@ |
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
22534
13
501