diff --git a/.gitignore b/.gitignore index 621f4cc81..c6e84d5ca 100644 --- a/.gitignore +++ b/.gitignore @@ -13,9 +13,7 @@ npm-debug.log debug.log /tags /electron/ - - -/docs_src/classes/ +/_docs_output spec/fixtures/evil-files/ build/resources/certs diff --git a/README.md b/README.md index 5020010a6..acc742330 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/book.json b/book.json index 757e3c669..613d5e759 100644 --- a/book.json +++ b/book.json @@ -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" diff --git a/docs_src/README.md b/docs_src/README.md index 5745c9419..60776e52a 100644 --- a/docs_src/README.md +++ b/docs_src/README.md @@ -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 - - diff --git a/package.json b/package.json index 1060ff44e..f9e0a48e8 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/script/publish-docs b/script/publish-docs new file mode 100755 index 000000000..33383596f --- /dev/null +++ b/script/publish-docs @@ -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