Skip to content

Commit

Permalink
Add scripts to produce documentation using jsdoc
Browse files Browse the repository at this point in the history
fixes chairemobilite#591

Add yarn scripts to generate documentation for the `evolution-common`
javascript code.

TODO

* Document the typescript code instead, so that the types are also
  documented
* Document all the evolution packages, not just `common`
* Provide a higher level "glue" to document high level concepts that can
  then link to the jsdoc complete documentation of the packages.

To use this commit, you need to install `jsdoc` globally on your system
with

`npm i -g jsdoc`
  • Loading branch information
tahini committed Jul 10, 2024
1 parent 2db45b0 commit 2598fd2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"list-tasks": "yarn workspace evolution-legacy run list-tasks",
"generate-migration": "knex migrate:make",
"reset-submodules": "rimraf transition/ && git submodule init && git submodule update",
"generateSurvey:example": "yarn worspace evolution-generator run generateSurvey --config_path src/examples/generatorExampleConfigs.yaml"
"generateSurvey:example": "yarn worspace evolution-generator run generateSurvey --config_path src/examples/generatorExampleConfigs.yaml",
"jsdoc": "yarn workspace evolution-common run jsdoc"
},
"dependencies": {},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions packages/evolution-common/jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"plugins": ["plugins/markdown"],
"recurseDepth": 10,
"opts": {
"destination": "../../docs/api",
"recurse": true
},
"source": {
"include": ["./lib", "../../README.md"],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": ".+\\.test\\.js(doc|x)?$"
},
"sourceType": "module",
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc"]
},
"templates": {
"cleverLinks": false,
"monospaceLinks": false
}
}
3 changes: 2 additions & 1 deletion packages/evolution-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"test:sequential": "echo 'no tests to run for this workspace'",
"test:ui": "echo 'no tests to run for this workspace'",
"lint": "eslint .",
"format": "prettier-eslint ./src/**/*.{ts,tsx} --write"
"format": "prettier-eslint ./src/**/*.{ts,tsx} --write",
"jsdoc": "jsdoc -c jsdoc.json"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.32",
Expand Down

0 comments on commit 2598fd2

Please sign in to comment.