Portable Text Conversion

•
162
•
Official
内容管理

Converts HTML and Markdown content into Sanity-compatible Portable Text blocks for seamless content migration and programmatic document creation.

The Portable Text Conversion skill provides specialized guidance and implementation patterns for transforming external content sources like HTML and Markdown into Sanity CMS's structured Portable Text format. It is designed to assist developers in migrating legacy CMS data, building automated content pipelines, and programmatically constructing rich text blocks while maintaining semantic integrity. By leveraging tools like @portabletext/markdown and @portabletext/block-tools, this skill ensures that converted content follows the Portable Text specification, including proper block keys, mark definitions, and style nesting.

主要功能

01HTML parsing into structured blocks with @portabletext/block-tools
02Manual block construction guidance for custom API and database sources
03Markdown to Portable Text conversion using @portabletext/markdown
04162 GitHub stars
05Support for custom deserializers to handle unique HTML elements
06Standardized implementation of keys, marks, and block styles

使用场景

01Automating the ingestion of external Markdown documentation into a Sanity project
02Building content pipelines that transform raw HTML from web scrapers into rich text
03Migrating legacy blog posts and articles from WordPress or other CMSs into Sanity