Skip to content

Commit

Permalink
update playbook to use draft content; activate kroki extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jan 26, 2024
1 parent 6280905 commit 5d9a3ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
node-version: '18'
- name: Generate Site
run: npx -y antora --html-url-extension-style=indexify antora-playbook.yml
run: npx -y --package antora --package asciidoctor-kroki antora --stacktrace --html-url-extension-style=indexify antora-playbook.yml
- name: Upload Artifact
uses: actions/upload-pages-artifact@v2
- name: Deploy Artifact to GitHub Pages
Expand Down
11 changes: 9 additions & 2 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# npx antora antora-playbook.yml
# to build site, use:
#
# npx antora antora-playbook.yml
#
# to also activate diagram generator (Kroki), use:
#
# npx --package antora --package asciidoctor-kroki antora antora-playbook.yml
antora:
extensions:
- ./lib/register-asciidoctor-kroki-extension.js
- ./lib/component-url-prefix-extension.js
site:
title: Eclipse Jetty
Expand All @@ -12,7 +19,7 @@ content:
start_paths: [home, docs-home, contribution-guide]
- url: https://github.com/opendevise/jetty.project
branches: jetty-12.0.x-for-antora
start_path: documentation/jetty-docs
start_path: documentation/jetty
asciidoc:
attributes:
experimental: ''
Expand Down
12 changes: 12 additions & 0 deletions lib/register-asciidoctor-kroki-extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict'

module.exports.register = function () {
this.on('playbookBuilt', ({ playbook }) => {
try {
this.require('asciidoctor-kroki')
// or...
//require.resolve('asciidoctor-kroki', { paths: this.module.require.main.paths })
playbook.asciidoc.extensions.push('asciidoctor-kroki')
} catch {}
})
}

0 comments on commit 5d9a3ef

Please sign in to comment.