Skip to content
Closed
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
2 changes: 1 addition & 1 deletion content/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Content <!-- omit in toc -->

:octocat:
The `/content` directory is where all the site's (English) Markdown content lives!

See the [markup reference guide](/contributing/content-markup-reference.md) for more information about supported Markdown features.
Expand Down
6 changes: 3 additions & 3 deletions lib/rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

Generated by `script/rest/update-files.js`:

* `lib/rest/static/dereferenced` - dereferenced OpenAPI schema file for each version of GitHub
* `lib/rest/static/decorated` - files generated from the dereferenced OpenAPI schema with the Markdown descriptions rendered in HTML
* `lib/rest/static/dereferenced` - dereferenced OpenAPI schema file for each version of GitHub.
* `lib/rest/static/decorated` - files generated from the dereferenced OpenAPI schema with the Markdown descriptions rendered in HTML.

## Rendering docs

When the server starts, `middleware/contextualizers/rest.js` accesses the data exported from the static decorated JSON files, fetches the data for the current version and requested path, and adds it to the `context` object. The added property is:

* `req.context.currentRestOperations` - all operations with a category matching the current path
* `req.context.currentRestOperations` - all operations with a category matching the current path.

Markdown files in `content/rest/reference` use Liquid to loop over these context properties. The Liquid calls HTML files in the `includes` directory to do most of the rendering. Writers can add content to the Markdown files alongside the Liquid.
2 changes: 1 addition & 1 deletion lib/rest/static/decorated/api.github.com.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"parameters": [],
"x-codeSamples": [
{
"lang": "Shell",
"lang": "Shells",
"source": "curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/",
"html": "<pre><code class=\"hljs language-shell\">curl \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api.github.com/</code></pre>"
},
Expand Down