-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and check links with hyperlink (#271)
* Fix and check links with hyperlink * Add CI jobs * Trigger if documentation changed * Build on fork * Remove temporary build on fork repo * Remove comment * Remove console.log
- Loading branch information
1 parent
f1ccd65
commit 0f58d2c
Showing
12 changed files
with
143 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- '4.0' | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 14 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14' | ||
- run: npm install | ||
working-directory: 'doc' | ||
- run: npm run build:docs | ||
working-directory: 'doc' | ||
- run: npm run lint:links | ||
working-directory: 'doc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Trigger Publish | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'doc/docs' | ||
branches: | ||
- '4.0' | ||
|
||
jobs: | ||
trigger_publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Trigger Developer Event | ||
uses: peter-evans/repository-dispatch@master | ||
with: | ||
token: ${{ secrets.BUILD_ACCESS_TOKEN }} | ||
repository: neo4j-documentation/docs-refresh | ||
event-type: spark-connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
site: | ||
title: Neo4j Connector for Apache Spark User Guide | ||
url: /neo4j-spark-docs | ||
|
||
content: | ||
sources: | ||
- url: ../ | ||
branches: HEAD | ||
start_path: doc/docs | ||
|
||
output: | ||
dir: ./build/site/developer | ||
|
||
ui: | ||
bundle: | ||
url: https://s3-eu-west-1.amazonaws.com/static-content.neo4j.com/build/ui-bundle.zip | ||
snapshot: true | ||
|
||
urls: | ||
html_extension_style: indexify | ||
|
||
asciidoc: | ||
attributes: | ||
page-theme: docs | ||
page-cdn: /_/ | ||
experimental: '' | ||
page-cdn: /static/assets | ||
page-theme: developer | ||
page-canonical-root: /developer | ||
page-disabletracking: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const path = require('path') | ||
const hyperlink = require('hyperlink') | ||
const TapRender = require('@munter/tap-render'); | ||
|
||
const root = path.join(__dirname, '..') | ||
|
||
;(async () => { | ||
const tapRender = new TapRender() | ||
tapRender.pipe(process.stdout) | ||
try { | ||
const skipPatterns = [ | ||
// initial redirect | ||
'load index.html', | ||
'load docs/index.html', | ||
// google fonts | ||
'load https://fonts.googleapis.com/', | ||
// static resources | ||
'load static/assets', | ||
// externals links | ||
// / | ||
'load try-neo4j', | ||
// /developer | ||
'load developer', | ||
// /labs | ||
'load labs', | ||
// /docs | ||
'load docs', | ||
// rate limit on twitter.com (will return 400 code if quota exceeded) | ||
'external-check https://twitter.com/neo4j', | ||
// workaround: not sure why the following links are not resolved properly by hyperlink :/ | ||
'load build/site/developer/spark/quickstart/reading', | ||
'load build/site/developer/spark/quickstart/writing' | ||
] | ||
const skipFilter = (report) => { | ||
return Object.values(report).some((value) => { | ||
return skipPatterns.some((pattern) => String(value).includes(pattern)) | ||
} | ||
) | ||
}; | ||
await hyperlink({ | ||
root, | ||
inputUrls: [`build/site/developer/spark/index.html`], | ||
skipFilter: skipFilter, | ||
recursive: true, | ||
}, | ||
tapRender | ||
) | ||
} catch (err) { | ||
console.log(err.stack); | ||
process.exit(1); | ||
} | ||
const results = tapRender.close(); | ||
process.exit(results.fail ? 1 : 0); | ||
})() |