Skip to content

Commit 2f19c96

Browse files
committed
Embed core documentation into driver docs
1 parent a29a062 commit 2f19c96

File tree

6 files changed

+32
-24
lines changed

6 files changed

+32
-24
lines changed

core/package-lock.json

Lines changed: 2 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
"url": "https://github.com/neo4j/neo4j-javascript-driver/issues"
2626
},
2727
"homepage": "https://github.com/neo4j/neo4j-javascript-driver#readme",
28-
"dependencies": {
29-
"esdoc-typescript-plugin": "^1.0.1",
30-
"typescript": "^4.1.3"
31-
},
28+
"dependencies": {},
3229
"devDependencies": {
30+
"typescript": "^4.1.3",
3331
"esdoc": "^1.1.0",
3432
"esdoc-importpath-plugin": "^1.0.2",
3533
"esdoc-standard-plugin": "^1.0.0"

docs/embed-docs.plugin.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const fs = require('fs')
2+
let option;
3+
4+
class EmbebDocsPlugin {
5+
onStart(ev) {
6+
option = ev.data.option
7+
}
8+
9+
onHandleDocs(ev) {
10+
if (option.enabled) {
11+
const data = fs.readFileSync(option.path + '/index.json', 'utf-8')
12+
const embedDocs = JSON.parse(data.toString())
13+
ev.data.docs = [...ev.data.docs, ...embedDocs]
14+
}
15+
};
16+
17+
}
18+
19+
module.exports = new EmbebDocsPlugin();

esdoc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
"repository": "https://github.com/neo4j/neo4j-javascript-driver"
4141
}
4242
}
43+
},
44+
{
45+
"name": "./docs/embed-docs.plugin.js",
46+
"option": {
47+
"enabled": true,
48+
"path": "./core/docs"
49+
}
4350
}
4451
]
4552
}

package-lock.json

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"stop-neo4j": "gulp stop-neo4j",
1919
"run-stress-tests": "gulp run-stress-tests-without-jasmine",
2020
"run-ts-declaration-tests": "gulp run-ts-declaration-tests",
21+
"predocs": "cd core && npm run docs",
2122
"docs": "esdoc -c esdoc.json",
2223
"versionRelease": "gulp set --x $VERSION && npm version $VERSION --no-git-tag-version",
2324
"browser": "gulp browser && gulp test-browser",

0 commit comments

Comments
 (0)