Skip to content

Commit 3905606

Browse files
committed
Merge pull request watson-developer-cloud#180 from watson-developer-cloud/jsdoc
Automatically generate docs
2 parents d3ba0fa + dcbed63 commit 3905606

File tree

75 files changed

+13740
-65
lines changed

Some content is hidden

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

75 files changed

+13740
-65
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ test/resources/auth.js
66
test/integration/
77
test/resources/tts-output.ogg
88
.idea
9+
doc/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ examples
1212
LICENSE
1313
CONTRIBUTING.md
1414
RELEASE.md
15+
jsdoc/
16+
doc/

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ node_js:
66
- stable
77
script:
88
- npm test
9+
- npm run doc
910
after_success:
1011
- npm run coveralls
12+
- jsdoc/publish.sh
1113
before_install:
12-
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_cb4d3d070e32_key -iv $encrypted_cb4d3d070e32_iv -in auth.js.enc -out test/resources/auth.js -d || true'
14+
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_cb4d3d070e32_key
15+
-iv $encrypted_cb4d3d070e32_iv -in auth.js.enc -out test/resources/auth.js -d ||
16+
true'
17+
env:
18+
global:
19+
secure: I50FnfubwiZlol5Qs9tXPVACGbs+SG2dJLjpbzeio0Hl666d/hDuvf7IFwqqaRjQkmK2TdIjaGLMOgHxh/GGAoYf7LfZqjDID/tAhgoFOYiZwiPj66Z82F9P9cega2nkNW+125NzPuU3rhSCByG8+K/PMH/5JxPwPMoAYNLQjWc=

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ or [Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-watson).
1616
```
1717
* commits should start with the service name and end with the issue #
1818
```
19-
[DC] Add conversion to html #13
19+
[concept-insights] Added functionality to list the graphs #135
2020
```
2121

2222
# Issues

jsdoc/config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"source": {
3+
"include": [ "lib/", "services/" ]
4+
},
5+
"opts": {
6+
"package": "package.json",
7+
"readme": "README.md",
8+
"recurse": true,
9+
"template": "jsdoc/template",
10+
"destination": "./doc/"
11+
}
12+
}

jsdoc/publish.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# based on http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
4+
# todo: add && [ "$TRAVIS_TAG" != "" ] after confirming it works otherwise
5+
6+
if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/node-sdk" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_TAG" ]; then
7+
8+
echo "Publishing JSDoc..."
9+
10+
git config --global user.email "[email protected]"
11+
git config --global user.name "travis-ci"
12+
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/watson-developer-cloud/node-sdk gh-pages > /dev/null
13+
14+
pushd gh-pages
15+
cp -Rf ../doc/watson-developer-cloud/* ./
16+
git add -f .
17+
git commit -m "JSDdoc for $TRAVIS_TAG"
18+
git push -fq origin gh-pages > /dev/null
19+
popd
20+
21+
echo -e "Published JSDoc for $TRAVIS_TAG to gh-pages.\n"
22+
23+
else
24+
25+
echo -e "Not publishing docs for tag $TRAVIS_TAG on branch $TRAVIS_BRANCH of repo $TRAVIS_REPO_SLUG"
26+
27+
fi

jsdoc/template/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template).
2+
3+
4+
## Generating Typeface Fonts
5+
6+
The default template uses the [OpenSans](https://www.google.com/fonts/specimen/Open+Sans) typeface. The font files can be regenerated as follows:
7+
8+
1. Open the [OpenSans page at Font Squirrel](<http://www.fontsquirrel.com/fonts/open-sans>).
9+
2. Click on the 'Webfont Kit' tab.
10+
3. Either leave the subset drop-down as 'Western Latin (Default)', or, if we decide we need more glyphs, than change it to 'No Subsetting'.
11+
4. Click the 'DOWNLOAD @FONT-FACE KIT' button.
12+
5. For each typeface variant we plan to use, copy the 'eot', 'svg' and 'woff' files into the 'templates/default/static/fonts' directory.

0 commit comments

Comments
 (0)