@antora/assembler 1.0.0-beta.7 → 1.0.0-beta.9
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/lib/assemble-content.js
CHANGED
|
@@ -65,7 +65,7 @@ async function assembleContent (playbook, contentCatalog, converter, { configSou
|
|
|
65
65
|
createResolveAssemblyModel(context, contentCatalog, assemblyConfig, intrinsicAttributes, navigationCatalog)
|
|
66
66
|
)
|
|
67
67
|
if (!(assemblyFiles.length && typeof convert === 'function')) return assemblyFiles
|
|
68
|
-
if (typeof getDefaultCommand === 'function') {
|
|
68
|
+
if (buildConfig.command == null && typeof getDefaultCommand === 'function') {
|
|
69
69
|
buildConfig.command = await getDefaultCommand(buildConfig.cwd)
|
|
70
70
|
}
|
|
71
71
|
const { publishSite: publishFiles = require('@antora/site-publisher') } = generatorFunctions
|
package/lib/configure.js
CHANGED
|
@@ -6,7 +6,8 @@ function configure (context, ...args) {
|
|
|
6
6
|
|
|
7
7
|
function internalConfigure (converter, config = {}, providers = {}) {
|
|
8
8
|
this.once('componentsRegistered', ({ contentCatalog, assemblerProfiles }) => {
|
|
9
|
-
|
|
9
|
+
if (assemblerProfiles) return
|
|
10
|
+
this.updateVariables({ assemblerProfiles: getAssemblerProfiles(contentCatalog) })
|
|
10
11
|
})
|
|
11
12
|
|
|
12
13
|
this.once('beforeProcess', ({ siteAsciiDocConfig }) => {
|
|
@@ -64,14 +65,10 @@ function getAssemblerProfiles (contentCatalog, assemblerProfiles = new Map()) {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
function getAssemblerConfigFromDescriptor (descriptor = {}) {
|
|
67
|
-
|
|
68
|
+
const assemblerConfig = descriptor.ext?.assembler
|
|
68
69
|
if (!assemblerConfig) return
|
|
69
|
-
if (Array.isArray(assemblerConfig))
|
|
70
|
-
|
|
71
|
-
} else {
|
|
72
|
-
assemblerConfig = [assemblerConfig]
|
|
73
|
-
}
|
|
74
|
-
return assemblerConfig
|
|
70
|
+
if (!Array.isArray(assemblerConfig)) return [assemblerConfig]
|
|
71
|
+
if (assemblerConfig.length) return assemblerConfig
|
|
75
72
|
}
|
|
76
73
|
|
|
77
74
|
function initNavFile (file, component, version, index) {
|
|
@@ -400,12 +400,8 @@ function mergeAsciiDoc (
|
|
|
400
400
|
} else {
|
|
401
401
|
fragment = target
|
|
402
402
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return text && ~text.indexOf('=')
|
|
406
|
-
? `xref:${idPrefix}${fragment}[${text}]`
|
|
407
|
-
: `<<${idPrefix}${fragment}${text ? ',' + text.replace(/\\]/g, ']') : ''}>>`
|
|
408
|
-
}
|
|
403
|
+
// Q: should we validate the internal ID here?
|
|
404
|
+
if (!relativePart) return `xref:${idPrefix}${fragment}[${text}]`
|
|
409
405
|
if (~dollarIdx) {
|
|
410
406
|
if (relativePart.slice(dollarIdx).startsWith('$./')) {
|
|
411
407
|
relativePart = relativePart.slice(0, dollarIdx + 1) + topicPrefix + relativePart.slice(dollarIdx + 3)
|
|
@@ -444,6 +440,7 @@ function mergeAsciiDoc (
|
|
|
444
440
|
}
|
|
445
441
|
if (targetModule !== 'ROOT') relativePart = `${targetModule}${idCoordinateSeparator}${relativePart}`
|
|
446
442
|
relativePart = relativePart.replace(/\.adoc$/, '').replace(/[/.]/g, '-')
|
|
443
|
+
if (fragment === resource.asciidoc.id) fragment = ''
|
|
447
444
|
const refid = fragment
|
|
448
445
|
? `${relativePart}${idScopeSeparator}${fragment}`
|
|
449
446
|
: relativePart + (ReservedIdNames.includes(relativePart) ? idScopeSeparator : '')
|
|
@@ -454,7 +451,7 @@ function mergeAsciiDoc (
|
|
|
454
451
|
) {
|
|
455
452
|
text = ''
|
|
456
453
|
}
|
|
457
|
-
return
|
|
454
|
+
return `xref:${refid}[${text}]`
|
|
458
455
|
})
|
|
459
456
|
}
|
|
460
457
|
if (~line.indexOf('link:{attachmentsdir}/')) {
|
|
@@ -609,7 +606,7 @@ function mergeAsciiDoc (
|
|
|
609
606
|
let refid = resource.src.relative.replace(/\.adoc$/, '').replace(/[/.]/g, '-')
|
|
610
607
|
if (refid.startsWith('./')) refid = topicPrefix + refid.slice(2)
|
|
611
608
|
if (resource.src.module !== 'ROOT') refid = `${resource.src.module}${idCoordinateSeparator}${refid}`
|
|
612
|
-
sectionTitle =
|
|
609
|
+
sectionTitle = `xref:${refid}[${navtitleAsciiDoc.replace(/\]/g, '\\]')}]`
|
|
613
610
|
} else if (siteRoot) {
|
|
614
611
|
sectionTitle = `${resolveLinkTarget(resource, siteRoot, pubRoot, linkRefStyle)}[${navtitleAsciiDoc.replace(/\]/g, '\\]')}]`
|
|
615
612
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/assembler",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "A JavaScript library that merges AsciiDoc content from multiple pages in an Antora site into assembly files and delegates to an exporter to convert those files to another format, such as PDF.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "OpenDevise Inc. (https://opendevise.com)",
|