Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Commit 9b3fa6c

Browse files
authored
Integrate new api docs into site build
Additonal visual tweak as well
1 parent f133e46 commit 9b3fa6c

File tree

6 files changed

+46
-132
lines changed

6 files changed

+46
-132
lines changed

demos/homepage/_includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<a class="mdl-navigation__link" href="{{ "/#getting-started" | relative_url }}">Getting Started</a>
1919
<!-- <a class="mdl-navigation__link" href="{{ "/docs/intro.html" | relative_url }}">Introduction</a> -->
2020
<a class="mdl-navigation__link" href="{{ "/docs/tutorials/index.html" | relative_url }}">Tutorials</a>
21-
<a class="mdl-navigation__link" href="{{ "/docs/api/globals.html" | relative_url }}">API Reference</a>
21+
<a class="mdl-navigation__link" href="{{ "/docs/api/index.html" | relative_url }}">API Reference</a>
2222
</nav>
2323
</div>
2424
</header>

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"tsify": "~3.0.1",
3939
"tslint": "~5.8.0",
4040
"tslint-no-circular-imports": "~0.2.0",
41-
"typedoc": "~0.8.0",
4241
"typescript": "2.6.1",
4342
"uglify-js": "~3.0.28",
4443
"watchify": "~3.9.0"

scripts/make-website.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ mkdir "$TMP_DIR"
2626
cp -r "docs" "$TMP_DIR/"
2727

2828
# Make the documentation.
29-
./node_modules/.bin/typedoc --out "$TMP_DIR/docs/api/" --excludeExternals \
30-
--excludeNotExported --excludePrivate --mode file --tsconfig tsconfig-doc.json
29+
./node_modules/.bin/ts-node ./website/scripts/make-api.ts -o $TMP_DIR/docs/api/ $1
3130

3231
# Make demo directory (if not existing)
3332
mkdir -p "$TMP_DIR/demos"

website/api/index.html

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,18 @@
4545
position: fixed;
4646
border-bottom: 1px solid lightgrey;
4747
padding: 10px;
48-
padding-left: 16px;
48+
padding-left: 24px;
49+
4950
width: 100%;
50-
height: 20px;
51+
height: 32px;
52+
background-color: rgb(96,125,139);
5153
}
5254

5355
.container nav a {
54-
color: black;
55-
font-size: 18px
56+
display: inline-block;
57+
padding-top: 6px;
58+
color: white;
59+
font-size: 20px
5660
}
5761

5862
.container nav .title {
@@ -65,22 +69,22 @@
6569
flex-direction: row;
6670
/* height: 100vh; */
6771
/* overflow-y: hidden; */
68-
margin-top: 40px;
72+
margin-top: 52px;
6973
}
7074

7175
.container .content-area .toc {
7276
width: 25%;
7377
min-width: 250px;
7478
max-width: 350px;
75-
height: calc(100vh - 40px);
79+
height: calc(100vh - 52px);
7680
overflow-y: auto;
7781
overflow-x: hidden;
7882

7983
}
8084

8185
.container .content-area .reference {
8286
flex-grow: 1;
83-
height: calc(100vh - 40px);
87+
height: calc(100vh - 52px);
8488
overflow-y: auto;
8589
overflow-x: hidden;
8690
margin-left: 40px;
@@ -242,19 +246,19 @@
242246
}
243247

244248
.parameter {
245-
margin-bottom: 8px;
249+
margin-bottom: 24px;
246250
}
247251

248252
.parameter-heading, .returns-header {
249253
margin-top: 8px;
250254
font-weight: 500;
251-
font-variant: small-caps;
252-
text-transform: lowercase;
253-
font-size: 16px;
255+
text-transform: uppercase;
256+
font-size: 14px;
254257
}
255258

256259
.method {
257-
margin-left: 25px;
260+
margin: 16px 0px 24px 25px;
261+
258262
}
259263

260264
.param-name {
@@ -306,6 +310,8 @@
306310
position: absolute;
307311
right: 4px;
308312
top: 4px;
313+
font-size: 12px;
314+
font-weight: bold;
309315
}
310316
</style>
311317

