Skip to content

Commit 1609085

Browse files
author
Isaac Ramirez
committed
- changes summary:
- install ink-docstrap - configure jsdocs - add custom jsdoc plugin - add yarn docs script - move markdown folder inside docs - move samples folder inside docs
1 parent 54444cd commit 1609085

File tree

11 files changed

+165
-10
lines changed

11 files changed

+165
-10
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Logs
1+
# docs output
2+
docs/html/*
3+
!docs/html/.gitkeep
4+
5+
# logs
26
logs
37
*.log
48
npm-debug.log*
@@ -7,4 +11,4 @@ yarn-error.log*
711
lerna-debug.log*
812

913
# npm modules
10-
node_modules/
14+
node_modules

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Personal notes and JavaScript code for the book Algorithms (4th edition) by Robe
1010
* [StdOut](/src/libs/std-out/std-out.js)
1111
* [StdRandom](/src/libs/std-random/std-random.js)
1212

13-
## Benchmarks
14-
15-
* [Linear Search vs. Binary Search](/src/benchmarks/searching/linear-vs-binary-search.js)
16-
1713
## Algorithms & Data Structures
1814

1915
_For a list similar to the book site see this [algorithms list](/markdown/algorithms.md)._
@@ -72,3 +68,7 @@ _For a list similar to the book site see this [algorithms list](/markdown/algori
7268
## Exercise Solutions
7369

7470
:warning: _Do **NOT** copy any of [these solutions](/src/exercises/index.md). These are for my reference only. You should have attempted to solve any of these exercises by your own after at least a few days before even trying to look for the solution. Finally, my solutions can be wrong too._
71+
72+
## Benchmarks
73+
74+
* [Linear Search vs. Binary Search](/benchmarks/searching/linear-vs-binary-search.js)

docs/conf.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"plugins": [
3+
"plugins/markdown",
4+
"plugins/my-tags"
5+
],
6+
"markdown": {
7+
"tags": ["note"]
8+
},
9+
"recurseDepth": 10,
10+
"source": {
11+
"include": ["./src"],
12+
"exclude": [],
13+
"includePattern": ".+\\.js(doc|x)?$",
14+
"excludePattern": "(^|\\/|\\\\)_|.+\\.spec\\.js$"
15+
},
16+
"sourceType": "module",
17+
"opts": {
18+
"template": "./node_modules/ink-docstrap/template",
19+
"encoding": "utf8",
20+
"destination": "./docs/html",
21+
"recurse": true,
22+
"readme": "./README.md"
23+
},
24+
"tags": {
25+
"allowUnknownTags": true,
26+
"dictionaries": ["jsdoc", "closure"]
27+
},
28+
"templates": {
29+
"cleverLinks": false,
30+
"monospaceLinks": false,
31+
"default": {
32+
"outputSourceFiles": true,
33+
"staticFiles": {
34+
"include": ["./static"]
35+
},
36+
"includeDate": false,
37+
"useLongnameInNav": false
38+
},
39+
"theme": "simplex",
40+
"includeDate": false,
41+
"navType": "vertical",
42+
"inverseNav": false,
43+
"linenums": true,
44+
"sort": false
45+
}
46+
}

docs/html/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The contents of this folder are auto-generated by issuing the command: yarn docs
File renamed without changes.
File renamed without changes.

docs/plugins/my-tags.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
exports.defineTags = function (dictionary) {
2+
dictionary.defineTag('note', {
3+
onTagged: function (doclet, tag) {
4+
const note = `<p><em><strong>NOTE:</strong>&nbsp;${tag.text}</em></p>`
5+
6+
if (doclet.classdesc) {
7+
doclet.classdesc = `${doclet.classdesc}${note}`
8+
} else {
9+
doclet.description = `${doclet.description || ''}${note}`
10+
}
11+
}
12+
})
13+
}

samples/ex-x.x.x.js renamed to docs/samples/ex-x.x.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @module samples */
22

3-
const { StdOut } = require('../src/libs')
3+
const { StdOut } = require('../../src/libs')
44

55
/**
66
* @summary Exercise x.x.x
File renamed without changes.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "Personal notes & JavaScript code for the book: Algorithms 4th edition by Robert Sedgewick and Kevin Wayne.",
55
"scripts": {
6+
"docs": "jsdoc -c docs/conf.json --pedantic --verbose",
67
"lint": "standard \"src/**/*.js\"",
78
"lint:fix": "yarn lint --fix",
89
"pretest": "yarn lint",
@@ -31,6 +32,7 @@
3132
},
3233
"devDependencies": {
3334
"d3": "^5.15.1",
35+
"ink-docstrap": "^1.3.2",
3436
"jasmine": "^3.6.3",
3537
"jsdoc": "~3.6.6",
3638
"jsdom": "^16.4.0",

0 commit comments

Comments
 (0)