Skip to content

Commit 89d27c0

Browse files
committed
Docs: Added document generation system
- Docs: Using JSDoc with a modified version of the Braintree JSDoc Template for generating documentation - Docs: Improved documentation of Configuration options, other minor documentation tweaks - Demo: Added link to generated documentation to demo page - Scripts: Migrated all project scripts to the ES6 module system (i.e., using `import` and `export` rather than `module.exports` and `require`) - Brat: Renamed file: `ann.js` -> `brat.js` - Removed old code that has been superseded, added warnings to old code that is not currently in use
1 parent 436d224 commit 89d27c0

File tree

152 files changed

+64505
-3305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+64505
-3305
lines changed

.jsdoc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"plugins": [
3+
"plugins/markdown"
4+
],
5+
"templates": {
6+
"referenceTitle": "TextAnnotationGraphs",
7+
"disableSort": true,
8+
"collapse": false,
9+
"resources": {
10+
"SVG Path Spec<br>": "https://www.w3.org/TR/SVG/paths.html#PathData",
11+
"SVG Cubic Bézier Curve Generator": "https://codepen.io/explosion/pen/YGApwd"
12+
}
13+
},
14+
"opts": {
15+
"encoding": "utf8",
16+
"recurse": true,
17+
"template": "src/jsdoc-template"
18+
}
19+
}

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# TextAnnotationGraphs (TAG)
22
A modular annotation system that supports complex, interactive annotation graphs embedded on top of sequences of text. An additional view displays a subgraph of selected connections between words/phrases using an interactive network layout.
33

4-
![TAG](/figs/OneRow.png)
4+
![TAG](figs/OneRow.png)
55

66
---
77

8-
![TAG](/figs/taxonomyColors.png)
8+
![TAG](figs/taxonomyColors.png)
99

1010
---
1111

12-
![TAG](/figs/TwoRows.png)
12+
![TAG](figs/TwoRows.png)
1313

1414
---
1515

16-
![TAG](/figs/trees.png)
16+
![TAG](figs/trees.png)
1717

1818

1919
## Development
@@ -93,8 +93,18 @@ Assuming you've cloned the repository, simply run `npm install && npm run build`
9393

9494
### Live monitoring of changes
9595

96-
For convenience, you can monitor changes to the library's sources (css + js) with the following `npm` task:
96+
For convenience, you can monitor changes to the library's sources (css + js) with the following `npm` task:
9797

9898
```
9999
npm run watch
100100
```
101+
102+
### Generating documentation
103+
104+
TAG uses [JSDoc](http://usejsdoc.org/) to generate its documentation. By default, the documentation is generated using the template in `src/jsdoc-template` (adapted from the [Braintree JSDoc Template](https://github.com/braintree/jsdoc-template)) and stored in the `docs` folder.
105+
106+
To regenerate the documentation, use the following `npm` task:
107+
108+
```
109+
npm run generate-docs
110+
```

demo/demo.min.js

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

demo/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
<div class="container py-5">
2424
<h2 class="mb-5">TextAnnotationGraphs (TAG) Demo</h2>
2525

26+
<div class="row mb-3">
27+
<div class="col">
28+
<h4>Documentation</h4>
29+
<p>
30+
See the API documentation <a href="/docs" target="_blank">here</a>.
31+
</p>
32+
</div>
33+
</div>
34+
2635
<div class="row mb-5">
2736
<div class="col">
2837
<h4>Basic example</h4>

demo/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ const app = express();
1717
const logger = require("morgan");
1818
app.use(logger("dev"));
1919

20-
// Demo files
21-
// ----------
20+
// Demo files and documentation
21+
// ----------------------------
2222
app.use(express.static(__dirname));
2323
app.use("/dist", express.static(path.join(__dirname, "..", "dist")));
24+
app.use("/docs", express.static(path.join(__dirname, "..", "docs")));
2425

2526
// Set up HTTP interface
2627
// ---------------------

0 commit comments

Comments
 (0)