Publishing Markdown to Substack from an Agent Skill
Описание и применение
Рецепт автоматизации публикации Markdown‑статьи в Substack с помощью агента publishing‑kit, который конвертирует статью в HTML, обрабатывает проблемы Substack (таблицы, ссылки с inline‑кодом) и публикует её через веб‑редактор.
Задача
Substack lacks a publishing API, so posts must be created through its web editor, which discards certain markdown elements such as tables and links with inline code.
Результат
The recipe enables a single markdown file to become a fully formatted Substack post, preserving code, images, and links, and handling Substack’s quirks such as inline‑code link removal and heading levels.
Рабочий процесс
- Build Medium‑compatible HTML with make‑medium.py
- Serve the HTML locally and store it in window.name
- Open Substack publish page and load the payload
- Prepare the HTML: remove title block, unwrap inline‑code links, promote headings, clear language classes
- Paste the prepared HTML into the editor
- Audit the draft to confirm elements
- Set title and subtitle, respecting 255‑char limit
- Publish the post via the editor’s dialog
Доказательства
Substack has no publishing API. A post goes in through its web editor, and that editor decides what survives.
The fix is to take the <code><code></code> out of the anchor before pasting. The link survives as plain text, which keeps the reader's way to the page.
Substack keeps it as a real code block.
The editor page holds two pairs of title fields. The post's own are textareas with the placeholders Title and Add a subtitle…; an Add a title... input and an Add a description... textarea belong to the SEO settings.
- Дата записи: 2026-10-05T18:55:53.917Z