* Experiment with making the tarball smaller Part of #1248 * try this * stop debugging * delete translations too * delete heavy search indexes too * push and popd * try this hack * delete but leave directory * debug more * faster delete of translations * less loud * async await * async await * no tree * simplify * experimenting more * unfinished * only the large files * change order * brotli with level 6 * cope better with decorated rest json files * tidying * keep images * cleaning * cleaning up * refactored function * try this * better comment * remove console logging * more important changes * improved fs.accessSync check
REST
About this directory
lib/rest/index.jsis human-editable.lib/rest/static/*.jsonare generated by scripts.
Editable files
lib/rest/index.jsconsumes the static decorated schema files and exportscategories,operations, andoperationsEnabledForGitHubAppsused by the REST middleware contextualizer.
Static files
Generated by script/rest/update-files.js:
lib/rest/static/dereferenced- dereferenced OpenAPI schema file for each version of GitHublib/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
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.