# Huashu Md To Pdf

> |

- **Type:** Skill
- **Install:** `agentstack add skill-biraj2004-huashu-skills-english-huashu-md-to-pdf-en`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Biraj2004](https://agentstack.voostack.com/s/biraj2004)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Biraj2004](https://github.com/Biraj2004)
- **Source:** https://github.com/Biraj2004/huashu-skills-english/tree/main/huashu-md-to-pdf-en
- **Website:** https://github.com/alchaincyf/huashu-skills

## Install

```sh
agentstack add skill-biraj2004-huashu-skills-english-huashu-md-to-pdf-en
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Markdown to PDF Skill

Convert Markdown documents into professional Apple-design-style PDF white papers.

## Core Features

1. **Professional typesetting**: Book-quality layout with automatic handling of page breaks and widow/orphan control
2. **Apple design language**: SF font system, modern minimalist style, professional colour palette
3. **Full table of contents**: Automatically extracts chapter structure, dual-column layout, clickable page jumps
4. **Complete Markdown support**: Code blocks, tables, blockquotes, lists — all rendered correctly

## How to Use

### Basic Usage

```bash
# Convert a single file
python scripts/convert.py input.md

# Specify output filename
python scripts/convert.py input.md -o "My White Paper.pdf"

# Custom title and author
python scripts/convert.py input.md --title "Technical White Paper" --author "Huashu"
```

### Markdown Document Requirements

Your Markdown document should follow this structure:

```markdown
# Document Title

## 1. Chapter One
### 1.1 Section One
### 1.2 Section Two

## 2. Chapter Two
### 2.1 Section One
```

**Key rules**:

- Main chapters: `## 1. Title` (number + full stop + space + title)
- Sub-sections: `### 1.1 Title` (number.number + space + title)
- This structure is required for the table of contents to generate correctly

## Design Features

### Cover Design

- Light grey gradient background
- Large title: 64pt, clean and modern
- Subtitle and metadata information

### Table of Contents Design

- Dual-column layout, fits on one page
- Main chapters in bold, sub-sections indented
- Clickable links that jump to the corresponding section

### Body Typesetting

- SF font family (Apple design language)
- Line height 1.7 for comfortable reading
- Chapters automatically start on a new page
- Widow and orphan control

### Code Blocks

- Light grey background + fine border
- 8px border radius
- SF Mono monospace font
- Automatic page break prevention

### Tables

- Clear grid lines
- Light grey header row
- Automatic header repeat (for tables that span multiple pages)

## Configuration Options

To customise the style, edit the CSS variables in `scripts/convert.py`:

```python
# Primary colour
PRIMARY_COLOR = '#06c'      # Apple blue
TEXT_COLOR = '#1d1d1f'      # Main text black
GRAY_COLOR = '#86868b'      # Light grey

# Font sizes
COVER_TITLE_SIZE = '64pt'
H2_SIZE = '22pt'
H3_SIZE = '17pt'
BODY_SIZE = '11pt'
```

## Frequently Asked Questions

### Q: Why is the table of contents empty?

A: Ensure your Markdown uses the correct chapter format:

- `## 1. Title` instead of `## Title`
- `### 1.1 Title` instead of `### Title`

### Q: Code blocks not displaying correctly?

A: Ensure you're wrapping with three backticks:

````markdown
```python
def hello():
    print("Hello")
```text
````

### Q: Table formatting is broken?

A: Use standard Markdown table syntax:

```markdown
| Column 1 | Column 2 |

    param($m)
    $inner = $m.Groups[1].Value
    # Split by | and fix each cell separator
    $cells = $inner -split '\|'
    $fixedCells = $cells | ForEach-Object {
      $cell = ---
name: huashu-md-to-pdf
description: |
  Convert Markdown documents into professional Apple-style PDF white papers.
  Supports full Markdown syntax (code blocks, tables, blockquotes, lists, etc.).
  Auto-generates cover page, table of contents, and headers/footers.
  Use cases: technical documentation, white papers, tutorials, reports — any Markdown document requiring professional typesetting.
---

# Markdown to PDF Skill

Convert Markdown documents into professional Apple-design-style PDF white papers.

## Core Features

1. **Professional typesetting**: Book-quality layout with automatic handling of page breaks and widow/orphan control
2. **Apple design language**: SF font system, modern minimalist style, professional colour palette
3. **Full table of contents**: Automatically extracts chapter structure, dual-column layout, clickable page jumps
4. **Complete Markdown support**: Code blocks, tables, blockquotes, lists — all rendered correctly

## How to Use

### Basic Usage

```bash
# Convert a single file
python scripts/convert.py input.md

# Specify output filename
python scripts/convert.py input.md -o "My White Paper.pdf"

# Custom title and author
python scripts/convert.py input.md --title "Technical White Paper" --author "Huashu"
```

### Markdown Document Requirements

Your Markdown document should follow this structure:

```markdown
# Document Title

## 1. Chapter One
### 1.1 Section One
### 1.2 Section Two

## 2. Chapter Two
### 2.1 Section One
```

**Key rules**:

- Main chapters: `## 1. Title` (number + full stop + space + title)
- Sub-sections: `### 1.1 Title` (number.number + space + title)
- This structure is required for the table of contents to generate correctly

## Design Features

### Cover Design

- Light grey gradient background
- Large title: 64pt, clean and modern
- Subtitle and metadata information

### Table of Contents Design

- Dual-column layout, fits on one page
- Main chapters in bold, sub-sections indented
- Clickable links that jump to the corresponding section

### Body Typesetting

- SF font family (Apple design language)
- Line height 1.7 for comfortable reading
- Chapters automatically start on a new page
- Widow and orphan control

### Code Blocks

- Light grey background + fine border
- 8px border radius
- SF Mono monospace font
- Automatic page break prevention

### Tables

- Clear grid lines
- Light grey header row
- Automatic header repeat (for tables that span multiple pages)

## Configuration Options

To customise the style, edit the CSS variables in `scripts/convert.py`:

```python
# Primary colour
PRIMARY_COLOR = '#06c'      # Apple blue
TEXT_COLOR = '#1d1d1f'      # Main text black
GRAY_COLOR = '#86868b'      # Light grey

# Font sizes
COVER_TITLE_SIZE = '64pt'
H2_SIZE = '22pt'
H3_SIZE = '17pt'
BODY_SIZE = '11pt'
```

## Frequently Asked Questions

### Q: Why is the table of contents empty?

A: Ensure your Markdown uses the correct chapter format:

- `## 1. Title` instead of `## Title`
- `### 1.1 Title` instead of `### Title`

### Q: Code blocks not displaying correctly?

A: Ensure you're wrapping with three backticks:

````markdown
```python
def hello():
    print("Hello")
```text
````

### Q: Table formatting is broken?

A: Use standard Markdown table syntax:

```markdown
| Column 1 | Column 2 |
|----------|----------|
| Value 1  | Value 2  |
```

### Q: How do I change the font?

A: Edit the CSS in `scripts/convert.py` and modify the `font-family` property.

### Q: The generated PDF is too large?

A: Check whether there are large images — consider compressing them or using external links.

## Dependency Installation

First-time use requires installing Python dependencies:

```bash
pip3 install markdown2 weasyprint
```

If you encounter WeasyPrint installation issues (macOS):

```bash
brew install pango
pip3 install weasyprint
```

## Examples

### Generate Technical Documentation

```bash
python scripts/convert.py tech-guide.md -o "Technical Guide.pdf"
```

### Generate a White Paper

```bash
python scripts/convert.py whitepaper.md --title "Product White Paper" --author "Team"
```

## Script Reference

- `scripts/convert.py` — Main conversion script
- `scripts/styles.css` — CSS style definitions (embedded in script)
- `templates/cover.html` — Cover template (embedded in script)

## Technical Implementation

This Skill uses:

- **markdown2**: Markdown parsing (with extended syntax support)
- **WeasyPrint**: HTML to PDF conversion (with CSS3 support)
- **Apple design system**: SF fonts, professional colour palette, modern typesetting

## Changelog

### v1.0 (2025-12-24)

- Initial release
- Full Markdown syntax support
- Apple design style
- Automatic table of contents generation
- Book-quality typesetting

---

> **By Huashu** | AI Native Coder · Independent Developer
> WeChat Official Account "Huashu" | 300k+ followers | AI Tools & Productivity
> Flagship products: Kitty Catchlight (AppStore Paid Rankings Top 1) · *Play DeepSeek with One Book*
.Trim()
      if ($cell -match '^:?-+:?
| Value 1  | Value 2  |
```

### Q: How do I change the font?

A: Edit the CSS in `scripts/convert.py` and modify the `font-family` property.

### Q: The generated PDF is too large?

A: Check whether there are large images — consider compressing them or using external links.

## Dependency Installation

First-time use requires installing Python dependencies:

```bash
pip3 install markdown2 weasyprint
```

If you encounter WeasyPrint installation issues (macOS):

```bash
brew install pango
pip3 install weasyprint
```

## Examples

### Generate Technical Documentation

```bash
python scripts/convert.py tech-guide.md -o "Technical Guide.pdf"
```

### Generate a White Paper

```bash
python scripts/convert.py whitepaper.md --title "Product White Paper" --author "Team"
```

## Script Reference

- `scripts/convert.py` — Main conversion script
- `scripts/styles.css` — CSS style definitions (embedded in script)
- `templates/cover.html` — Cover template (embedded in script)

## Technical Implementation

This Skill uses:

- **markdown2**: Markdown parsing (with extended syntax support)
- **WeasyPrint**: HTML to PDF conversion (with CSS3 support)
- **Apple design system**: SF fonts, professional colour palette, modern typesetting

## Changelog

### v1.0 (2025-12-24)

- Initial release
- Full Markdown syntax support
- Apple design style
- Automatic table of contents generation
- Book-quality typesetting

---

> **By Huashu** | AI Native Coder · Independent Developer
> WeChat Official Account "Huashu" | 300k+ followers | AI Tools & Productivity
> Flagship products: Kitty Catchlight (AppStore Paid Rankings Top 1) · *Play DeepSeek with One Book*
) {
        " $cell "
      } else {
        " $cell "
      }
    }
    '|' + ($fixedCells -join '|') + '|'
  
| Value 1  | Value 2  |
```

### Q: How do I change the font?

A: Edit the CSS in `scripts/convert.py` and modify the `font-family` property.

### Q: The generated PDF is too large?

A: Check whether there are large images — consider compressing them or using external links.

## Dependency Installation

First-time use requires installing Python dependencies:

```bash
pip3 install markdown2 weasyprint
```

If you encounter WeasyPrint installation issues (macOS):

```bash
brew install pango
pip3 install weasyprint
```

## Examples

### Generate Technical Documentation

```bash
python scripts/convert.py tech-guide.md -o "Technical Guide.pdf"
```

### Generate a White Paper

```bash
python scripts/convert.py whitepaper.md --title "Product White Paper" --author "Team"
```

## Script Reference

- `scripts/convert.py` — Main conversion script
- `scripts/styles.css` — CSS style definitions (embedded in script)
- `templates/cover.html` — Cover template (embedded in script)

## Technical Implementation

This Skill uses:

- **markdown2**: Markdown parsing (with extended syntax support)
- **WeasyPrint**: HTML to PDF conversion (with CSS3 support)
- **Apple design system**: SF fonts, professional colour palette, modern typesetting

## Changelog

### v1.0 (2025-12-24)

- Initial release
- Full Markdown syntax support
- Apple design style
- Automatic table of contents generation
- Book-quality typesetting

---

> **By Huashu** | AI Native Coder · Independent Developer
> WeChat Official Account "Huashu" | 300k+ followers | AI Tools & Productivity
> Flagship products: Kitty Catchlight (AppStore Paid Rankings Top 1) · *Play DeepSeek with One Book*

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Biraj2004](https://github.com/Biraj2004)
- **Source:** [Biraj2004/huashu-skills-english](https://github.com/Biraj2004/huashu-skills-english)
- **License:** MIT
- **Homepage:** https://github.com/alchaincyf/huashu-skills

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-biraj2004-huashu-skills-english-huashu-md-to-pdf-en
- Seller: https://agentstack.voostack.com/s/biraj2004
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
