{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "md_to_pdf",
  "description": "Render a Markdown document as a paginated PDF report. Reads a JSON request on stdin and writes a JSON result on stdout. Requires a venv with reportlab and pypdf on the LOCAL disk (a venv cannot be created on the CIFS share - it refuses the lib64 symlink).",
  "type": "object",
  "required": ["source", "output"],
  "additionalProperties": false,
  "properties": {
    "source": {
      "type": "string",
      "description": "Path to the Markdown file to render (.md)."
    },
    "output": {
      "type": "string",
      "description": "Path of the PDF to write."
    },
    "title": {
      "type": "string",
      "description": "Cover title and the left half of every page footer.",
      "default": "Report"
    },
    "subtitle": {
      "type": "string",
      "description": "Cover subtitle. Omit for none.",
      "default": ""
    },
    "author": {
      "type": "string",
      "description": "PDF document author metadata.",
      "default": ""
    },
    "meta": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Cover metadata lines, rendered in grey under the subtitle. Inline **bold** and *italic* are honoured.",
      "default": []
    }
  },
  "result": {
    "type": "object",
    "properties": {
      "ok": {"type": "boolean"},
      "output": {"type": "string"},
      "pages": {"type": "integer"},
      "headings": {"type": "integer"},
      "tables": {"type": "integer"},
      "paragraphs": {"type": "integer"},
      "bytes": {"type": "integer"},
      "error": {"type": "string"}
    }
  }
}
