Skip to content

Commit c0a7f0b

Browse files
committed
Merge remote-tracking branch 'origin/master' into deployments
2 parents 7ea4216 + f73eb8f commit c0a7f0b

66 files changed

Lines changed: 1240 additions & 575 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 63 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ All submissions are welcome. To submit a change, fork this repo, commit your cha
88

99
Ruby 1.9 is required to build the site.
1010

11-
Get the nanoc gem, plus kramdown for markdown parsing:
11+
Get the nanoc gem, plus kramdown for Markdown parsing:
1212

13-
bundle install
13+
```sh
14+
$ bundle install
15+
```
1416

1517
You can see the available commands with nanoc:
1618

17-
nanoc -h
19+
```sh
20+
$ bundle exec nanoc -h
21+
```
1822

1923
Nanoc has [some nice documentation](http://nanoc.ws/docs/tutorial/) to get you started. Though if you're mainly concerned with editing or adding content, you won't need to know much about nanoc.
2024

@@ -27,29 +31,35 @@ API docs should look like:
2731

2832
# API title
2933

34+
* TOC
35+
{:toc}
36+
3037
## API endpoint title
3138

32-
[VERB] /path/to/endpoint.json
39+
[VERB] /path/to/endpoint
3340

3441
### Parameters
3542

36-
name
37-
: description
43+
Name | Type | Description
44+
-----|------|--------------
45+
`name`|`type` | Description.
3846

39-
### Input (request json body)
47+
### Input (request JSON body)
4048

41-
<%= json :field => "sample value" %>
49+
Name | Type | Description
50+
-----|------|--------------
51+
`name`|`type` | Description.
4252

4353
### Response
4454

45-
<%= headers 200, :pagination => true, 'X-Custom-Header' => "value" %>
55+
<%= headers 200, :pagination => default_pagination_rels, 'X-Custom-Header' => "value" %>
4656
<%= json :resource_name %>
4757

4858
**Note**: We're using [Kramdown Markdown extensions](http://kramdown.rubyforge.org/syntax.html), such as definition lists.
4959

5060
### JSON Responses
5161

52-
We specify the JSON responses in ruby so that we don't have to write
62+
We specify the JSON responses in Ruby so that we don't have to write
5363
them by hand all over the docs. You can render the JSON for a resource
5464
like this:
5565

@@ -67,57 +77,67 @@ Some actions return arrays. You can modify the JSON by passing a block:
6777

6878
### Terminal blocks
6979

70-
You can specify terminal blocks with `pre.terminal` elements. It'd be
71-
nice if Markdown could do this more cleanly...
80+
You can specify terminal blocks with `pre.terminal` elements. (It'd be
81+
nice if Markdown could do this more cleanly.)
7282

73-
<pre class="terminal">
74-
$ curl foobar
75-
....
76-
</pre>
83+
```html
84+
<pre class="terminal">
85+
$ curl foobar
86+
....
87+
</pre>
88+
```
7789

78-
This isn't a `curl` tutorial though, I'm not sure every API call needs
90+
This is not a `curl` tutorial though. Not every API call needs
7991
to show how to access it with `curl`.
8092

8193
## Development
8294

8395
Nanoc compiles the site into static files living in `./output`. It's
8496
smart enough not to try to compile unchanged files:
8597

86-
$ nanoc compile
87-
Loading site data...
88-
Compiling site...
89-
identical [0.00s] output/css/960.css
90-
identical [0.00s] output/css/pygments.css
91-
identical [0.00s] output/css/reset.css
92-
identical [0.00s] output/css/styles.css
93-
identical [0.00s] output/css/uv_active4d.css
94-
update [0.28s] output/index.html
95-
update [1.31s] output/v3/gists/comments/index.html
96-
update [1.92s] output/v3/gists/index.html
97-
update [0.25s] output/v3/issues/comments/index.html
98-
update [0.99s] output/v3/issues/labels/index.html
99-
update [0.49s] output/v3/issues/milestones/index.html
100-
update [0.50s] output/v3/issues/index.html
101-
update [0.05s] output/v3/index.html
102-
103-
Site compiled in 5.81s.
104-
105-
You can setup whatever you want to view the files. If you have the adsf
106-
gem, however (I hope so, it was in the Gemfile), you can start Webrick:
107-
108-
$ nanoc view
109-
$ open http://localhost:3000
98+
```sh
99+
$ bundle exec nanoc compile
100+
Loading site data...
101+
Compiling site...
102+
identical [0.00s] output/css/960.css
103+
identical [0.00s] output/css/pygments.css
104+
identical [0.00s] output/css/reset.css
105+
identical [0.00s] output/css/styles.css
106+
identical [0.00s] output/css/uv_active4d.css
107+
update [0.28s] output/index.html
108+
update [1.31s] output/v3/gists/comments/index.html
109+
update [1.92s] output/v3/gists/index.html
110+
update [0.25s] output/v3/issues/comments/index.html
111+
update [0.99s] output/v3/issues/labels/index.html
112+
update [0.49s] output/v3/issues/milestones/index.html
113+
update [0.50s] output/v3/issues/index.html
114+
update [0.05s] output/v3/index.html
115+
116+
Site compiled in 5.81s.
117+
```
118+
119+
You can setup whatever you want to view the files. If using the adsf
120+
gem (as listed in the Gemfile), you can start Webrick:
121+
122+
```sh
123+
$ bundle exec nanoc view
124+
$ open http://localhost:3000
125+
```
110126

111127
Compilation times got you down? Use `autocompile`!
112128

113-
$ nanoc autocompile
129+
```sh
130+
$ bundle exec nanoc autocompile
131+
```
114132

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

118136
## Deploy
119137

120-
$ rake publish
138+
```sh
139+
$ bundle exec rake publish
140+
```
121141

122142
## TODO
123143

Rakefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ task :compile do
55
`nanoc compile`
66
end
77

8-
# prompt user for a commit message; default: HEAD commit 1-liner
8+
# Prompt user for a commit message; default: P U B L I S H :emoji:
99
def commit_message
10-
last_commit = `git log -1 --pretty=format:"%s"`.chomp.strip
11-
last_commit = 'Publishing developer content to GitHub pages.' if last_commit == ''
10+
publish_emojis = [':boom:', ':rocket:', ':metal:', ':bulb:', ':zap:',
11+
':sailboat:', ':gift:', ':ship:', ':shipit:', ':sparkles:', ':rainbow:']
12+
default_message = "P U B L I S H #{publish_emojis.sample}"
1213

13-
print "Enter a commit message (default: '#{last_commit}'): "
14+
print "Enter a commit message (default: '#{default_message}'): "
1415
STDOUT.flush
1516
mesg = STDIN.gets.chomp.strip
1617

17-
mesg = last_commit if mesg == ''
18-
mesg.gsub(/'/, '') # to allow this to be handed off via -m '#{message}'
18+
mesg = default_message if mesg == ''
19+
mesg.gsub(/'/, '') # Allow this to be handed off via -m '#{message}'
1920
end
2021

2122
desc "Publish to http://developer.github.com"

Rules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
# item, use the pattern “/about/*/”; “/about/*” will also select the parent,
1111
# because “*” matches zero or more characters.
1212

13+
# Reset search-index by deleting it every time
14+
preprocess do
15+
File.delete("output/search-index.json") if File.exists?("output/search-index.json")
16+
end
17+
1318
compile '/static/*' do
1419
end
1520

@@ -22,6 +27,7 @@ compile '/feed/' do
2227
end
2328

2429
compile '/v3/*' do
30+
filter :search
2531
filter :erb
2632
filter :kramdown, :toc_levels => [2]
2733
filter :colorize_syntax,

content/changes/2012-12-08-finding-source-and-fork-repos-for-organizations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
We've made a couple of changes today to the Organization repositories
99
listing to bring it a bit closer to the functionality of the GitHub.com
1010
Organization repositories tab. We now let you retrieve repositories
11-
which are forks of another repo, as well as those repositories which
11+
which are forks of another repository, as well as those repositories which
1212
are sources (not forks).
1313

1414
# Grab all fork Repositories for an Organization

content/changes/2013-04-25-deprecating-merge-commit-sha.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
attribute](/v3/pulls/#mergability) for improved understanding.
1717

1818
To protect future API consumers from this confusion, we have
19-
[deprecated](/v3/#deprecations) the `merge_commit_sha` attribute, and we will
19+
[deprecated](/v3/versions/#v3-deprecations) the `merge_commit_sha` attribute, and we will
2020
remove it in the next major version of the API.
2121

2222
As always, if you have any questions or feedback, please drop us a line at
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
kind: change
3+
title: Paginated results for organization members
4+
created_at: 2013-12-13
5+
author_name: pengwynn
6+
---
7+
8+
The [organization members][members] and [organization public members][public
9+
members] methods will soon return paginated results by default. Beginning
10+
today, these methods will paginate if you include `page` or `per_page` query
11+
parameters. Starting January 15th, 2014, these methods will _always_ return paginated
12+
results.
13+
14+
As always, be sure and follow those [Link headers][paginating] to get
15+
subsequent results. If you have any questions or run into trouble, feel free to
16+
[get in touch][contact].
17+
18+
Happy paginating.
19+
20+
21+
[members]: http://developer.github.com/v3/orgs/members/#members-list
22+
[public members]: http://developer.github.com/v3/orgs/members/#public-members-list
23+
[paginating]: http://developer.github.com/v3/#pagination
24+
[contact]: https://github.com/contact?form[subject]=API+v3:+Paginating+org+members
25+

content/guides/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authentication, to manipulating results, to combining results with other service
1111

1212
Every tutorial here will have a project, and every project will be
1313
stored and documented in our public
14-
[platform-samples](https://github.com/github/platform-samples) repo.
14+
[platform-samples](https://github.com/github/platform-samples) repository.
1515

1616
Feel free to fork, clone, and improve these guides.
1717

content/index.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,21 @@ GitHub in your app</h1>
1313

1414
<div class="full-width-divider">
1515
<ul class="wrapper highlights">
16-
<li>
17-
<h2>Get Started</h2>
16+
<li class="highlight-module">
17+
<a href="/guides/"><span class="mega-icon octicon-file-text"></span></a>
18+
<h2><a href="/guides/">Get Started</a></h2>
1819
<p>New to the GitHub API? With these guides you’ll be up and running in a snap.</p>
19-
<a href="/guides/" class="button-secondary">View introduction guides</a>
20-
<img class="octocat professorcat" src="/shared/images/professorcat.png">
2120
</li>
22-
<li>
23-
<h2>Libraries</h2>
21+
<li class="highlight-module">
22+
<a href="/libraries/"><span class="mega-icon octicon-code"></span></a>
23+
<h2><a href="/libraries/">Libraries</a></h2>
2424
<p>We’ve got you covered. Use the GitHub API in your favorite language.</p>
25-
<a href="/libraries/" class="button-secondary">Browse libraries</a>
26-
<img class="octocat" src="/shared/images/gundamcat-small.png">
2725
</li>
28-
<li>
29-
<h2>Support</h2>
26+
<li class="highlight-module">
27+
<a href="http://github.com/contact"><span class="mega-icon octicon-mail-read"></span></a>
28+
<h2><a href="http://github.com/contact">Support</a></h2>
3029
<p>Are you stuck? Already tried our <a href="/v3/troubleshooting/">troubleshooting guide</a>? Talk to a supportocat.</p>
31-
<a href="http://github.com/contact" class="button-secondary">Get in touch</a>
32-
<img class="octocat" src="/shared/images/supportocat.png">
3330
</li>
3431
3532
</ul>
3633
</div>
37-

content/libraries.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ many flavors</h1>
7171
is part of the [GitHub Mylyn Connector](https://github.com/eclipse/egit-github) and aims to support the entire
7272
GitHub v3 API. Builds are available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22org.eclipse.egit.github.core%22).
7373
* [GitHub API for Java (org.kohsuke.github)](http://github-api.kohsuke.org/) defines an object oriented representation of the GitHub API.
74+
* [JCabi GitHub API](http://github.jcabi.com) is based on Java7 JSON API (JSR-353), simplifies tests with a runtime GitHub stub, and
75+
covers the entire API.
7476

7577
## JavaScript
7678

0 commit comments

Comments
 (0)