Generate a document (PDF / PPTX / DOCX / HTML) from markdown content authored by you.
REQUIRED parameters:
- title: Short human-readable title.
- content_markdown: The body. Slides separated by `---` on its own line at the top level (Marp rule). Tables, code, lists, footnotes, definition lists, and {.section-header} class attrs all parse.
- format: "document" (single flowing body) or "presentation" (slides).
- output_type: "pdf", "pptx", "docx", or "html".
Optional:
- theme: "default" | "corporate" | "minimal" | "pitch" | "invoice" | "contract" | "cinema" | "editorial" (default "default"). cinema/editorial are presentation-only (engine=marp).
- language: BCP-47 tag (default "en"). Drives font fallback for Cyrillic/CJK/Arabic content.
- engine: "marp" | "weasyprint". For format=presentation PDF/HTML only. Default "marp" (designer-grade Chromium renderer with full CSS3, web layout, and {.cover}/{.hero}/{.split}/{.stats}/{.dark} layout classes). Pass "weasyprint" for the legacy print-CSS path. Rejected for format=document or output_type=pptx.
DELIVERY CONTRACT (CRITICAL):
After this tool returns a `file_id`, deliver the file by calling
`messages.send(attachments=[file_id], text="<short caption>")`.
Do NOT embed the file_id in a markdown link, a `sandbox:` URL, or
`/api/files/<id>/download` text — those render as plain text on the
recipient's channel, not as a file attachment. The `attachments` parameter
is the ONLY way the file actually attaches.
CONVENTIONS:
- Two-column slide: wrap with `::: cols\n::: col\n…\n:::\n::: col\n…\n:::\n:::`.
- Speaker notes (presentations only): `::: notes\n…\n:::` at the end of a slide block. NOT `<!-- ... -->` (comments are escaped, not captured).
- Section header slide: `{.section-header}` on its own line directly above the heading. Block-attr form, not inline.
- Images: only `` (workspace file_id), `data:image/...` URIs, or hosts in DOCUMENTS_MEDIA_URL_ALLOWLIST. Other URLs are dropped with `[image removed]`.
LAYOUT CLASSES (engine=marp only — ignored under engine=weasyprint):
- `{.cover}` — title-slide layout (centered headings, gradient background).
- `{.hero image="file:NNN"}` — full-bleed background image with dark overlay and white headline.
- `{.split image="file:NNN"}` — 50/50 image left, content (heading/bullets) right.
- `{.stats}` — 3-up KPI cards: each card is `### big-number` followed by a one-line label paragraph.
- `{.dark}` / `{.invert}` — per-slide dark mode override.
Both `image="file:NNN"` and `image=file:NNN` are accepted (quoted or unquoted). Place the class line on its own row directly above the slide content.
Format × output_type rules:
- `document` + `pptx` is rejected — set `format=presentation` or pick pdf/docx/html.
- `theme=invoice/contract` + `output_type=pptx` silently uses the default PPTX master.
For theme="invoice", every invoice MUST include a "Total" row whose value equals
sum(line items) + tax (within ±0.01). The renderer fails closed on missing or
mismatched totals.
EXEMPLAR — invoice (English):
# Invoice INV-{YYYYMMDD-HHMMSS}
**From:** {Issuer Legal Name}, {Address}, {Tax ID}
**To:** {Customer Name}, {Customer Address}, {Customer Tax ID}
**Issue date:** {YYYY-MM-DD} **Due date:** {YYYY-MM-DD}
| Description | Qty | Unit price | Total |
|---|---:|---:|---:|
| {Service 1} | 1 | 1500.00 | 1500.00 |
| {Service 2} | 2 | 500.00 | 1000.00 |
**Subtotal:** USD 2500.00
**Tax (20%):** USD 500.00
**Total:** USD 3000.00
**Payment:** {bank details OR crypto wallet — never both}
EXEMPLAR — invoice (Russian):
# Счёт-фактура № INV-{YYYYMMDD-HHMMSS}
**От:** {Юридическое название организации}, {Адрес}, ИНН {Tax ID}
**Кому:** {Название клиента}, {Адрес клиента}, ИНН {Tax ID}
**Дата:** {YYYY-MM-DD} **Срок оплаты:** {YYYY-MM-DD}
| Описание | Кол-во | Цена | Сумма |
|---|---:|---:|---:|
| {Услуга 1} | 1 | 1500.00 | 1500.00 |
| {Услуга 2} | 2 | 500.00 | 1000.00 |
**Подытог:** USD 2500.00
**НДС (20%):** USD 500.00
**Итого:** USD 3000.00
**Реквизиты:** {банковские реквизиты ИЛИ криптокошелёк — не оба сразу}
EXEMPLAR — contract (English):
# Service Agreement
**Between:** {Provider Legal Name}, {Address} ("Provider")
**And:** {Client Legal Name}, {Address} ("Client")
**Effective date:** {YYYY-MM-DD}
## 1. Scope of services
{Concise description of what Provider agrees to deliver.}
## 2. Term
This Agreement begins on the Effective date and continues until {termination
condition or end date}.
## 3. Compensation
Client pays Provider {amount and currency} according to {payment schedule}.
## 4. Confidentiality
Both parties agree to keep proprietary information of the other party
confidential during and after the term of this Agreement.
## 5. Termination
Either party may terminate with {N} days' written notice.
## 6. Governing law
{Jurisdiction}.
---
**Provider:** ____________________ **Client:** ____________________
{Provider signatory name} {Client signatory name}
EXEMPLAR — contract (Russian):
# Договор оказания услуг
**Между:** {Юридическое название Исполнителя}, {Адрес} ("Исполнитель")
**И:** {Юридическое название Заказчика}, {Адрес} ("Заказчик")
**Дата вступления в силу:** {YYYY-MM-DD}
## 1. Предмет договора
{Краткое описание услуг, которые Исполнитель обязуется оказать.}
## 2. Срок действия
Договор вступает в силу с указанной даты и действует до {условие прекращения
или дата окончания}.
## 3. Стоимость и порядок оплаты
Заказчик оплачивает услуги Исполнителя в размере {сумма и валюта} в порядке
{график платежей}.
## 4. Конфиденциальность
Стороны обязуются сохранять конфиденциальность сведений, полученных в ходе
исполнения настоящего Договора, в течение срока его действия и после его
прекращения.
## 5. Расторжение
Любая из сторон вправе расторгнуть Договор, направив письменное уведомление
не менее чем за {N} дней.
## 6. Применимое право
{Юрисдикция}.
---
**Исполнитель:** ____________________ **Заказчик:** ____________________
{ФИО подписанта Исполнителя} {ФИО подписанта Заказчика}