markdown

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessFile

func ProcessFile(l *lua.State, filename string, opts Options) error

ProcessFile reads a Markdown file and produces a PDF.

func ProcessHTMLFile

func ProcessHTMLFile(l *lua.State, filename string, opts Options) error

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL