Pandoc Renderer¶
The Pandoc renderer generates PDF-ready Markdown with YAML frontmatter for Pandoc, the universal document converter.
Overview¶
Pandoc output is ideal for:
- Printed reports
- Audit documentation
- Compliance artifacts
- Archive records
Features¶
- Sans-serif fonts - Professional Helvetica/Arial typography
- 2cm margins - Balanced page layout
- LuaLaTeX support - High-quality PDF rendering
- Table of contents - Auto-generated navigation
- Section numbering - Hierarchical document structure
Usage¶
CLI¶
Go API¶
import (
"github.com/grokify/structured-goals/dmaic"
"github.com/grokify/structured-goals/dmaic/render"
"github.com/grokify/structured-goals/dmaic/render/pandoc"
)
doc, _ := dmaic.ReadFile("metrics.json")
renderer := pandoc.NewRenderer()
output, err := renderer.Render(doc, &render.Options{
IncludeInitiatives: true,
IncludeRootCauses: true,
})
os.WriteFile("report.md", output, 0644)
Output Example¶
---
title: "Manufacturing Quality Metrics"
author: "Maria Rodriguez"
date: "FY2025-Q1"
geometry:
- margin=2cm
fontfamily: helvet
fontsize: 11pt
documentclass: article
header-includes:
- \renewcommand{\familydefault}{\sfdefault}
- \usepackage{booktabs}
- \usepackage{longtable}
toc: true
numbersections: true
---
# Executive Summary
| Metric | Value |
|--------|-------|
| Overall Health | 85% |
| Categories | 3 |
| Total Metrics | 9 |
| Green Status | 6 |
| Yellow Status | 3 |
# Production Quality
## First Pass Yield
| Property | Value |
|----------|-------|
| Current | 94.2% |
| Target | 98.0% |
| Baseline | 85.0% |
| Phase | Control |
| Status | Green |
### Control Limits
| Limit | Value |
|-------|-------|
| UCL | 99.0% |
| Center Line | 95.0% |
| LCL | 90.0% |
Converting to PDF¶
Install Pandoc and LuaLaTeX:
Generate PDF:
YAML Frontmatter Options¶
The renderer generates these frontmatter settings:
| Setting | Value | Purpose |
|---|---|---|
geometry |
margin=2cm |
Page margins |
fontfamily |
helvet |
Helvetica font |
fontsize |
11pt |
Body text size |
documentclass |
article |
Document type |
toc |
true |
Table of contents |
numbersections |
true |
Section numbers |
Customization¶
Custom Margins¶
Different Font¶
A4 Paper¶
Report Sections¶
The renderer generates these sections:
- Executive Summary - Health metrics, status counts
- Categories - One section per category
- Metrics - Subsection per metric with details
- Control Limits - For Control phase metrics
- Root Causes - When available
- Initiatives - Improvement projects