Documentation files

You can write Markdown documentation at three levels: API, resource, and operation. These files are committed with the project, edited in the app's doc editor (with live preview) or by hand, and rendered with placeholders that pull live data from the spec.

Locations

LevelPath
API (main page)apis/<api>/docs/index.md
API (extra pages)apis/<api>/docs/<name>.md
Resourceapis/<api>/resources/<resource>/docs/index.md
Operationapis/<api>/resources/<resource>/docs/<operationName>.md

The operation file's name matches the operation name (get.md documents Pet.get).

Frontmatter

YAML frontmatter, parsed with gray-matter. Recognized fields:

---
title: Get a pet
order: 2
visibility: public
tags: [pet, lookup]
---
FieldDescription
titleDisplay title; overrides the derived one.
orderSort order among sibling docs.
visibilitypublic or private.
tagsFree-form tags (metadata).

Placeholders

Inside the body, {{placeholder}} tokens are replaced at render time with data derived from the effective spec. Each placeholder is valid at a specific level (scope):

PlaceholderScopeRenders
{{api:title}}APIThe API title.
{{api:resources}}APIA linked list of the API's resources.
{{resource:title}}ResourceThe resource title.
{{resource:operations}}ResourceA linked list of the resource's operations.
{{operation:title}}OperationThe operation title.
{{operation:parameters}}OperationThe operation's parameters.
{{operation:requestExample}}OperationFirst request-body example, fenced as JSON.
{{operation:responseExample}}OperationFirst response example, fenced as JSON.
{{operation:responses}}OperationThe documented responses.
{{operation:security}}OperationThe operation's security requirements.

Example operation doc:

---
title: Get a pet
---

# {{operation:title}}

Returns a single pet by its ID.

## Parameters
{{operation:parameters}}

## Example
{{operation:requestExample}}

A placeholder with no data (e.g. an operation with no request body) renders a small placeholder line such as _No request example._.

Cross-references

Link between docs with the apicraft:// scheme; each consumer translates it to its own navigation (app panel, or relative HTML at export):

apicraft://api/<apiSlug>
apicraft://api/<apiSlug>/resource/<resourceSlug>
apicraft://api/<apiSlug>/resource/<resourceSlug>/operation/<operationName>
Coming soonExport-time link translation

The apicraft:// scheme is defined and resolved in the app. Translating it to relative HTML links at documentation-export time isn't implemented yet.