Address review comments

This commit is contained in:
Andrew Morgan 2025-12-18 14:35:34 +00:00
parent 2d3d317923
commit b7d2462b02
2 changed files with 22 additions and 3 deletions

View file

@ -1,4 +1,23 @@
{{/* Minimal list of API endpoints for the current page. */}}
{{/*
Renders a list of API endpoints for the current page, given:
The outer page's Scratch must contain an "api_endpoints" key, which is either
a slice of maps (a list of endpoint metadata dicts) or a map of module name ->
slice of endpoint metadata dicts (representing the API modules and the
endpoints they each contain). Each slice item must contain the Each endpoint
dict must contain the following keys:
* `anchor`: the HTML anchor for the endpoint
* `method`: the HTTP method
* `endpoint`: the endpoint path
* `summary`: a short summary of the endpoint
* `deprecated`: whether the endpoint is deprecated
* `module`: the CS API module name, if any, for grouping purposes. If empty,
the endpoint is considered "base" or "required".
*/}}
{{ $raw := .Scratch.Get "api_endpoints" }}
{{/* Normalize to a slice */}}
{{ $endpoints := slice }}

View file

@ -8,7 +8,7 @@
We use this single template to render the all API spec pages *except* the
Client-Server API. The Client-Server API spec page contains modules, and thus
is handled separately.
is handled separately, via the `layouts/docs/list.html` template.
The contents of the "main" block below are inserted into the `./baseof.html`
base template.
@ -16,4 +16,4 @@
*/}}
{{ define "main" }}
{{ partial "spec-content.html" . }}
{{ end }}
{{ end }}