publish-medium

Publishes blog posts to Medium via opencli browser automation with pandoc HTML conversion.

1.0k|141|Updated Sep 18, 2022
One-click install
npx skills add https://github.com/childrentime/reactuse --skill publish-medium
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: publish-medium
Source: https://github.com/childrentime/reactuse/tree/main/.claude/skills/publish-medium
Command: npx skills add https://github.com/childrentime/reactuse --skill publish-medium

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandoc, opencli.

What problem does it solve?

Medium's rich-text editor does not parse raw markdown, so cross-posting a markdown blog article requires converting the body to HTML and simulating a paste event into the editor's contenteditable model. This Skill automates that entire flow, including title insertion, code-block preservation, topic tagging, and final publishing.

Core Features & Use Cases

  • Markdown-to-Medium conversion: Uses pandoc to convert GFM markdown to HTML, then injects it via a simulated paste event with a DataTransfer payload so Medium's editor ingests it correctly.
  • Code block integrity: Replaces blank lines inside fenced code blocks with zero-width spaces (U+200B) so Medium does not split one code block into multiple blocks, with post-publish verification checks.
  • End-to-end publishing flow: Opens the new-story page, inserts the title via execCommand, pastes the body, adds topics, clicks Publish, and retrieves the canonical public URL.
  • Use Case: After committing a new reactuse.com blog post to GitHub, cross-post the English version to Medium (@wul55267) as part of a multi-platform distribution pipeline alongside dev.to, Hashnode, and 掘金.

Quick Start

Publish the latest blog post from blog-external to Medium using the publish-medium workflow.

Frequently Asked Questions about publish-medium

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a markdown blog post to Medium?

Convert the markdown body to HTML with pandoc, then simulate a paste event carrying text/html data into Medium's .js-postField editor. Insert the title separately with execCommand insertText, since Medium's editor model ignores direct DOM writes.

Why does Medium not render pasted markdown correctly?

Medium's editor is a contenteditable with its own data model that does not parse raw markdown syntax. Pasting plain markdown yields unformatted text, so the content must be converted to HTML and delivered through a paste event Medium's handler understands.

Why do code blocks get split when pasting into Medium?

Medium treats blank lines inside code blocks as paragraph separators and splits one block into several. Replace empty lines inside fenced code blocks with a zero-width space (U+200B) before conversion so each block stays intact.

Can I set a canonical URL on a Medium story?

Medium's native editor has no canonical URL field; only the Import flow sets one. A story published through the editor is purely a reach channel and does not pass link equity back to the original site.

Does Medium support tables in pasted content?

No, Medium flattens pasted HTML tables into plain text. Convert any important tables into lists in the markdown source before publishing to preserve the information structure.

Why does editing a published Medium story fail with a save error?

Clearing and re-pasting a published story's body with synthetic events corrupts Medium's internal model, causing a save error. Publish a fresh new story with the corrected content and delete the old one instead.