@antora/html-single-extension 1.0.0-rc.6 → 1.0.0-rc.7

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 CHANGED
@@ -6,7 +6,7 @@ const ospath = require('node:path')
6
6
  const DEFAULT_COMMAND = 'asciidoctor'
7
7
  const PACKAGE_NAME = require('../package.json').name
8
8
 
9
- async function convert (file, convertAttributes, buildConfig, { logCommand, runCommand }) {
9
+ async function convert (file, conversionAttributes, buildConfig, { logCommand, runCommand }) {
10
10
  if (buildConfig.command === false) {
11
11
  const Asciidoctor = this.require('@asciidoctor/core')()
12
12
  const Extensions = Asciidoctor.Extensions
@@ -20,23 +20,25 @@ async function convert (file, convertAttributes, buildConfig, { logCommand, runC
20
20
  exts.forEach((ext) => ext.register(extRegistry, { file, contentCatalog }))
21
21
  }
22
22
  Asciidoctor.convert(file.contents, {
23
- attributes: convertAttributes,
23
+ attributes: conversionAttributes,
24
24
  extension_registry: extRegistry,
25
25
  mkdirs: true,
26
26
  safe: 'safe',
27
27
  sourcemap: true,
28
- to_file: convertAttributes.outfile,
28
+ to_file: conversionAttributes.outfile,
29
29
  })
30
30
  } finally {
31
- if (exts.length) extDslTypes.forEach((type) => (Opal.const_get_local(Extensions, type).$$iclasses.length = 0))
31
+ if (exts.length) {
32
+ for (const type of extDslTypes) Extensions[type].$$iclasses.length = 0
33
+ }
32
34
  }
33
35
  } else {
34
36
  const { command, cwd = process.cwd(), attributeOptionFlag, stderr = 'print' } = buildConfig
35
37
  if (!command) return null
36
38
  const outputOptionFlag = buildConfig.outputOptionFlag || (buildConfig.outputOptionFlag === false ? false : '-o')
37
- const extraArgs = convertAttributes.toArgs(attributeOptionFlag || '-a', outputOptionFlag)
39
+ const extraArgs = conversionAttributes.toArgs(attributeOptionFlag || '-a', outputOptionFlag)
38
40
  const stdout = outputOptionFlag ? 'print' : 'buffer'
39
- logCommand?.(command, extraArgs, file, convertAttributes)
41
+ logCommand?.(command, extraArgs, file, conversionAttributes)
40
42
  return runCommand(command, extraArgs.concat('-'), { parse: true, cwd, stdin: file.contents, stdout, stderr })
41
43
  }
42
44
  }
@@ -52,7 +54,8 @@ function getDefaultCommand (cwd, playbook) {
52
54
 
53
55
  module.exports = {
54
56
  convert,
55
- backend: 'html',
57
+ backend: 'html-single',
58
+ format: 'html',
56
59
  getDefaultCommand,
57
60
  extname: '.html',
58
61
  mediaType: 'text/html',
package/lib/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  'use strict'
2
2
 
3
+ const { configure: configureAssembler } = require('@antora/assembler')
3
4
  const converter = require('./converter')
4
5
 
5
6
  module.exports.register = function ({ config }, providers) {
6
- this.require('@antora/assembler', { require }).configure(this, converter, config, providers)
7
+ configureAssembler(this, converter, config, providers)
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/html-single-extension",
3
- "version": "1.0.0-rc.6",
3
+ "version": "1.0.0-rc.7",
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,7 +32,7 @@
32
32
  "#package": "./package.json"
33
33
  },
34
34
  "dependencies": {
35
- "@antora/assembler": "1.0.0-rc.6"
35
+ "@antora/assembler": "1.0.0-rc.7"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=20.0.0"