Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessFile ¶
ProcessFile reads a Markdown file and produces a PDF.
func ProcessHTMLFile ¶
ProcessHTMLFile reads an HTML file and produces a PDF. Unlike Markdown mode, no default CSS is applied — styling comes from <link>, <style>, inline styles, or the --css flag.
func ProcessHTMLString ¶ added in v0.0.11
ProcessHTMLString takes an HTML payload (already in memory), the directory to resolve relative CSS @import / <link> paths against, and an output PDF filename, and runs the same pipeline as ProcessHTMLFile.
Useful for embedders that produce HTML on the fly (e.g. an XSL-FO walker) and want to skip the disk-roundtrip of writing the HTML out and reading it back in.
Types ¶
type Frontmatter ¶
type Frontmatter struct {
Title string `yaml:"title"`
Author string `yaml:"author"`
CSS string `yaml:"css"`
Papersize string `yaml:"papersize"`
Format string `yaml:"format"`
Lang string `yaml:"lang"`
Extra map[string]any `yaml:"-"` // all key-value pairs (including the known ones)
}
Frontmatter holds metadata extracted from the YAML front matter block.
type Options ¶
type Options struct {
Template bool // apply Go template expansion before processing
CSSFile string // additional CSS file to load
DebugMarkdown bool // print expanded Markdown to stdout instead of generating PDF
DebugHTML bool // print generated HTML to stdout instead of generating PDF
}
Options controls the Markdown processing pipeline.