- Notifications
You must be signed in to change notification settings - Fork0
rubythonode/developer.github.com
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a GitHub API resource built withNanoc.
All submissions are welcome. To submit a change, fork this repo, commit your changes, and send us apull request.
Ruby 2.2 is required to build the site.
Get the Nanoc gem, plus kramdown for Markdown parsing:
$ bundle install
You can see the available commands with Nanoc:
$ bundleexec nanoc -h
Nanoc hassome nice documentation to get you started. Though if you're mainly concerned with editing or adding content, you won't need to know much about Nanoc.
Not sure how to structure the docs? Here's what the structure of theAPI docs should look like:
# API title{:toc}## API endpoint title [VERB] /path/to/endpoint### ParametersName | Type | Description-----|------|--------------`name`|`type` | Description.### Input (request JSON body)Name | Type | Description-----|------|--------------`name`|`type` | Description.### Response<%= headers 200, :pagination => default_pagination_rels, 'X-Custom-Header' => "value" %><%= json :resource_name %>
Note: We're usingKramdown Markdown extensions, such as definition lists.
We specify the JSON responses in Ruby so that we don't have to writethem by hand all over the docs. You can render the JSON for a resourcelike this:
<%= json :issue%>
This looks upGitHub::Resources::ISSUE
inlib/resources.rb
.
Some actions return arrays. You can modify the JSON by passing a block:
<%= json(:issue) { |hash| [hash] }%>
You can specify terminal blocks by using thecommand-line
syntax highlighting.
``` command-line$ curl foobar```
You can use certain characters, like$
and#
, to emphasize different partsof commands.
``` command-line# call foobar$ curl <em>foobar<em>....```
For more information, seethe reference documentation.
You can fetch the latest dependencies by opening the command line and runningscript/bootstrap
:
$ script/bootstrap==> Installing gem dependencies…==> Installing npm dependencies…
You'll need Ruby 2.2.3 and at least Node v4.x.
You can runbundle exec rake build
to generate the site, but it's often more usefulto simply build the serverand start the site at the same time.
Nanoc compiles the site into static files living in./output
. It'ssmart enough not to try to compile unchanged files.
You can start the site withscript/server
:
$ script/serverLoading site data...Compiling site... identical [0.00s] output/css/960.css identical [0.00s] output/css/pygments.css identical [0.00s] output/css/reset.css identical [0.00s] output/css/styles.css identical [0.00s] output/css/uv_active4d.css update [0.28s] output/index.html update [1.31s] output/v3/gists/comments/index.html update [1.92s] output/v3/gists/index.html update [0.25s] output/v3/issues/comments/index.html update [0.99s] output/v3/issues/labels/index.html update [0.49s] output/v3/issues/milestones/index.html update [0.50s] output/v3/issues/index.html update [0.05s] output/v3/index.html …Site compiledin 5.81s.
The site is hosted athttp://localhost:4000
.
$ bundleexec rake publish
About
GitHub Developer site
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Ruby60.5%
- HTML20.5%
- CSS12.1%
- JavaScript6.0%
- Shell0.9%