portable-text-conversion

Convert HTML and Markdown content into Portable Text blocks for Sanity.

172|58|Updated Jan 8, 2025
One-click install
npx skills add https://github.com/robotostudio/turbo-start-sanity --skill portable-text-conversion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portable-text-conversion
Source: https://github.com/robotostudio/turbo-start-sanity/tree/main/.claude/skills/portable-text-conversion
Command: npx skills add https://github.com/robotostudio/turbo-start-sanity --skill portable-text-conversion

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @portabletext/markdown, @portabletext/block-tools, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of converting HTML and Markdown content into Portable Text blocks, enabling seamless content migration and creation within the Sanity platform.

Core Features & Use Cases

  • Markdown to Portable Text: Convert Markdown content directly using the markdownToPortableText function.
  • HTML to Portable Text: Parse HTML into Portable Text blocks using htmlToBlocks.
  • Manual Construction: Build Portable Text blocks manually for precise control over the output.
  • Use Case: When migrating content from a legacy CMS or importing external HTML/Markdown into Sanity.

Quick Start

Convert the provided HTML content to Portable Text blocks using the htmlToBlocks function.

Frequently Asked Questions about portable-text-conversion

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

FAQPage Schema
How do I convert HTML to Portable Text for Sanity?

To convert HTML to Portable Text, use the htmlToBlocks function to parse HTML content into Portable Text blocks for use with the Sanity platform. This handles direct HTML conversion for seamless content migration.

Can I convert Markdown content directly into Portable Text blocks?

Yes, you can convert Markdown to Portable Text using the markdownToPortableText function. It parses Markdown content directly into Portable Text blocks for integration within the Sanity platform.

What is the best way to migrate legacy CMS content into Sanity?

The best way to migrate legacy CMS content into Sanity is converting existing HTML and Markdown formats into Portable Text blocks using dedicated parsing functions, ensuring seamless content migration and creation.

Do I need the Portable Text library to parse HTML and Markdown for Sanity?

Yes, you need the Portable Text library and relevant parsing tools like @portabletext/markdown and @portabletext/block-tools to parse HTML and Markdown for manual block construction within Sanity.

When should I manually construct Portable Text blocks instead of parsing HTML?

You should manually construct Portable Text blocks when you need precise control over the output formatting, rather than relying on automated HTML or Markdown parsing during content migration.