Skip to content

Commit

Permalink
Make all REST categories have subcategories (#38559)
Browse files Browse the repository at this point in the history
Co-authored-by: Rachael Sewell <[email protected]>
  • Loading branch information
skedwards88 and rachmari authored Jun 27, 2023
1 parent 0cea028 commit 29db669
Show file tree
Hide file tree
Showing 38 changed files with 355 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
babelOptions: { configFile: './.babelrc' },
sourceType: 'module',
},
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*'],
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*', 'rest-api-description/'],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
},
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions content/rest/billing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Billing
intro: Use the REST API to get billing information for an enterprise.
topics:
- API
versions:
fpt: '*'
ghec: '*'
ghes: '*'
children:
- /billing
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
20 changes: 20 additions & 0 deletions content/rest/code-scanning/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Code Scanning
intro: >-
Use the REST API to retrieve and update {% data
variables.product.prodname_code_scanning %} alerts from a repository.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
- Code scanning
- REST
children:
- /code-scanning
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
18 changes: 18 additions & 0 deletions content/rest/codes-of-conduct/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Codes of conduct
intro: Use the REST API to get information about codes of conduct.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /codes-of-conduct
autogenerated: rest
---



<!-- Content after this section is automatically generated -->
File renamed without changes.
17 changes: 17 additions & 0 deletions content/rest/deploy-keys/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Deploy keys
intro: Use the REST API to create and manage deploy keys.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
allowTitleToDifferFromFilename: true
children:
- /deploy-keys
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
20 changes: 20 additions & 0 deletions content/rest/emojis/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Emojis
intro: >-
Use the REST API to list and view all the available emojis to use on {% data
variables.product.product_name %}.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /emojis
autogenerated: rest
---



<!-- Content after this section is automatically generated -->
File renamed without changes.
18 changes: 18 additions & 0 deletions content/rest/gitignore/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Gitignore
intro: >-
Use the REST API to get `.gitignore` templates that can be used to ignore
files and directories.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /gitignore
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
18 changes: 18 additions & 0 deletions content/rest/licenses/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Licenses
intro: >-
Use the REST API to retrieve popular open source licenses and information
about a particular project's license file.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /licenses
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
18 changes: 18 additions & 0 deletions content/rest/markdown/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Markdown
intro: Use the REST API to render a markdown document as an HTML page or as raw text.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /markdown
autogenerated: rest
---



<!-- Content after this section is automatically generated -->
File renamed without changes.
21 changes: 21 additions & 0 deletions content/rest/meta/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Meta
intro: >-
Use the REST API to get meta information about {% data
variables.product.product_name %}, including the IP addresses of {% data
variables.product.product_name %} services.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /meta
autogenerated: rest
---



<!-- Content after this section is automatically generated -->
File renamed without changes.
13 changes: 13 additions & 0 deletions content/rest/oauth-authorizations/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: OAuth authorizations
intro: Use the REST API to manage the access {% data variables.product.prodname_oauth_app %}s have to your account.
versions:
ghes: '*'
topics:
- API
children:
- /oauth-authorizations
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
17 changes: 17 additions & 0 deletions content/rest/packages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Packages
intro: >-
Use the REST API to interact with {% data variables.product.prodname_registry
%}.
versions:
fpt: '*'
ghec: '*'
ghes: '>=3.9'
topics:
- API
children:
- /packages
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
20 changes: 20 additions & 0 deletions content/rest/pages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Pages
intro: >-
Use the REST API to interact with {% data variables.product.prodname_pages %}
sites and builds.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /pages
autogenerated: rest
---



<!-- Content after this section is automatically generated -->
File renamed without changes.
16 changes: 16 additions & 0 deletions content/rest/rate-limit/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Rate limit
intro: Use the REST API to check your current rate limit status.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /rate-limit
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
18 changes: 18 additions & 0 deletions content/rest/reactions/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Reactions
intro: >-
Use the REST API to interact with reactions on {% data
variables.product.prodname_dotcom %}.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /reactions
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
15 changes: 15 additions & 0 deletions content/rest/scim/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: SCIM
intro: >-
Use the REST API to control and manage your GitHub organization members access
with SCIM.
versions:
ghec: '*'
topics:
- API
children:
- /scim
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
18 changes: 18 additions & 0 deletions content/rest/search/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Search
intro: >-
Use the REST API to search for specific items on {% data
variables.product.product_name %}.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /search
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
16 changes: 16 additions & 0 deletions content/rest/secret-scanning/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Secret scanning
intro: Use the REST API to retrieve and update secret alerts from a repository.
versions:
fpt: '*'
ghae: '*'
ghec: '*'
ghes: '*'
topics:
- API
children:
- /secret-scanning
autogenerated: rest
---

<!-- Content after this section is automatically generated -->
File renamed without changes.
27 changes: 2 additions & 25 deletions src/rest/scripts/utils/update-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,8 @@ async function getDataFrontmatter(dataDirectory, schemaFilename) {
async function getMarkdownContent(versions) {
const markdownUpdates = {}

for (const category of Object.keys(versions)) {
const subcategories = Object.keys(versions[category])
// When there is only a single subcategory and the name
// matches the category, this is an override due to a
// subcategory not being defined. In this case,
// the markdown file will be in the content/rest directory.
// The file path will be content/rest/<category>.md
if (subcategories.length === 1 && category === subcategories[0]) {
// this will be a file in the root of the rest directory
const filepath = path.join('content/rest', `${category}.md`)
markdownUpdates[filepath] = {
data: {
title: category,
shortTitle: category,
intro: '',
versions: await convertVersionsToFrontmatter(
versions[category][subcategories[0]].versions
),
...frontmatterDefaults,
},
content: '',
}
continue
}

for (const [category, subcategoryObject] of Object.entries(versions)) {
const subcategories = Object.keys(subcategoryObject)
// The file path will be content/rest/<category>/<subcategory>.md
for (const subcategory of subcategories) {
const filepath = path.join('content/rest', category, `${subcategory}.md`)
Expand Down
Loading

0 comments on commit 29db669

Please sign in to comment.