Using glu

glu converts Markdown or HTML files to PDF, or executes Lua scripts for programmatic typesetting. The mode is determined by the file extension:

glu document.md     # Markdown → PDF
glu page.html       # HTML → PDF
glu script.lua      # Lua script → PDF

Command line reference

glu [options] <filename.md|filename.html|filename.lua>

Options:
  -h, --help           Show this help
      --loglevel LVL   Set the log level (debug, info, warn, error)
  -q, --quiet          Suppress output on console
      --template       Apply Go template expansion (Markdown mode)
      --css FILE       Additional CSS file
      --markdown       Print expanded Markdown to stdout (debug)
      --html           Print generated HTML to stdout (debug, Markdown mode)
      --clean          Remove auxiliary files before processing

Commands:
      help             Show the help message
      version          Print version and exit

By default, glu shows log output on the console and writes a log file (<filename>.log). Use --quiet to suppress console output.

The --clean flag removes the .aux file before processing, forcing a fresh start. See Markdown mode — Auxiliary files for details.

Markdown mode

When you pass a .md file, glu converts it to PDF automatically. See Markdown mode for the full feature set (frontmatter, Lua blocks, custom CSS).

HTML mode

When you pass an .html or .htm file, glu converts it directly to PDF. Unlike Markdown mode, no default stylesheet is applied — styling comes from <style> tags, <link> stylesheets, or the --css flag. See HTML mode for details.

Lua script mode

When you pass a .lua file, glu executes it as a Lua script. The script has full control over the PDF output using the glu.frontend and other modules. See Lua script mode for the hello world example and available modules.