Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The event objects returned from the Events API endpoints have the same structure
This example shows the format of the [WatchEvent](#watchevent) response when using the [Events API](/rest/reference/activity#events).

```
Status: 200 OK
HTTP/1.1 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
```
Expand Down
1 change: 0 additions & 1 deletion content/rest/guides/getting-started-with-the-rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ $ curl -i https://api.github.com/users/defunkt
> Server: GitHub.com
> Date: Sun, 11 Nov 2012 18:43:28 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 57
Expand Down
7 changes: 0 additions & 7 deletions content/rest/overview/resources-in-the-rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ $ curl -I {% data variables.product.api_url_pre %}/users/octocat/orgs
> Server: nginx
> Date: Fri, 12 Oct 2012 23:33:14 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "a00049ba79152d03380c34652f2cb612"
> X-GitHub-Media-Type: github.v3
> X-RateLimit-Limit: 5000
Expand Down Expand Up @@ -376,7 +375,6 @@ The returned HTTP headers of any API request show your current rate limit status
$ curl -I {% data variables.product.api_url_pre %}/users/octocat
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 56
> X-RateLimit-Reset: 1372700873
Expand All @@ -400,7 +398,6 @@ If you exceed the rate limit, an error response returns:
```shell
> HTTP/1.1 403 Forbidden
> Date: Tue, 20 Aug 2013 14:50:41 GMT
> Status: 403 Forbidden
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 0
> X-RateLimit-Reset: 1377013266
Expand All @@ -421,7 +418,6 @@ If your OAuth application needs to make unauthenticated calls with a higher rate
$ curl -u my_client_id:my_client_secret {% data variables.product.api_url_pre %}/user/repos
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4966
> X-RateLimit-Reset: 1372700873
Expand Down Expand Up @@ -510,7 +506,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 200 OK
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -521,7 +516,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -531,7 +525,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: T
> HTTP/1.1 304 Not Modified
> Cache-Control: private, max-age=60
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand Down
2 changes: 1 addition & 1 deletion content/rest/reference/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To get a feed in Atom format, you must specify the `application/atom+xml` type i
#### Response

```shell
Status: 200 OK
HTTP/1.1 200 OK
```

```xml
Expand Down
59 changes: 59 additions & 0 deletions script/i18n/homogenize-frontmatter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env node

// [start-readme]
//
// Run this script to fix known frontmatter errors by copying values from english file
// Translatable properties are designated in the frontmatter JSON schema
//
// [end-readme]

const { execSync } = require('child_process')
const fs = require('fs')
const path = require('path')
const readFileAsync = require('../../lib/readfile-async')
const fm = require('../../lib/frontmatter')
const matter = require('gray-matter')

const extractFrontmatter = async (path) => {
const fileContents = await readFileAsync(path, 'utf8')
return fm(fileContents)
}

// Find all content files that differ from the default branch
// TODO: make sure this will work in an Actions workflow
const cmd = 'git -c diff.renameLimit=10000 diff --name-only origin/main'
const changedFilesRelPaths = execSync(cmd)
.toString()
.split('\n')
.filter(filename => {
return filename.startsWith('translations/') &&
filename.includes('/content/') &&
!filename.endsWith('README.md')
})

changedFilesRelPaths.forEach(async (relPath) => {
const localisedAbsPath = path.join(__dirname, '../..', relPath)
// find the corresponding english file by removing the first 2 path segments: /translations/<language code>
const engAbsPath = path.join(__dirname, '../..', relPath.split(path.sep).slice(2).join(path.sep))

const localisedFrontmatter = await extractFrontmatter(localisedAbsPath)
if (!localisedFrontmatter) return

// Load frontmatter from the source english file
const englishFrontmatter = await extractFrontmatter(engAbsPath)

// Look for differences between the english and localised non-translatable properties
let overWroteSomething = false
for (const prop in englishFrontmatter.data) {
if (!fm.schema.properties[prop].translatable && localisedFrontmatter.data[prop] !== englishFrontmatter.data[prop]) {
localisedFrontmatter.data[prop] = englishFrontmatter.data[prop]
overWroteSomething = true
}
}

// rewrite the localised file, if it changed
if (overWroteSomething) {
const toWrite = matter.stringify(localisedFrontmatter.content, localisedFrontmatter.data, { lineWidth: 10000, forceQuotes: true })
fs.writeFileSync(localisedAbsPath, toWrite)
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The event objects returned from the Events API endpoints have the same structure
This example shows the format of the [WatchEvent](#watchevent) response when using the [Events API](/rest/reference/activity#events).

```
Status: 200 OK
HTTP/1.1 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ $ curl -i https://api.github.com/users/defunkt
> Server: GitHub.com
> Date: Sun, 11 Nov 2012 18:43:28 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 57
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ $ curl -I {% data variables.product.api_url_pre %}/users/octocat/orgs
> Server: nginx
> Date: Fri, 12 Oct 2012 23:33:14 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "a00049ba79152d03380c34652f2cb612"
> X-GitHub-Media-Type: github.v3
> X-RateLimit-Limit: 5000
Expand Down Expand Up @@ -331,7 +330,6 @@ The returned HTTP headers of any API request show your current rate limit status
$ curl -I {% data variables.product.api_url_pre %}/users/octocat
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 56
> X-RateLimit-Reset: 1372700873
Expand All @@ -355,7 +353,6 @@ If you exceed the rate limit, an error response returns:
```shell
> HTTP/1.1 403 Forbidden
> Date: Tue, 20 Aug 2013 14:50:41 GMT
> Status: 403 Forbidden
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 0
> X-RateLimit-Reset: 1377013266
Expand All @@ -376,7 +373,6 @@ If your OAuth application needs to make unauthenticated calls with a higher rate
$ curl -u my_client_id:my_client_secret {% data variables.product.api_url_pre %}/user/repos
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4966
> X-RateLimit-Reset: 1372700873
Expand Down Expand Up @@ -458,7 +454,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 200 OK
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -469,7 +464,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -479,7 +473,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: T
> HTTP/1.1 304 Not Modified
> Cache-Control: private, max-age=60
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand Down
2 changes: 1 addition & 1 deletion translations/de-DE/content/rest/reference/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To get a feed in Atom format, you must specify the `application/atom+xml` type i
#### Response

```shell
Status: 200 OK
HTTP/1.1 200 OK
```

```xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Los objetos de los eventos que se devuelven de las terminales de la API de Event
Este ejemplo te muestra el formato de la respuesta de [WatchEvent](#watchevent) cuando utilizas la [API de Eventos](/rest/reference/activity#events).

```
Status: 200 OK
HTTP/1.1 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ $ curl -i https://api.github.com/users/defunkt
> Server: GitHub.com
> Date: Sun, 11 Nov 2012 18:43:28 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 57
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ $ curl -I {% data variables.product.api_url_pre %}/users/octocat/orgs
> Server: nginx
> Date: Fri, 12 Oct 2012 23:33:14 GMT
> Content-Type: application/json; charset=utf-8
> Status: 200 OK
> ETag: "a00049ba79152d03380c34652f2cb612"
> X-GitHub-Media-Type: github.v3
> X-RateLimit-Limit: 5000
Expand Down Expand Up @@ -331,7 +330,6 @@ Los encabezados HTTP recuperados para cualquier solicitud de la API muestran tu
$ curl -I {% data variables.product.api_url_pre %}/users/octocat
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 56
> X-RateLimit-Reset: 1372700873
Expand All @@ -355,7 +353,6 @@ Si excedes el límite de tasa, se regresará una respuesta de error:
```shell
> HTTP/1.1 403 Forbidden
> Date: Tue, 20 Aug 2013 14:50:41 GMT
> Status: 403 Forbidden
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 0
> X-RateLimit-Reset: 1377013266
Expand All @@ -376,7 +373,6 @@ Si tu aplicación de OAuth necesita hacer llamados no autenticados con un límit
$ curl -u my_client_id:my_client_secret {% data variables.product.api_url_pre %}/user/repos
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4966
> X-RateLimit-Reset: 1372700873
Expand Down Expand Up @@ -458,7 +454,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 200 OK
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -469,7 +464,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -479,7 +473,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: T
> HTTP/1.1 304 Not Modified
> Cache-Control: private, max-age=60
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand Down
2 changes: 1 addition & 1 deletion translations/es-ES/content/rest/reference/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Para obtener un canal en formato de Atom, debes especificar el tipo `application
#### Respuesta

```shell
Status: 200 OK
HTTP/1.1 200 OK
```

```xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Los objetos de los eventos que se devuelven de las terminales de la API de Event
Este ejemplo te muestra el formato de la respuesta de [WatchEvent](#watchevent) cuando utilizas la [API de Eventos](/v3/activity/events).

```
Status: 200 OK
HTTP/1.1 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ $ curl -i {% data variables.product.api_url_pre %}/users/defunkt
> Date: Sun, 11 Nov 2012 18:43:28 GMT
> Content-Type: application/json; charset=utf-8
> Connection: keep-alive
> Status: 200 OK
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 57
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ $ curl -i {% data variables.product.api_url_pre %}/users/octocat/orgs
> Date: Fri, 12 Oct 2012 23:33:14 GMT
> Content-Type: application/json; charset=utf-8
> Connection: keep-alive
> Status: 200 OK
> ETag: "a00049ba79152d03380c34652f2cb612"
> X-GitHub-Media-Type: github.v3
> X-RateLimit-Limit: 5000
Expand Down Expand Up @@ -329,7 +328,6 @@ Los encabezados HTTP recuperados para cualquier solicitud de la API muestran tu
$ curl -i {% data variables.product.api_url_pre %}/users/octocat
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 56
> X-RateLimit-Reset: 1372700873
Expand All @@ -353,7 +351,6 @@ Si excedes el límite de tasa, se regresará una respuesta de error:
```shell
> HTTP/1.1 403 Forbidden
> Date: Tue, 20 Aug 2013 14:50:41 GMT
> Status: 403 Forbidden
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 0
> X-RateLimit-Reset: 1377013266
Expand All @@ -374,7 +371,6 @@ Si tu aplicación de OAuth necesita hacer llamados no autenticados con un límit
$ curl -u my_client_id:my_client_secret {% data variables.product.api_url_pre %}/user/repos
> HTTP/1.1 200 OK
> Date: Mon, 01 Jul 2013 17:27:06 GMT
> Status: 200 OK
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4966
> X-RateLimit-Reset: 1372700873
Expand Down Expand Up @@ -456,7 +452,6 @@ $ curl -i {% data variables.product.api_url_pre %}/user
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 200 OK
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -467,7 +462,6 @@ $ curl -i {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand All @@ -477,7 +471,6 @@ $ curl -i {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: T
> HTTP/1.1 304 Not Modified
> Cache-Control: private, max-age=60
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
Expand Down
2 changes: 1 addition & 1 deletion translations/es-XL/content/rest/reference/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Para obtener un canal en formato de Atom, debes especificar el tipo `application
#### Respuesta

```shell
Status: 200 OK
HTTP/1.1 200 OK
```

```xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Events APIエンドポイントから返されるイベントオブジェクト
この例は、[Events API](/rest/reference/activity#events)を使用する際の[WatchEvent](#watchevent)のレスポンスの形式を示しています。

```
Status: 200 OK
HTTP/1.1 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
```
Expand Down
Loading