techbook-pdf

Generates Japanese technical textbook PDFs from HTML fragments using WeasyPrint and print CSS.

Updated Jun 20, 2026
One-click install
npx skills add https://github.com/DIO0550/d-market-knowledge --skill techbook-pdf-dio0550
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: techbook-pdf
Source: https://github.com/DIO0550/d-market-knowledge/tree/main/plugins/doc-knowledge/skills/techbook-pdf
Command: npx skills add https://github.com/DIO0550/d-market-knowledge --skill techbook-pdf-dio0550

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires weasyprint, beautifulsoup4, pygments, and includes scripts (resource) and references (resource) components.

What problem does it solve? Writing long-form technical documentation that reads like a real printed textbook requires complex typesetting—tables of contents, page numbers, indexes, running heads, and figure numbering—that is painful to build and maintain by hand. This Skill turns a simple HTML fragment into a fully typeset Japanese technical reference PDF with all of those elements generated automatically. ## Core Features & Use Cases - Automatic book apparatus: Cover page, chapter openers, auto-generated table of contents with page numbers, running heads, page cross-references, figure/table numbering, and a fifty-sound-ordered index are all produced without manual numbering. - Textbook components: POINT callouts, warnings, sidenotes, term definitions, worked examples, end-of-chapter exercises with answers, columns, and syntax-highlighted code blocks via Pygments. - Page size presets and SVG diagrams: A4/B5/A5 presets with margin-tuned layouts, plus inline SVG patterns for architecture, sequence, layer, flow, and attack-flow diagrams. - Use Case: Draft chapter content as HTML fragments, run the build script with a title and B5 preset, and receive a print-ready technical reference PDF with clickable bookmarks, TOC, and index. ## Quick Start Ask the AI to write your technical material as chapter HTML fragments and build a B5 textbook PDF with a title using the techbook-pdf build script.

Frequently Asked Questions about techbook-pdf

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

FAQPage Schema
How do I generate a textbook-style PDF from HTML?

Write your content as HTML fragments containing section elements with class chapter, then run the build_pdf.py script with a title and page-size preset. The script produces a PDF with automatic table of contents, page numbers, index, and figure numbering via WeasyPrint.

What tool converts HTML to print-ready PDF with CSS?

WeasyPrint converts HTML and CSS into PDFs with paged-media support such as page counters, running headers, and target-counter cross-references. This Skill wraps WeasyPrint with a textbook layout stylesheet and a build script that automates TOC and index generation.

Does WeasyPrint support automatic table of contents and page numbers?

Yes, WeasyPrint supports target-counter and leader functions in CSS, which resolve page numbers for TOC entries and cross-references at render time. The build script generates the TOC structure from h1-h3 headings automatically.

Why does my inline SVG render with black boxes in WeasyPrint?

WeasyPrint does not apply external CSS to inline SVG, so class-based styling from the page stylesheet is ignored. Define styles inside the SVG itself using a style element, presentation attributes, or group inheritance.

What are the code line length limits for print PDF layouts?

Code lines must fit the page width: 72 characters for A4, 60 for B5, and 48 for A5. Longer lines trigger build warnings and get wrapped with hanging indents, which reduces readability, so shorten variable names or insert line breaks.

How are Python dependencies installed for the PDF build script?

Dependencies are never installed implicitly; run the script once with --install-deps to install from a hash-pinned requirements lock file into an isolated .venv using pip with --require-hashes. The system Python is never modified, and hash mismatches abort the install.