Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-250: local check links extension #425

Merged
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/actions/validate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ runs:
sparse-checkout: |
antora-playbook.yml
lib/load-check-links-playbook.js
lib/antora-link-checker-extension.js
sparse-checkout-cone-mode: false
path: hazelcast-docs
ref: main
Expand All @@ -25,6 +26,6 @@ runs:
run: |
cp "./hazelcast-docs/lib/load-check-links-playbook.js" "./load-check-links-playbook.js"
npm i
npm i -D [email protected] @jcahills/[email protected] [email protected]
npm i -D [email protected] [email protected]
node load-check-links-playbook.js $GITHUB_REPOSITORY $GITHUB_BASE_REF
./node_modules/.bin/antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=@jcahills/antora-link-checker check-links-playbook.yml
./node_modules/.bin/antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=hazelcast-docs/lib/antora-link-checker-extension.js check-links-playbook.yml
8 changes: 8 additions & 0 deletions lib/antora-link-checker-extension.js
JackPGreen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This extension stops the Antora site generator from building the site after checking internal links (xrefs).
// As a result, the output is a list of broken links rather than a documentation site.

module.exports.register = (context) => {
context.on('documentsConverted', () => {
context.stop()
})
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build": "antora --to-dir docs --fetch antora-playbook.yml && cp _redirects docs",
"build-local": "antora --to-dir docs --fetch antora-playbook-local.yml",
"check-links-local": "antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=@jcahills/antora-link-checker antora-playbook-local.yml",
"check-links-local": "antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=./lib/antora-link-checker-extension.js antora-playbook-local.yml",
"generate-pdfs-platform-5-5": "antora assembler-playbook-platform-5-5.yml",
"generate-pdfs-platform-5-4": "antora assembler-playbook-platform-5-4.yml",
"generate-pdfs-platform-5-3": "antora assembler-playbook-platform-5-3.yml",
Expand All @@ -26,7 +26,6 @@
"devDependencies": {
"@antora/cli": "^3.1.1",
"@antora/site-generator": "^3.1.1",
"@jcahills/antora-link-checker": "^1.0.1",
"@djencks/antora-aggregate-collector": "^0.1.0-beta.1",
"asciidoctor-kroki": "^0.15.0",
"ngrok": "^4.2.2",
Expand Down