@antora/pdf-extension 1.0.0-alpha.8 → 1.0.0-alpha.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.
Files changed (2) hide show
  1. package/lib/index.js +10 -4
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -2,12 +2,18 @@
2
2
 
3
3
  const convertDocumentToPdf = require('./convert-document-to-pdf')
4
4
 
5
- module.exports.register = function () {
5
+ module.exports.register = function ({ config: { configFile: configSource } }) {
6
6
  this.once('beforeProcess', ({ siteAsciiDocConfig }) => {
7
7
  siteAsciiDocConfig.keepSource = true
8
8
  })
9
- this.once('beforePublish', ({ playbook, contentCatalog, siteCatalog }) => {
10
- const { assembleContent } = this.require('@antora/assembler')
11
- return assembleContent.call(this, playbook, contentCatalog, convertDocumentToPdf, { siteCatalog })
9
+ this.once('navigationBuilt', ({ playbook, contentCatalog, siteCatalog }) => {
10
+ const { assembleContent } = (() => {
11
+ try {
12
+ return this.require('@antora/assembler') // when installed with Antora
13
+ } catch {
14
+ return require('@antora/assembler') // when installed separate from Antora, perhaps in project
15
+ }
16
+ })()
17
+ return assembleContent.call(this, playbook, contentCatalog, convertDocumentToPdf, { configSource, siteCatalog })
12
18
  })
13
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/pdf-extension",
3
- "version": "1.0.0-alpha.8",
3
+ "version": "1.0.0-alpha.9",
4
4
  "description": "An Antora extension that assembles content pages into PDF files by version and publishes them with the site.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -26,7 +26,7 @@
26
26
  "#convert-document-to-pdf": "./lib/convert-document-to-pdf.js"
27
27
  },
28
28
  "dependencies": {
29
- "@antora/assembler": "1.0.0-alpha.8"
29
+ "@antora/assembler": "1.0.0-alpha.9"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=16.0.0"