Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

GitHub Developer site

License

NotificationsYou must be signed in to change notification settings

github/developer.github.com

 
 

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.

Setup

Ruby 1.9 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.

Styleguide

Not sure how to structure the docs? Here's what the structure of theAPI docs should look like:

# API title* TOC{: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.

JSON Responses

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] }%>

Terminal blocks

You can specify terminal blocks by prefacing ablock element with{:.terminal}.

{:.terminal}    $ curl foobar

Alternatively, you can use plain html and usepre.terminal elements.(If, for example, you need to emphasis text with<em>)

<preclass="terminal">$ curl<em>foobar<em>....</pre>

This is not acurl tutorial though. Not every API call needsto show how to access it withcurl.

Development

Nanoc compiles the site into static files living in./output. It'ssmart enough not to try to compile unchanged files:

$ bundleexec nanoc compileLoading 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.htmlSite compiledin 5.81s.

You can setup whatever you want to view the files. If using the adsfgem (as listed in the Gemfile), you can start Webrick:

$ bundleexec nanoc view$ open http://localhost:3000

Compilation times got you down? Useautocompile!

$ bundleexec nanoc autocompile

This starts a web server too, so there's no need to runnanoc view.One thing: remember to add trailing slashes to all nanoc links!

Deploy

$ bundleexec rake publish

About

GitHub Developer site

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors321


[8]ページ先頭

©2009-2025 Movatter.jp