Comprehensive markdown processing utilities for the Promptbook ecosystem, providing tools for parsing, manipulating, and extracting content from markdown documents.

## 🎯 Purpose and Motivation

This package provides specialized markdown processing capabilities that are essential for working with promptbooks and LLM-generated content. It handles markdown parsing, content extraction, text humanization, and various markdown transformations that are commonly needed when processing AI-generated text and promptbook documentation.

## 🔧 High-Level Functionality

The package offers comprehensive markdown processing capabilities:

-   **Content Extraction**: Extract code blocks, lists, and sections from markdown
-   **Text Processing**: Parse and manipulate markdown sections and content
-   **AI Text Humanization**: Transform AI-generated text to be more human-readable
-   **Markdown Manipulation**: Add, remove, and modify markdown formatting
-   **Table and Chart Creation**: Generate markdown tables and charts
-   **Scraping Integration**: Markdown-specific content scraping capabilities

## ✨ Key Features

-   📝 **Content Extraction** - Extract blocks, lists, and sections from markdown documents
-   🎨 **Text Humanization** - Transform AI text with proper quotes, ellipsis, and formatting
-   🔧 **Markdown Manipulation** - Add, remove, and modify markdown formatting
-   📊 **Table Generation** - Create formatted markdown tables and charts
-   🧹 **Content Cleaning** - Remove comments, links, and unwanted formatting
-   📖 **Section Parsing** - Parse and split markdown into structured sections
-   🔍 **Block Processing** - Extract and process code blocks and content blocks
-   🤖 **AI Integration** - Specialized tools for processing LLM-generated markdown

## 📦 Exported Entities

### Version Information

-   `BOOK_LANGUAGE_VERSION` - Current book language version
-   `PROMPTBOOK_ENGINE_VERSION` - Current engine version

### Content Extraction

-   `extractBlock` - Extract specific blocks from content
-   `extractJsonBlock` - Extract JSON blocks from content
-   `extractAllBlocksFromMarkdown` - Extract all code blocks from markdown
-   `extractAllListItemsFromMarkdown` - Extract all list items from markdown
-   `extractOneBlockFromMarkdown` - Extract single code block from markdown

### Markdown Scraping

-   `createMarkdownScraper` - Create markdown content scraper
-   `MarkdownScraper` - Markdown scraper class
-   `_MarkdownScraperRegistration` - Markdown scraper registration

### Type Definitions

-   `string_markdown` - Markdown string type (type)
-   `string_markdown_section` - Markdown section string type (type)
-   `string_markdown_section_content` - Markdown section content type (type)
-   `string_markdown_text` - Markdown text string type (type)
-   `string_markdown_codeblock_language` - Markdown code block language type (type)
-   `MarkdownSection` - Markdown section structure (type)

### Content Generation

-   `addAutoGeneratedSection` - Add auto-generated sections to markdown
-   `createMarkdownChart` - Create markdown charts and diagrams
-   `createMarkdownTable` - Create formatted markdown tables

### Text Processing

-   `escapeMarkdownBlock` - Escape markdown block content
-   `flattenMarkdown` - Flatten markdown structure
-   `parseMarkdownSection` - Parse markdown into sections
-   `splitMarkdownIntoSections` - Split markdown into structured sections

### AI Text Humanization

-   `humanizeAiText` - Comprehensive AI text humanization
-   `humanizeAiTextEllipsis` - Fix ellipsis formatting in AI text
-   `humanizeAiTextEmdashed` - Fix em-dash formatting in AI text
-   `humanizeAiTextQuotes` - Fix quote formatting in AI text
-   `humanizeAiTextWhitespace` - Fix whitespace in AI text
-   `promptbookifyAiText` - Transform AI text for promptbook format

### Content Cleaning

-   `removeMarkdownComments` - Remove comments from markdown
-   `removeMarkdownFormatting` - Remove markdown formatting
-   `removeMarkdownLinks` - Remove links from markdown

> 💡 This package provides markdown processing utilities for promptbook applications. For the core functionality, see [@promptbook/core](#-packages) or install all packages with `npm i ptbk`
