@antora/pdf-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 CHANGED
@@ -4,10 +4,12 @@ const fsp = require('node:fs/promises')
4
4
  const ospath = require('node:path')
5
5
 
6
6
  const DEFAULT_COMMAND = 'asciidoctor-pdf'
7
+ const PACKAGE_NAME = require('../package.json').name
7
8
 
8
- async function convert (runCommand, file, convertAttributes, buildConfig) {
9
- const { command, cwd = process.cwd(), stderr = 'print' } = buildConfig
10
- const args = convertAttributes.toArgs('-a', command).concat('-o', convertAttributes.outfile, '-')
9
+ async function convert (file, convertAttributes, buildConfig, { logCommand, runCommand }) {
10
+ const { command, cwd = process.cwd(), attributeOptionFlag = '-a', stderr = 'print' } = buildConfig
11
+ logCommand?.(command, file, convertAttributes, attributeOptionFlag)
12
+ const args = convertAttributes.toArgs(attributeOptionFlag, command).concat('-o', convertAttributes.outfile, '-')
11
13
  return runCommand(command, args, { parse: true, cwd, stdin: file.contents, stdout: 'print', stderr })
12
14
  }
13
15
 
@@ -19,13 +21,10 @@ function getDefaultCommand (cwd) {
19
21
  }
20
22
 
21
23
  module.exports = {
22
- bind (thisArg, runCommand) {
23
- return Object.assign({}, this, { convert: convert.bind(thisArg, runCommand) })
24
- },
25
24
  convert,
26
25
  backend: 'pdf',
27
26
  getDefaultCommand,
28
27
  extname: '.pdf',
29
28
  mediaType: 'application/pdf',
30
- loggerName: require('../package.json').name,
29
+ loggerName: PACKAGE_NAME,
31
30
  }
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.bind(this, runCommand), config, providers)
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/pdf-extension",
3
- "version": "1.0.0-beta.18",
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 the PDF format, 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.18",
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"