Permalink
Browse files

[refactor] Move around files to generate handbook site from the lates…

…t blacksmith
  • Loading branch information...
1 parent 47e6394 commit 5c1125dbf9770d58cc256a8c8b2bcde55095916d @indexzero indexzero committed Nov 25, 2012
Showing with 118 additions and 601 deletions.
  1. +39 −0 .blacksmith
  2. +0 −130 Makefile
  3. +2 −2 ReadMe.md
  4. +0 −31 appendices/building_the_handbook.md
  5. +0 −136 appendices/mailchimp.md
  6. +0 −7 appendices/toc.md
  7. +0 −6 bin/deploy.sh
  8. +0 −19 bin/server
  9. +0 −187 chapters/json_api.md
  10. +0 −15 chapters/toc.md
  11. +0 −15 chapters/toc.readme.md
  12. +0 −4 chapters/troubleshooting.md
  13. 0 {chapters → content/articles/a-quickstart}/faq.md
  14. 0 chapters/platform_features.md → content/articles/a-quickstart/features.md
  15. 0 chapters/hello_world.md → content/articles/a-quickstart/hello-world.md
  16. 0 content/articles/a-quickstart/index.md
  17. 0 API.md → content/articles/api/index.md
  18. +2 −2 {chapters → content/articles/api}/webhooks.md
  19. 0 {chapters → content/articles/appendix}/haibu.md
  20. 0 chapters/open_source_projects.md → content/articles/appendix/open-source.md
  21. 0 {appendices → content/articles/appendix}/package.json.md
  22. 0 {appendices → content/articles/appendix}/resources.md
  23. 0 chapters/jitsu.md → content/articles/jitsu/index.md
  24. 0 {chapters → content/articles}/support.md
  25. 0 chapters/web_admin.md → content/articles/webops/index.md
  26. 0 chapters/introduction.md → content/index.md
  27. +62 −0 layouts/default.html
  28. BIN pages/cover.jpg
  29. +0 −28 pages/head.html
  30. +0 −3 pages/tail.html
  31. +0 −16 pages/title.md
  32. +6 −0 partials/article.html
  33. +7 −0 partials/topic.html
  34. BIN { → public/img}/fig/api_key_popup.png
  35. BIN { → public/img}/fig/api_keys.png
  36. BIN { → public/img}/fig/api_keys_dropdown.png
  37. BIN { → public/img}/fig/dashboard_help.png
  38. BIN { → public/img}/fig/deploy.png
  39. BIN { → public/img}/fig/landing_page.png
  40. BIN { → public/img}/fig/mailing_lists.png
  41. BIN { → public/img}/fig/nodejitsu_dashboard.png
  42. BIN { → public/img}/fig/nodejitsu_dashboard_api_key.png
  43. BIN { → public/img}/fig/signup_page.png
  44. BIN { → public/img}/fig/webapp.png
