dojo.md
University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...
PDF Generation Skill
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install bartok9/pdf-generationInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
Purpose: Generate professional PDFs from HTML/CSS without whitespace gaps or layout issues.
When generating PDFs from HTML, page-break-inside: avoid causes orphan whitespace — content that can't fit on the current page gets pushed entirely to the next page, leaving huge gaps.
❌ WRONG:
<div class="page" style="min-height: 297mm;">
<!-- Content -->
</div>
✅ RIGHT:
<body>
<!-- Content flows naturally -->
</body>
Use @page CSS rules instead of fixed page containers:
@page {
size: A4;
margin: 18mm 15mm;
}
Only use break-inside: avoid on elements that:
✅ Protect:
tr)❌ Do NOT Protect:
.small-element {
break-inside: avoid; /* Modern spec */
page-break-inside: avoid; /* Legacy support */
}
h2, h3, h4, .section-header {
break-after: avoid;
page-break-after: avoid;
}
body {
orphans: 3; /* Min lines at bottom of page */
widows: 3; /* Min lines at top of page */
}
table {
/* NO break-inside: avoid */
}
tr {
break-inside: avoid;
page-break-inside: avoid;
}
@page {
size: A4;
margin: 18mm 15mm;
}
body {
font-size: 10pt;
line-height: 1.5;
orphans: 3;
widows: 3;
}
/* Headers stay with content */
h2, h3, h4 {
break-after: avoid;
page-break-after: avoid;
}
/* Small...
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
# PDF Generation Skill
**Purpose:** Generate professional PDFs from HTML/CSS without whitespace gaps or layout issues.
## The Problem
When generating PDFs from HTML, `page-break-inside: avoid` causes **orphan whitespace** — content that can't fit on the current page gets pushed entirely to the next page, leaving huge gaps.
## The Solution
### 1. Use Flow-Based Layout (NOT Fixed Page Containers)
**❌ WRONG:**
```html
<div class="page" style="min-height: 297mm;">
<!-- Content -->
</div>
```
**✅ RIGHT:**
```html
<body>
<!-- Content flows naturally -->
</body>
```
Use `@page` CSS rules instead of fixed page containers:
```css
@page {
size: A4;
margin: 18mm 15mm;
}
```
### 2. Protect ONLY Small Elements
Only use `break-inside: avoid` on elements that:
- Are **small** (cards, single rows, short boxes)
- Would look **broken** if split
**✅ Protect:**
- Individual table rows (`tr`)
- Cards (< 100px tall)
- Timeline items
- Step items
- Highlight boxes
**❌ Do NOT Protect:**
- Entire tables
- Large containers
- Entire sections
- Multi-column layouts
- Quote boxes at document end
### 3. Use Modern + Legacy Properties
```css
.small-element {
break-inside: avoid; /* Modern spec */
page-break-inside: avoid; /* Legacy support */
}
```
### 4. Keep Headers With Content
```css
h2, h3, h4, .section-header {
break-after: avoid;
page-break-after: avoid;
}
```
### 5. Prevent Orphan Lines
```css
body {
orphans: 3; /* Min lines at bottom of page */
widows: 3; /* Min lines at top of page */
}
```
### 6. Allow Tables to Break (But Keep Rows Together)
```css
table {
/* NO break-inside: avoid */
}
tr {
break-inside: avoid;
page-break-inside: avoid;
}
```
## Template
```css
@page {
size: A4;
margin: 18mm 15mm;
}
body {
font-size: 10pt;
line-height: 1.5;
orphans: 3;
widows: 3;
}
/* Headers stay with content */
h2, h3, h4 {
break-after: avoid;
page-break-after: avoid;
}
/* Small...University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...
macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance
A股分析技能
A2A4B2B Skill for OpenClaw