code.pablomurad.com

patchwork

Publishes the revisions of your pages as a feed, with notes and readable diffs, written in Go

schema/v1/version.json raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://git.pablomurad.com/pablo/patchwork/raw/branch/main/schema/v1/version.json",
  "title": "GET /api/v1/pages/{slug}/versions/{n}",
  "description": "One public version: its text, and its full diff against the previous public version (null for the first).",
  "type": "object",
  "additionalProperties": false,
  "required": ["page", "number", "latest_number", "published_at", "updated_at", "url", "title", "body_markdown", "frontmatter", "diff"],
  "properties": {
    "page": { "$ref": "defs.json#/$defs/pageRef" },
    "number": { "type": "integer", "minimum": 1 },
    "latest_number": { "type": "integer", "minimum": 1 },
    "baseline": { "const": true },
    "published_at": { "$ref": "defs.json#/$defs/time" },
    "updated_at": { "$ref": "defs.json#/$defs/time" },
    "note": { "type": "string" },
    "kind": { "$ref": "defs.json#/$defs/kind" },
    "maturity": { "$ref": "defs.json#/$defs/maturity" },
    "url": { "$ref": "defs.json#/$defs/url" },
    "title": { "type": "string" },
    "body_markdown": { "type": "string", "description": "The Markdown body without frontmatter. Render it with your own Markdown pipeline." },
    "frontmatter": { "type": "object", "description": "Only the keys listed in frontmatter.diff_keys." },
    "base_number": { "type": "integer", "minimum": 1 },
    "diff": { "oneOf": [{ "type": "null" }, { "$ref": "defs.json#/$defs/diff" }] }
  }
}