generate-pdf
Generate a production-grade branded PDF from a markdown source file using the pdf-factory pipeline.
$ARGUMENTS
Parse arguments: <markdown-file> [--brand <name>] [--output <path>]
<markdown-file>-- path to the source markdown file (required)--brand <name>-- brand kit name:bluewaves,wave-artisans, ordecathlon(default:bluewaves)--output <path>-- output PDF path (default: same directory as input,.pdfextension)
Steps
-
Parse arguments from
$ARGUMENTS. Extract markdown file path, brand name, and output path. -
Verify dependencies are installed:
python3 -c "import xhtml2pdf, reportlab, pypdf, markdown, lxml, PIL, html5lib, cssselect2" 2>/dev/nullIf this fails, run the install-docs-deps skill first.
-
Resolve brand kit at
${SKILL_ROOT}/../brand-<name>/. Verify the directory exists and containsassets/manifest.json. -
Read the markdown file and extract frontmatter metadata (title, subtitle, author, date). Convert markdown to HTML:
python3 -c " import markdown, json, sys, re with open('<markdown-file>') as f: source = f.read() # Extract YAML frontmatter fm_match = re.match(r'^---\n(.*?)\n---\n', source, re.DOTALL) meta = {} if fm_match: for line in fm_match.group(1).splitlines(): if ':' in line: key, val = line.split(':', 1) meta[key.strip()] = val.strip() source = source[fm_match.end():] # Convert to HTML html = markdown.markdown(source, extensions=['tables', 'fenced_code', 'codehilite', 'toc', 'meta', 'attr_list']) with open('<output-dir>/content.html', 'w') as f: f.write(html) with open('<output-dir>/metadata.json', 'w') as f: json.dump(meta, f, indent=2) print('Parsed markdown and extracted metadata.') " -
Render content pages:
python3 ${SKILL_ROOT}/../pdf-factory/scripts/render.py \ --brand ${SKILL_ROOT}/../brand-<name> \ --input <output-dir>/content.html \ --output <output-dir>/content-pages.pdf -
Compose final document:
python3 ${SKILL_ROOT}/../pdf-factory/scripts/compose.py \ --brand ${SKILL_ROOT}/../brand-<name> \ --content <output-dir>/content-pages.pdf \ --metadata <output-dir>/metadata.json \ --output <output-path> -
Validate output:
python3 ${SKILL_ROOT}/../pdf-factory/scripts/validate_output.py \ <output-path> \ --brand ${SKILL_ROOT}/../brand-<name> -
Clean up temporary files (content.html, content-pages.pdf, metadata.json).
-
Report results -- output path, page count, file size, and validation status.
More from bluewaves-creations/bluewaves-skills
photographer-testino
Generate images in Mario Testino's glamorous vibrant style. Use when users ask for Testino style, high fashion glamour, bold saturated colors, warm luxurious photography, dynamic sensual energy.
35photographer-lindbergh
Generate images in Peter Lindbergh's iconic black and white style. Use when users ask for Lindbergh style, raw authentic beauty, emotional B&W portraits, supermodel aesthetic, or unretouched natural photography.
30photographer-lachapelle
Generate images in David LaChapelle's surreal pop art style. Use when users ask for LaChapelle style, pop surrealism, hyper-saturated colors, theatrical staging, baroque maximalism, kitsch aesthetic.
24epub-creator
Create production-quality EPUB 3 ebooks from markdown and images with automated QA, formatting fixes, and validation. Use when creating ebooks, converting markdown to EPUB, or compiling chapters into a publishable book. Handles markdown quirks, generates TOC, adds covers, and validates output automatically.
22photographer-vonunwerth
Generate images in Ellen von Unwerth's playful vintage style. Use when users ask for von Unwerth style, playful sensuality, vintage film noir, whimsical feminine photography, retro glamour, narrative storytelling.
19photographer-ritts
Generate images in Herb Ritts' sculptural black and white style. Use when users ask for Ritts style, classical Greek aesthetic, sculptural body photography, California golden hour, minimalist athletic portraits.
18