@@ -342,7 +348,7 @@
342348
lastHighlightedTocElement.classList.remove('highlighted');
343349
}
344350
tocFound.classList.add('highlighted');
345-
tocFound.scrollIntoView(false);
351+
// tocFound.scrollIntoView(false);
346352
lastHighlightedTocElement = tocFound;
347353
}
348354
}
@@ -356,6 +362,7 @@
356362
<body>
357363
<!-- Partials -->
358364
{{#*inline "paramList"}}
365+
{{#if parameters.length}}
359366
<div class="parameter-list">
360367
<div class="parameter-heading">Parameters:</div>
361368
<ul>
@@ -376,14 +383,14 @@
376383
{{/parameters}}
377384
</ul>
378385
</div>
379-
386+
{{/if}}
380387
{{/inline}}
381388
<!-- END Partials -->
382389

383390

384391
<div class="container">
385392
<nav>
386-
<a href="index.html">deeplearn.js</a>
393+
<a href="/index.html">deeplearn.js</a>
387394
</nav>
388395

389396
<div class="content-area">
@@ -513,4 +520,16 @@ <h6>Methods:</h6>
513520
}
514521
})();
515522
</script>
523+
<script>
524+
(function (i, s, o, g, r, a, m) {
525+
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
526+
(i[r].q = i[r].q || []).push(arguments)
527+
}, i[r].l = 1 * new Date(); a = s.createElement(o),
528+
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
529+
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
530+
531+
ga('create', 'UA-46457317-8', 'auto');
532+
ga('send', 'pageview');
533+
</script>
534+
516535
</body>

website/scripts/make-api.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ import * as ts from 'typescript';
3232
import * as parser from './api-parser';
3333
import * as util from './api-util';
3434

35+
const argv = minimist(process.argv.slice(2));
36+
3537
const TOPLEVEL_NAMESPACE = 'dl';
3638
const API_TEMPLATE_PATH = './website/api/index.html';
37-
const HTML_OUT_DIR = '/tmp/deeplearn-new-website/api/';
39+
const HTML_OUT_DIR = argv.o || '/tmp/deeplearn-new-website/api/';
3840

39-
const argv = minimist(process.argv.slice(2));
41+
console.log('Building API docs to: ' + HTML_OUT_DIR, argv);
4042

4143
shell.mkdir('-p', HTML_OUT_DIR);
4244

yarn.lock

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,22 @@
22
# yarn lockfile v1
33

44

5-
"@types/events@*":
6-
version "1.1.0"
7-
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.1.0.tgz#93b1be91f63c184450385272c47b6496fd028e02"
8-
95
"@types/fetch-mock@~5.12.2":
106
version "5.12.2"
117
resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-5.12.2.tgz#8c96517ff74303031c65c5da2d99858e34c844d2"
128

13-
"@types/fs-extra@^4.0.0":
14-
version "4.0.7"
15-
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.7.tgz#02533262386b5a6b9a49797dc82feffdf269140a"
16-
dependencies:
17-
"@types/node" "*"
18-
19-
"@types/glob@*":
20-
version "5.0.35"
21-
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a"
22-
dependencies:
23-
"@types/events" "*"
24-
"@types/minimatch" "*"
25-
"@types/node" "*"
26-
27-
"@types/handlebars@^4.0.31":
28-
version "4.0.36"
29-
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79"
30-
31-
"@types/highlight.js@^9.1.8":
32-
version "9.12.2"
33-
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.2.tgz#6ee7cd395effe5ec80b515d3ff1699068cd0cd1d"
34-
359
"@types/jasmine@~2.5.53":
3610
version "2.5.54"
3711
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.5.54.tgz#a6b5f2ae2afb6e0307774e8c7c608e037d491c63"
3812

39-
"@types/lodash@^4.14.37":
40-
version "4.14.97"
41-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.97.tgz#7262d6d5fc5e87cdb3f68eb33accd4024f2b211e"
42-
43-
44-
version "0.0.28"
45-
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.0.28.tgz#44ba754e9fa51432583e8eb30a7c4dd249b52faa"
46-
47-
"@types/minimatch@*":
48-
version "3.0.3"
49-
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
50-
51-
"@types/minimatch@^2.0.29":
52-
version "2.0.29"
53-
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
54-
55-
"@types/node@*", "@types/node@^8.0.28":
13+
"@types/node@^8.0.28":
5614
version "8.5.7"
5715
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.7.tgz#9c498c35af354dcfbca3790fb2e81129e93cf0e2"
5816

5917
"@types/seedrandom@~2.4.27":
6018
version "2.4.27"
6119
resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.27.tgz#9db563937dd86915f69092bc43259d2f48578e41"
6220

63-
"@types/shelljs@^0.7.0":
64-
version "0.7.7"
65-
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.7.tgz#1f7bfa28947661afea06365db9b1135bbc903ec4"
66-
dependencies:
67-
"@types/glob" "*"
68-
"@types/node" "*"
69-
7021
"@types/strip-bom@^3.0.0":
7122
version "3.0.0"
7223
resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2"
@@ -1369,14 +1320,6 @@ fs-access@^1.0.0:
13691320
dependencies:
13701321
null-check "^1.0.0"
13711322

1372-
fs-extra@^4.0.0:
1373-
version "4.0.3"
1374-
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
1375-
dependencies:
1376-
graceful-fs "^4.1.2"
1377-
jsonfile "^4.0.0"
1378-
universalify "^0.1.0"
1379-
13801323
fs.realpath@^1.0.0:
13811324
version "1.0.0"
13821325
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -1485,7 +1428,7 @@ glogg@^1.0.0:
14851428
dependencies:
14861429
sparkles "^1.0.0"
14871430

1488-
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
1431+
graceful-fs@^4.1.2:
14891432
version "4.1.11"
14901433
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
14911434

@@ -1524,7 +1467,7 @@ gulplog@^1.0.0:
15241467
dependencies:
15251468
glogg "^1.0.0"
15261469

1527-
handlebars@^4.0.1, handlebars@^4.0.6, handlebars@~4.0.11:
1470+
handlebars@^4.0.1, handlebars@~4.0.11:
15281471
version "4.0.11"
15291472
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc"
15301473
dependencies:
@@ -1618,7 +1561,7 @@ he@^1.1.1:
16181561
version "1.1.1"
16191562
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
16201563

1621-
[email protected], highlight.js@^9.0.0:
1564+
16221565
version "9.12.0"
16231566
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e"
16241567

@@ -1941,12 +1884,6 @@ [email protected]:
19411884
version "3.3.2"
19421885
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
19431886

1944-
jsonfile@^4.0.0:
1945-
version "4.0.0"
1946-
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
1947-
optionalDependencies:
1948-
graceful-fs "^4.1.6"
1949-
19501887
jsonify@~0.0.0:
19511888
version "0.0.0"
19521889
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@@ -2218,7 +2155,7 @@ lodash@^3.8.0:
22182155
version "3.10.1"
22192156
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
22202157

2221-
lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.4, lodash@^4.5.0:
2158+
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.5.0:
22222159
version "4.17.4"
22232160
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
22242161

@@ -2277,10 +2214,6 @@ markdown-it@^8.4.0:
22772214
mdurl "^1.0.1"
22782215
uc.micro "^1.0.3"
22792216

2280-
marked@^0.3.5:
2281-
version "0.3.9"
2282-
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.9.tgz#54ce6a57e720c3ac6098374ec625fcbcc97ff290"
2283-
22842217
"match-stream@>= 0.0.2 < 1":
22852218
version "0.0.2"
22862219
resolved "https://registry.yarnpkg.com/match-stream/-/match-stream-0.0.2.tgz#99eb050093b34dffade421b9ac0b410a9cfa17cf"
@@ -2770,10 +2703,6 @@ process@^0.11.10, process@~0.11.0:
27702703
version "0.11.10"
27712704
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
27722705

2773-
progress@^2.0.0:
2774-
version "2.0.0"
2775-
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
2776-
27772706
pseudomap@^1.0.2:
27782707
version "1.0.2"
27792708
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
@@ -3130,7 +3059,7 @@ shell-quote@^1.4.2, shell-quote@^1.6.1:
31303059
array-reduce "~0.0.0"
31313060
jsonify "~0.0.0"
31323061

3133-
shelljs@^0.7.0, shelljs@~0.7.8:
3062+
shelljs@~0.7.8:
31343063
version "0.7.8"
31353064
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
31363065
dependencies:
@@ -3588,36 +3517,6 @@ typedarray@~0.0.5:
35883517
version "0.0.6"
35893518
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
35903519

3591-
typedoc-default-themes@^0.5.0:
3592-
version "0.5.0"
3593-
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227"
3594-
3595-
typedoc@~0.8.0:
3596-
version "0.8.0"
3597-
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.8.0.tgz#d7172bc6a29964f451b7609c005beadadefe2361"
3598-
dependencies:
3599-
"@types/fs-extra" "^4.0.0"
3600-
"@types/handlebars" "^4.0.31"
3601-
"@types/highlight.js" "^9.1.8"
3602-
"@types/lodash" "^4.14.37"
3603-
"@types/marked" "0.0.28"
3604-
"@types/minimatch" "^2.0.29"
3605-
"@types/shelljs" "^0.7.0"
3606-
fs-extra "^4.0.0"
3607-
handlebars "^4.0.6"
3608-
highlight.js "^9.0.0"
3609-
lodash "^4.13.1"
3610-
marked "^0.3.5"
3611-
minimatch "^3.0.0"
3612-
progress "^2.0.0"
3613-
shelljs "^0.7.0"
3614-
typedoc-default-themes "^0.5.0"
3615-
typescript "2.4.1"
3616-
3617-
3618-
version "2.4.1"
3619-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc"
3620-
36213520
36223521
version "2.6.1"
36233522
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631"
@@ -3668,10 +3567,6 @@ union@~0.4.3:
36683567
dependencies:
36693568
qs "~2.3.3"
36703569

3671-
universalify@^0.1.0:
3672-
version "0.1.1"
3673-
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
3674-
36753570
[email protected], unpipe@~1.0.0:
36763571
version "1.0.0"
36773572
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"

0 commit comments

Comments
 (0)