@antora/html-single-extension 1.0.0-beta.18 → 1.0.0-beta.19
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/converter.js +8 -10
- package/lib/index.js +1 -2
- package/package.json +2 -3
package/lib/converter.js
CHANGED
|
@@ -4,10 +4,10 @@ const fsp = require('node:fs/promises')
|
|
|
4
4
|
const ospath = require('node:path')
|
|
5
5
|
|
|
6
6
|
const DEFAULT_COMMAND = 'asciidoctor'
|
|
7
|
+
const PACKAGE_NAME = require('../package.json').name
|
|
7
8
|
|
|
8
|
-
async function convert (
|
|
9
|
-
|
|
10
|
-
if (command === false) {
|
|
9
|
+
async function convert (file, convertAttributes, buildConfig, { logCommand, runCommand }) {
|
|
10
|
+
if (buildConfig.command === false) {
|
|
11
11
|
const Asciidoctor = this.require('@asciidoctor/core')()
|
|
12
12
|
const Extensions = Asciidoctor.Extensions
|
|
13
13
|
const exts = this.getVariables().siteAsciiDocConfig?.extensions || []
|
|
@@ -31,9 +31,10 @@ async function convert (runCommand, file, convertAttributes, buildConfig) {
|
|
|
31
31
|
if (exts.length) extDslTypes.forEach((type) => (Opal.const_get_local(Extensions, type).$$iclasses.length = 0))
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
|
-
const { cwd = process.cwd(), stderr = 'print' } = buildConfig
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const { command, cwd = process.cwd(), attributeOptionFlag = '-a', stderr = 'print' } = buildConfig
|
|
35
|
+
logCommand?.(command, file, convertAttributes, attributeOptionFlag)
|
|
36
|
+
const args = convertAttributes.toArgs(attributeOptionFlag, command).concat('-o', convertAttributes.outfile, '-')
|
|
37
|
+
return runCommand(command, args, { parse: true, cwd, stdin: file.contents, stdout: 'print', stderr })
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -45,13 +46,10 @@ function getDefaultCommand (cwd) {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
module.exports = {
|
|
48
|
-
bind (thisArg, runCommand) {
|
|
49
|
-
return Object.assign({}, this, { convert: convert.bind(thisArg, runCommand) })
|
|
50
|
-
},
|
|
51
49
|
convert,
|
|
52
50
|
backend: 'html',
|
|
53
51
|
getDefaultCommand,
|
|
54
52
|
extname: '.html',
|
|
55
53
|
mediaType: 'text/html',
|
|
56
|
-
loggerName:
|
|
54
|
+
loggerName: PACKAGE_NAME,
|
|
57
55
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const converter = require('./converter')
|
|
4
|
-
const runCommand = require('@antora/run-command-helper')
|
|
5
4
|
|
|
6
5
|
module.exports.register = function ({ config }, providers) {
|
|
7
|
-
requireAssembler(this).configure(this, converter
|
|
6
|
+
requireAssembler(this).configure(this, converter, config, providers)
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
function requireAssembler (context, packageName = '@antora/assembler') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antora/html-single-extension",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.19",
|
|
4
4
|
"description": "An Antora extension that uses Assembler to merge pages into assembly files, export them to standalone HTML documents, and publish them with the site.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "OpenDevise Inc. (https://opendevise.com)",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"#package": "./package.json"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@antora/assembler": "1.0.0-beta.
|
|
36
|
-
"@antora/run-command-helper": "~1.0"
|
|
35
|
+
"@antora/assembler": "1.0.0-beta.19"
|
|
37
36
|
},
|
|
38
37
|
"engines": {
|
|
39
38
|
"node": ">=16.0.0"
|