Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit dcd1e1d

Browse files
committed
Merge pull request #868 from Shredder121/syntax-highlight-blocks
Use better code blocks for syntax highlighting
2 parents 6ada9db + 2118748 commit dcd1e1d

7 files changed

Lines changed: 225 additions & 243 deletions

content/changes/2013-08-20-search-api-improvements.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,26 @@ Now, you can also [get this metadata][code-text-matches] for matches that occur
1414

1515
For example, when [searching for files that have "client" in their path][example-path-search], the results include this match for `lib/octokit/client/commits.rb`:
1616

17-
<pre class="json">
18-
{
19-
"name": "commits.rb",
20-
"path": "lib/octokit/client/commits.rb",
21-
"text_matches": [
17+
{:.json}
2218
{
23-
"object_url": "https://api.github.com/repositories/417862/contents/lib/octokit/client/commits.rb?ref=8d487ab06ccef463aa9f5412a56f1a2f1fa4dc88",
24-
"object_type": "FileContent",
25-
"property": "path",
26-
"fragment": "lib/octokit/client/commits.rb",
27-
"matches": [
19+
"name": "commits.rb",
20+
"path": "lib/octokit/client/commits.rb",
21+
"text_matches": [
2822
{
29-
"text": "client",
30-
"indices": [ 12, 18 ]
23+
"object_url": "https://api.github.com/repositories/417862/contents/lib/octokit/client/commits.rb?ref=8d487ab06ccef463aa9f5412a56f1a2f1fa4dc88",
24+
"object_type": "FileContent",
25+
"property": "path",
26+
"fragment": "lib/octokit/client/commits.rb",
27+
"matches": [
28+
{
29+
"text": "client",
30+
"indices": [ 12, 18 ]
31+
}
32+
]
3133
}
3234
]
35+
// ...
3336
}
34-
]
35-
// ...
36-
}
37-
</pre>
3837

3938
## Better Text Match Metadata
4039

@@ -45,23 +44,21 @@ For example, imagine your search returns an issue like [rails/rails#11889][examp
4544

4645
The response would include a `text_matches` array with the following object:
4746

48-
<pre class="json">
49-
{
50-
"fragment": "undefined method `except' for #&amp;lt;Array:XXX&amp;gt;",
51-
// ...
52-
}
53-
</pre>
47+
{:.json}
48+
{
49+
"fragment": "undefined method 'except' for #&lt;Array:XXX&gt;",
50+
// ...
51+
}
5452

5553
Inside the `fragment` value, we see HTML-encoded entities (e.g., `&lt;`).
5654
Since we're returning JSON (not HTML), API clients might not expect any HTML-encoded text.
5755
As of today, the API returns these fragments _without_ this extraneous encoding.
5856

59-
<pre class="json">
60-
{
61-
"fragment": "undefined method `except' for #&lt;Array:XXX&gt;",
62-
// ...
63-
}
64-
</pre>
57+
{:.json}
58+
{
59+
"fragment": "undefined method 'except' for #<Array:XXX>",
60+
// ...
61+
}
6562

6663
## Preview Period
6764

content/changes/2013-10-04-oauth-changes-coming.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
For example, if you are making a POST with the `application/json`
1111
mime-type you'll see an additional field for the granted scopes.
1212

13-
<pre><code class="language-javascript">
14-
{
15-
"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a",
16-
"scope":"repo,gist",
17-
"token_type":"bearer"
18-
}
19-
</code></pre>
13+
#!javascript
14+
{
15+
"access_token":"e72e16c7e42f292c6912e7710c838347ae178b4a",
16+
"scope":"repo,gist",
17+
"token_type":"bearer"
18+
}
2019

2120
Right now, these scopes will be identical to what you requested, but we
2221
are moving towards a feature set that will allow GitHub users to edit

content/changes/2014-05-19-deployments-api-updates.md

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,70 +25,68 @@ The Deployment Status payloads now embed the associated Deployment object. With
2525

2626
### Example Deployment JSON
2727

28-
<pre><code class="language-javascript">
29-
{
30-
"url": "https://api.github.com/repos/my-org/my-repo/deployments/392",
31-
"id": 392,
32-
"sha": "837db83be4137ca555d9a5598d0a1ea2987ecfee",
33-
"ref": "master",
34-
"environment": "staging",
35-
"payload": {
36-
"fe": [
37-
"fe1",
38-
"fe2",
39-
"fe3"
40-
]
41-
},
42-
"description": "ship it!",
43-
"creator": {
44-
"login": "my-org",
45-
"id": 521,
46-
"avatar_url": "https://avatars.githubusercontent.com/u/2988?",
47-
"type": "User"
48-
},
49-
"created_at": "2014-05-09T19:56:47Z",
50-
"updated_at": "2014-05-09T19:56:47Z",
51-
"statuses_url": "https://api.github.com/repos/my-org/my-repo/deployments/392/statuses"
52-
}
53-
</code></pre>
28+
#!javascript
29+
{
30+
"url": "https://api.github.com/repos/my-org/my-repo/deployments/392",
31+
"id": 392,
32+
"sha": "837db83be4137ca555d9a5598d0a1ea2987ecfee",
33+
"ref": "master",
34+
"environment": "staging",
35+
"payload": {
36+
"fe": [
37+
"fe1",
38+
"fe2",
39+
"fe3"
40+
]
41+
},
42+
"description": "ship it!",
43+
"creator": {
44+
"login": "my-org",
45+
"id": 521,
46+
"avatar_url": "https://avatars.githubusercontent.com/u/2988?",
47+
"type": "User"
48+
},
49+
"created_at": "2014-05-09T19:56:47Z",
50+
"updated_at": "2014-05-09T19:56:47Z",
51+
"statuses_url": "https://api.github.com/repos/my-org/my-repo/deployments/392/statuses"
52+
}
5453

5554
### Example Deployment Status JSON
5655

57-
<pre><code class="language-javascript">
58-
{
59-
"url": "https://api.github.com/repos/my-org/my-repo/deployments/396/statuses/1",
60-
"id": 1,
61-
"state": "success",
62-
"deployment": {
63-
"url": "https://api.github.com/repos/my-org/my-repo/deployments/396",
64-
"id": 392,
65-
"sha": "837db83be4137ca555d9a5598d0a1ea2987ecfee",
66-
"ref": "master",
67-
"payload": {
68-
"fe": [
69-
"fe1",
70-
"fe2",
71-
"fe3"
72-
]
73-
},
74-
"environment": "production",
75-
"description": "Deploying to production",
76-
"creator": {
77-
"login": "alysson-goldner",
78-
"id": 540,
79-
"type": "User"
80-
},
81-
"created_at": "2014-05-09T19:59:36Z",
82-
"updated_at": "2014-05-09T19:59:36Z",
83-
"statuses_url": "https://api.github.com/repos/my-org/my-repo/deployments/396/statuses"
84-
},
85-
"description": "Deployment succeeded",
86-
"target_url": "https://deploy.myorg.com/apps/my-repo/logs/420",
87-
"created_at": "2014-05-09T19:59:39Z",
88-
"updated_at": "2014-05-09T19:59:39Z",
89-
"deployment_url": "https://api.github.com/repos/my-org/my-repo/deployments/396"
90-
}
91-
</code></pre>
56+
#!javascript
57+
{
58+
"url": "https://api.github.com/repos/my-org/my-repo/deployments/396/statuses/1",
59+
"id": 1,
60+
"state": "success",
61+
"deployment": {
62+
"url": "https://api.github.com/repos/my-org/my-repo/deployments/396",
63+
"id": 392,
64+
"sha": "837db83be4137ca555d9a5598d0a1ea2987ecfee",
65+
"ref": "master",
66+
"payload": {
67+
"fe": [
68+
"fe1",
69+
"fe2",
70+
"fe3"
71+
]
72+
},
73+
"environment": "production",
74+
"description": "Deploying to production",
75+
"creator": {
76+
"login": "alysson-goldner",
77+
"id": 540,
78+
"type": "User"
79+
},
80+
"created_at": "2014-05-09T19:59:36Z",
81+
"updated_at": "2014-05-09T19:59:36Z",
82+
"statuses_url": "https://api.github.com/repos/my-org/my-repo/deployments/396/statuses"
83+
},
84+
"description": "Deployment succeeded",
85+
"target_url": "https://deploy.myorg.com/apps/my-repo/logs/420",
86+
"created_at": "2014-05-09T19:59:39Z",
87+
"updated_at": "2014-05-09T19:59:39Z",
88+
"deployment_url": "https://api.github.com/repos/my-org/my-repo/deployments/396"
89+
}
9290

9391
If you have any questions or feedback, please [get in touch][contact].
9492

content/changes/2014-09-12-changing-organization-feeds.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ use of these attributes, you'll want to update your code to use the new
1414

1515
Previously, the deprecated attributes returned URI template. For example:
1616

17-
<pre><code class="language-javascript">
18-
"current_user_organization_url":
19-
"https://github.com/organizations/{org}/mastahyeti.private.atom?token=abc123"
20-
</code></pre>
17+
#!javascript
18+
"current_user_organization_url":
19+
"https://github.com/organizations/{org}/mastahyeti.private.atom?token=abc123"
2120

2221
The template included a deprecated authentication token. Our new tokens are
2322
valid only for a concrete feed URL (not for a URI template). Because the
@@ -32,12 +31,11 @@ In order to preserve the functionality of this API, we have added a new
3231
attribute that lists specific Atom feed urls for each of the user's
3332
organizations.
3433

35-
<pre><code class="language-javascript">
36-
"current_user_organization_urls": [
37-
"https://github.com/organizations/github/mastahyeti.private.atom?token=abc123"
38-
"https://github.com/organizations/requests/mastahyeti.private.atom?token=token=def456"
39-
]
40-
</code></pre>
34+
#!javascript
35+
"current_user_organization_urls": [
36+
"https://github.com/organizations/github/mastahyeti.private.atom?token=abc123"
37+
"https://github.com/organizations/requests/mastahyeti.private.atom?token=token=def456"
38+
]
4139

4240
Check out the updated [Feeds API documentation][docs] for the new fields. If you
4341
have any questions or feedback, please [get drop us a line][contact].

0 commit comments

Comments
 (0)