glu

module
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

README

Homepage

glu

Markdown to PDF. With typographic precision.

glu turns Markdown into beautifully typeset PDFs — with real line breaking, hyphenation, font shaping, and all the things you'd expect from a proper typesetting engine. Under the hood it uses boxes and glue, a Go library that implements TeX's algorithms.

glu document.md        # → document.pdf

What makes glu different?

  • Markdown first — Write Markdown, get a PDF with proper typography. No LaTeX, no XML.
  • CSS for styling — Page size, fonts, margins, borders, background colors — all via CSS.
  • Lua for logic — Embed Lua blocks for computed content, table of contents, dynamic data.
  • Callbacks — Hook into page creation for headers, footers, decorative frames, watermarks.
  • TeX quality — Knuth-Plass line breaking, optical margin alignment, microtypography.

Quick example

---
title: The Frog King
css: custom.css
---

# Once upon a time

In olden times when wishing still helped one,
there lived a king whose daughters were all beautiful.

```{lua}
return string.format("5! = %d", factorial(5))
```
glu story.md    # → story.pdf

More

glu also supports raw HTML mode, low-level Lua scripting for full control, and direct access to the typesetting engine's node lists.

Full documentation: boxesandglue.dev/glu

Installation

rake build      # creates bin/glu

License

MIT

Directories

Path Synopsis
lua
backend
Package backend provides Lua bindings for the boxes and glue backend.
Package backend provides Lua bindings for the boxes and glue backend.
cxpath
Package cxpath provides Lua bindings for XPath XML querying using cxpath.
Package cxpath provides Lua bindings for XPath XML querying using cxpath.
log
pdf
textshape
Package textshape provides Lua bindings for the textshape ot package, exposing low-level text shaping (HarfBuzz-port) to Lua scripts.
Package textshape provides Lua bindings for the textshape ot package, exposing low-level text shaping (HarfBuzz-port) to Lua scripts.

Jump to

Keyboard shortcuts

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