View
@@ -0,0 +1,39 @@
+{
+ "pages": {
+ "index": {
+ "partial": "article",
+ "partials": {
+ "toc": {
+ "partial": "topic",
+ "tree": "article",
+ "truncate": true,
+ "sort": [
+ "a-quickstart",
+ "jitsu",
+ "webops",
+ "support",
+ "api",
+ "appendix"
+ ]
+ }
+ }
+ },
+ "article": {
+ "partials": {
+ "toc": {
+ "partial": "topic",
+ "tree": "article",
+ "truncate": true,
+ "sort": [
+ "a-quickstart",
+ "jitsu",
+ "webops",
+ "support",
+ "api",
+ "appendix"
+ ]
+ }
+ }
+ }
+ }
+}
View
130 Makefile
@@ -1,130 +0,0 @@
-# Makefile originally from the 'Mastering Node' book written TJ Holowaychuk
-# https://github.com/visionmedia/masteringnode
-#
-
-PDF_FLAGS = --fontsize 9.0 \
- --linkstyle plain \
- --linkcolor blue \
- --embedfonts \
- --footer "c 1" \
- --no-toc
-
-MD = pages/title.md \
- chapters/toc.md \
- chapters/introduction.md \
- chapters/hello_world.md \
- chapters/platform_features.md \
- chapters/jitsu.md \
- chapters/web_admin.md \
- chapters/webhooks.md \
- chapters/json_api.md \
- chapters/haibu.md \
- chapters/open_source_projects.md \
- chapters/faq.md \
- chapters/support.md \
- appendices/toc.md \
- appendices/package.json.md \
- appendices/resources.md \
- appendices/building_the_handbook.md
-
-README = pages/title.md \
- chapters/toc.readme.md \
- chapters/introduction.md \
- chapters/hello_world.md \
- chapters/platform_features.md \
- chapters/jitsu.md \
- chapters/web_admin.md \
- chapters/webhooks.md \
- chapters/json_api.md \
- chapters/haibu.md \
- chapters/open_source_projects.md \
- chapters/faq.md \
- chapters/support.md
-
-API = chapters/json_api.md
-
-HTML = $(MD:.md=.html)
-
-all: book.html book.pdf book.md ReadMe.md API.md website clear
-
-regenerate: clean all
- git commit -a -m '[dist] Regenerated handbook' && echo done
-
-publish: clean all
- git commit -am '[dist] Regenerated handbook'
- git push origin master
- ./bin/deploy.sh
-
-book.pdf: $(HTML)
- @echo "\n... generating $@"
- htmldoc --webpage -f $@ $(PDF_FLAGS) $(HTML)
-
-book.md: $(HTML)
- @echo "\n... generating $@"
- cat $(MD) > book.md
-
-ReadMe.md: $(HTML)
- @echo "\n... generating $@"
- cat $(README) > ReadMe.md
-
-API.md: $(HTML)
- @echo "\n... generating $@"
- cat $(API) > API.md
-
-book.html: pages/head.html pages/tail.html $(HTML)
- @echo "\n... generating $@"
- @echo $(HTML)
- cat pages/head.html $(HTML) pages/tail.html > book.html
-
-public:
- mkdir public
-
-website: book.html public
- @echo "\n... copying items into ./public"
- cp book.html public/index.html
- cp book.pdf public/book.pdf
- cp -r fig public/fig
-
-serve: website
- @echo "\n... serving website!"
- node ./bin/server
-
-#
-# -r doesnt work on osx, use -E
-#
-%.html: %.md
- ronn --pipe --fragment $< \
- | sed -r 's/<h1>([^ ]+) - /<h1>/' \
- > $@
-
-book.mobi:
- @echo "\n... generating $@"
- ebook-convert book.html book.mobi --output-profile kindle
-
-book.epub:
- @echo "\n... generating $@"
- ebook-convert book.html book.epub \
- --title "Nodejitsu Handbook" \
- --no-default-epub-cover \
- --authors "Marak Squires, Joshua Holbrook" \
- --language en \
- --cover pages/cover.jpg
-
-view: book.pdf
- open book.pdf
-
-clean:
- rm -f book.*
- rm -f chapters/*.html
- rm -f appendices/*.html
- rm -f pages/index.html
- rm -f pages/title.html
- rm -rf public
-
-clear:
- rm -f chapters/*.html
- rm -f appendices/*.html
- rm -f pages/index.html
- rm -f pages/title.html
-
-.PHONY: view clean regenerate
View
@@ -620,7 +620,7 @@ There's several ways to access the deployment status in the Nodejitsu Webhook AP
The most fun way to monitor your deployment is with the realtime status changes feed.
-``` sh
+``` bash
# if your username is foo and password is bar this would be
# https://foo:bar@webhooks.nodejitsu.com/1/status/foo/changes
curl https://username:password@webhooks.nodejitsu.com/1/status/username/changes?include_docs=auto
@@ -668,7 +668,7 @@ If you authorize access so we can use your github account we can do more fun stu
To authorize simply do:
-``` sh
+``` bash
curl -X POST \
-H "Content-type: application/json" \
--data "{ \"credentials\": githubUser:githubPassword }" \
@@ -1,31 +0,0 @@
-# Appendix: Building the Nodejitsu Handbook
-<a name='apx:build'></a>
-
-## Dependencies
-
-The build process for the handbook has a few dependencies:
-
-* [make](http://en.wikipedia.org/wiki/Make_\(software\))
-* [ronn](https://github.com/rtomayko/ronn)
-* [htmldoc](http://www.htmldoc.org/)
-
-Make and htmldoc should be available via your operating system's package manager
-(ie. apt-get). ronn is available on [rubygems](http://rubygems.org/), which in
-turn should be available via your operating system's package manager as well. On
-Debian-based systems, the rubygems package does not add its bin folder
-(`/var/lib/gems/1.8/bin`) to your $PATH variable, so add something
-like:
-
- PATH="/var/lib/gems/1.8/bin:$PATH"
-
-
-to the end of your `~/.profile` file and activate it by running `. ~/.profile`.
-
-## Build Process
-
-Once you've installed the dependencies, all you have to do is:
-
- $ make
-
-and the files `./book.md`, `book.pdf`, `book.html`, `API.md` and `ReadMe.md`
-should all be generated.
View
@@ -1,136 +0,0 @@
-# Appendix: Mailchimp Integration in Nodejitsu
-<a name="apx:mailchimp"></a>
-
-Nodejitsu features integration with [MailChimp](http://mailchimp.com). What is
-MailChimp? In their [own words](http://mailchimp.com/about/):
-
-> MailChimp makes it easy to design exceptional email campaigns, share them on
-> social networks, integrate with web services you already use, manage
-> subscribers and track your results. You'll love mixing and matching
-> MailChimp's templates, features and integrations to suit your needs—think of
-> it as your own personal newsletter publishing platform.
-
-But what about integration? MailChimp integration with Nodejitsu means that you
-can interact with your MailChimp lists using the same Nodejitsu API that you use
-to interact with your apps!
-
-## Getting Started
-
-In order to set up the MailChimp integration, you have to
-[sign up for MailChimp](http://mailchimp.com/signup) at
-[their web site](http://mailchimp.com):
-
-![](https://github.com/nodejitsu/handbook/raw/master/fig/signup_page.png)
-
-Once you sign up for MailChimp, they can help you get your bearings so you can
-get to managing e-mail campaigns quick:
-
-![](https://github.com/nodejitsu/handbook/raw/master/fig/dashboard_help.png)
-
-But, in order to integrate with Nodejitsu, what you need is an API key. The
-easiest way to get an API key *right now* is to visit
-<https://admin.mailchimp.com/account/api-key-popup>:
-
-![](https://github.com/nodejitsu/handbook/raw/master/fig/api_key_popup.png)
-
-All you have to do to link your MailChimp account with your Nodejitsu account
-is to copy-and-paste this API key into Nodejitsu's web application interface:
-
-![](https://github.com/nodejitsu/handbook/raw/master/fig/nodejitsu_dashboard_api_key.png)
-
-Now you're good to go! Nodejitsu reports that I have one mailing list, and that
-the two subscribers are Josh's mother and himself.
-
-![](https://github.com/nodejitsu/handbook/raw/master/fig/nodejitsu_dashboard.png)
-
-## Interacting with your lists via the Nodejitsu JSON API: A Broad Overview
-
-Like the rest of Nodejitsu's features, addon functionality can be accessed using
-Nodejitsu's JSON API. For example, here's what happens when you get
-`/addons/:user-id`:
-
- $ curl --user 'jesusabdullah:abc123' https://api.nodejitsu.com/addons/jesusabdullah/
-
-
- { "_id": "jesusabdullah",
- "username": "jesusabdullah",
- "password-salt": "************",
- "password": "********************************",
- "email": "josh.holbrook@gmail.com",
- "addons-mailchimp-apikey": "********************************-us2",
- "_rev": "3-2df3731e8cc48d8e11511096dad140e8",
- "status": "active",
- "inviteCode": "***********",
- "resource": "User" }
-
-In order to interact with the MailChimp add-on in particular, use the
-`/addons/:user-id/signups` resource:
-
- $ curl --user 'jesusabdullah:abc123' https://api.nodejitsu.com/addons/jesusabdullah/signups
-
-
- { "lists":
- { "total": 1,
- "data":
- [ { "id": "f3b7d6450c",
- "web_id": 646837,
- "name": "Example Mailing List",
- "date_created": "2011-07-26 01:06:42",
- "email_type_option": false,
- "use_awesomebar": true,
- "default_from_name": "Joshua Holbrook",
- "default_from_email": "josh.holbrook@gmail.com",
- "default_subject": "Relevant AND Non-Spammy!",
- "default_language": "en",
- "list_rating": 0,
- "stats":
- { "member_count": 2,
- "unsubscribe_count": 0,
- "cleaned_count": 0,
- "member_count_since_send": 3,
- "unsubscribe_count_since_send": 0,
- "cleaned_count_since_send": 0,
- "campaign_count": 0,
- "grouping_count": 0,
- "group_count": 0,
- "merge_var_count": 0,
- "avg_sub_rate": null,
- "avg_unsub_rate": null,
- "target_sub_rate": null,
- "open_rate": null,
- "click_rate": null },
- "modules": [] } ] } }
-
-You can use the list ID to access the particular list information with
-`/addons/:user-id/signups/:list-id/`:
-
- curl --user 'jesusabdullah:abc123' https://api.nodejitsu.com/addons/jesusabdullah/signups/f3b7d6450c
-
-
- { "total": 2,
- "data":
- [ { "email": "holbrook@*********.net",
- "timestamp": "2011-07-26 01:08:11" },
- { "email": "josh@nodejitsu.com",
- "timestamp": "2011-07-26 01:09:11" } ] }
-
-This confirms that Josh is in the example list.
-
-## More API Commands:
-
-* **Retrieve your API key:**
-
- GET /addons/:user-id/signups/apikey/
-
-* **Set your API key:**
-
- PUT /addons/:user-id/signups/apikey/
-
-* **Subscribe to a list:**
-
- POST /addons/:user-id/signups/:list-id/subscribe/
-
-* **Unsubscribe from a list:**
-
- POST /addons/:user-id/signups/:list-id/unsubscribe/
-
View
@@ -1,7 +0,0 @@
-# Table of Appendices
-<a name="apx"></a>
-
-* [package.json](https://github.com/nodejitsu/handbook/blob/master/book.md#apx:package)
-* [Resources](https://github.com/nodejitsu/handbook/blob/master/book.md#apx:resources)
-* [Building The Handbook](https://github.com/nodejitsu/handbook/blob/master/book.md#apx:build)
-
View
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-if [ "nodejitsu" != $(jitsu whoami) ]; then
- jitsu login --username nodejitsu
-fi
-jitsu deploy
View
@@ -1,19 +0,0 @@
-#!/usr/bin/env node
-
-var httpServer = require('http-server'),
- path = require('path');
-
-var port = 8000,
- host = '0.0.0.0',
- root = path.resolve(__dirname, '../public');
-
-var server = httpServer.createServer({
- root: root,
- autoIndex: false,
- cache: true
-});
-
-server.listen(port, host, function () {
- console.log(root);
- console.log('Now hosting the handbook on http://%s:%s', host, port);
-});
Oops, something went wrong.

0 comments on commit 5c1125d

Please sign in to comment.