Update docs config

- Don't ignore built class docs
- pin requirement versions for docs
- update docs build instructions
- update repo URL
This commit is contained in:
Michael Grinich 2017-01-30 12:02:27 -08:00
parent bf0aa51148
commit 8bd013e9e9
6 changed files with 59 additions and 35 deletions

4
.gitignore vendored
View file

@ -13,9 +13,7 @@ npm-debug.log
debug.log
/tags
/electron/
/docs_src/classes/
/_docs_output
spec/fixtures/evil-files/
build/resources/certs

View file

@ -111,6 +111,35 @@ Note these are not tested or officially supported by Nylas, but we still think t
When you install packages, they're moved to ~/.nylas-mail/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json
## Building the docs
Plugin SDK docs are available at [https://nylas.github.io/nylas-mail/](https://nylas.github.io/nylas-mail/). Here's how you build them:
Until my patch gets merged, docs need to be built manually using mg's fork.
git clone git@github.com:grinich/gitbook.git
cd nylas-mail
./node_modules/.bin/gitbook alias ../gitbook latest
Then to actually build the docs:
script/grunt docs
./node_modules/.bin/gitbook --gitbook=latest build . ./_docs_output --log=debug --debug
rm -r docs_src/classes
If you want to preview the docs:
pushd ./_docs_output; python -m SimpleHTTPServer; popd
Just want to publish everything? There's a helper script that does it for you:
script/publish-docs
## Configuration
You can configure Nylas Mail in a few ways—for instance, pointing it to your self-hosted instance of the sync engine or changing the interface zoom level. [Learn more about how.](https://github.com/nylas/nylas-mail/blob/master/CONFIGURATION.md)

View file

@ -16,12 +16,12 @@
"pluginsConfig": {
"editlink": {
"base": "https://github.com/nylas/nylas-mail-docs/tree/master",
"base": "https://github.com/nylas/nylas-mail/tree/master/docs_src",
"label": "Edit This Page",
"multilingual": false
},
"github": {
"url": "https://github.com/nylas/nylas-mail-docs"
"url": "https://github.com/nylas/nylas-mail"
},
"favicon": {
"shortcut": "/img/favicon.png"

View file

@ -45,30 +45,11 @@ Nylas Mail is built on top of Electron, which runs the latest version of Chromiu
Need help? Check out the [FAQ](https://support.nylas.com/hc/en-us) or post a question in the [slack channel](http://slack-invite.nylas.com/).
#### Building these docs
#### TODOs
Until my patch gets merged, docs need to be built manually using my fork.
git clone git@github.com:grinich/gitbook.git
cd nylas-mail
./node_modules/.bin/gitbook alias ../gitbook latest
Then to actually build the docs:
script/grunt docs
./node_modules/.bin/gitbook --gitbook=latest build . ./docs
- Add plugin examples with code (es6 not coffeescript)
- Smart Linkify references. Maybe use something like [gitbook-plugin-regexplace](https://github.com/markomanninen/gitbook-plugin-regexplace)
- Have class reference files link to their actual sourcefiles
- Consider adding infinite scroll
<!-- TODO
Smart Linkify references:
- https://github.com/markomanninen/gitbook-plugin-regexplace
- Figure out why infinitescroll isn't working
- Add examples
-->

View file

@ -115,18 +115,15 @@
"flow-bin": "0.33.0",
"gitbook": "^3.2.2",
"gitbook-cli": "^2.3.0",
"gitbook-core": "^4.0.0-alpha.1",
"gitbook-plugin-anchors": "^0.7.1",
"gitbook-plugin-editlink": "^1.0.2",
"gitbook-plugin-favicon": "0.0.2",
"gitbook-plugin-github": "^2.0.0",
"gitbook-plugin-infinitescroll": "^0.1.0",
"gitbook-plugin-theme-api": "^1.1.2",
"gitbook-plugin-theme-faq": "^1.2.1",
"grunt-gitbook": "^1.5.0",
"handlebars": "4.0.6",
"joanna": "0.0.8",
"meta-marked": "^0.4.2",
"tello": "^1.0.6"
"meta-marked": "0.4.2",
"tello": "1.0.6"
},
"optionalDependencies": {
"node-mac-notifier": "0.0.13"

19
script/publish-docs Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
set -e
# Builds docs and moves the output to gh-pages branch (overwrites)
mkdir -p _docs_output
script/grunt docs
./node_modules/.bin/gitbook --gitbook=latest build . ./_docs_output --log=debug --debug
rm -r docs_src/classes
git checkout gh-pages --quiet
cp -rf _docs_output/* .
# rm -r _docs_output
git add .
git status -s
printf "\nDocs updated! \n\n"
git commit -m 'Update Docs'
git push origin gh-pages
git checkout master