Authoring companion

Keep it open beside the editor.

Galley does not edit. It shows the page as you, or an agent, write the file, and it tells you what is wrong with the document while you do.

Illustration: a walnut writing desk at night with a closed notebook, a brass fountain pen across a blank sheet, and a second blank sheet propped on a small stand beside a brass lamp.
Live reload

It follows every save, including the kind that replaces the file

Many editors and coding agents save by writing a temporary file and renaming it over the original. A watcher on the file alone loses the file at that moment.

  • Galley watches both the file and its folder, so a rename or a delete of the file is noticed and the watch is picked up again on the new file.
  • A burst of writes is coalesced over an 80 millisecond debounce, and a save that left the bytes the same is skipped by a SHA-256 of the contents.
  • The window keeps your place across a reload by anchoring to the source line at the top of the view, and an optional Scroll to Latest Edit setting jumps to the change instead.
  • A reload swaps the page's body in place rather than reloading the web view.
Outline, Inspector, Find, Source Peek

The panels, and their keys

Outline
Command-Option-1. Parts, numbered headings, figures, tables, and equations in a filterable list that highlights the section you are reading, with a click to scroll to it.
Inspector
Command-I. Three tabs: Metadata (the front matter, the dialect, the page layouts, and the capabilities the document requires), Diagnostics (PubMark diagnostics, each with a PM code, a severity, and a line), and Stats (words, characters, reading time, and heading count).
Source Peek
Command-Option-S. The raw source in a read-only column beside the page.
Find
Command-F searches the document. Command-plus, Command-minus, and Command-0 zoom.
External editor
Command-E opens the file in the editor you chose in Settings, and Command-Shift-R reveals it in Finder.
Markdown too

Plain Markdown gets the same treatment

A file that is not PubMark is read as CommonMark 0.31.2 with GitHub Flavored Markdown: tables with alignment, task lists, strikethrough, autolinks, fenced code with syntax highlighting, and alert blockquotes such as NOTE, TIP, IMPORTANT, WARNING, and CAUTION. Its front matter, if any, is shown as a collapsible header, and it opens in the Swiss template by default.

Your own templates

Style it your way

A .css file in the templates folder becomes a template, and a .galleytemplate bundle adds a manifest, an optional print stylesheet, and fonts. Choose Reload Custom Templates in the Templates menu after a change. Live reload follows the open document; it does not watch the templates folder.

The command

galley, from a shell

The galley command takes one or more files, -t or --template with a template id such as renkara-editorial, swiss, or manuscript, --paged to open in Paged Proof Mode, and --new-window to open in a window of its own. The repository's install script links it into the user's own bin folder.

galley report.pub.md --template renkara-editorial --paged
Contact

Questions about this tool?

Write to Renkara Media Group and a person will answer.