Folio Documentation
Learn Folio
Write Markdown, preview real pages, and export polished documents. Learn the editor, portable files and history, document layouts, reusable styles, and local agent workflows.
This guide follows the current source. The changelog identifies features available in released builds and those coming in the next release.
On this page
1. Getting Started
Folio is a macOS-first desktop application engineered with Electron, React, CodeMirror 6, and Paged.js. It bridges the gap between lightweight Markdown writing and executive-ready A4 PDF publishing.
Installation
Download the official release for your operating system:
Tip: On macOS, drag Folio.app into /Applications. On Windows, run the installer .exe. On Linux, make the .AppImage executable with chmod +x or install the .deb package.
Editor Interface & Shortcuts
Write Markdown on the left and preview paginated A4 pages on the right. Three toolbar controls select editor-only, split, or preview-only view. Drag the divider to resize the panes, use its arrow keys when focused, or double-click it to reset the width. In split view, the preview follows your current paragraph; clicking a preview paragraph moves the editor caret to its source.
Choose New for starters such as Scientific Article and Landscape Presentation, or explore the ready-made samples: the Petstore API Documentation with endpoints, authentication, code, and a Mermaid integration diagram; the Series B pitch deck, a sixteen-slide landscape presentation with dark section pages; and the Orbital Perturbations paper, a two-column scientific article with equations, spanning tables and figures, and references.
These shortcuts use Command on macOS. Use Ctrl in place of Command on Windows and Linux.
| Shortcut | Action | Description |
|---|---|---|
⌘ O | Open File | Open a local .md, .markdown, or .folio file. |
⌘ S | Save File | Saves the current document; Folio files also keep saved versions. |
⇧ ⌘ E | Export PDF | Renders and compiles the paginated document into a vector PDF. |
⌘ F | Find & Replace | Opens the CodeMirror search bar in the editor pane. |
⇧ ⌘ S | Save As | Save the document to a new path or change its file format. |
⌘ K | Insert Link | Open the link dialog; a URL pasted over selected text also creates a link. |
⌘ , | Settings | Change interface appearance, language, editor preferences, and autosave. |
Writing, Tables & Images
- Formatting: Choose headings H1–H6, paragraphs, emphasis, lists, and quotes from the toolbar. Find opens search and replace; Outline jumps to document headings.
- Tables: Use Insert → Table to choose rows and columns. Tab and Shift+Tab move between cells; Tab in the last cell adds a row. The contextual Table menu adds or removes rows and columns.
- Lists and tasks: Enter continues a list, and Enter on an empty item ends it. Tab and Shift+Tab indent or outdent. Tasks inserts Markdown checkboxes, and the task control toggles their state.
- Footnotes: Insert → Footnote adds a reference and definition. Standard
[^note]references render numbered notes at the end of the document. - Code: Add a language after the opening fence, such as
typescript,python, orsql. The editor, preview, and PDF use syntax colors; unsupported languages stay plain code. Long lines wrap within print margins. - Images: Paste, drop, or choose a file through Insert → Image, then add alt text. Place the caret inside an image or link to edit it through the toolbar. Image captions use the Markdown title; an optional width suffix controls sizing.
{width=50%}Pasted images stay in draft storage until you save. Saving Markdown places imported images in a neighboring .assets/ folder; keep it with the Markdown file. Save As copies imported assets when moving the document. Existing relative image paths are supported.
Settings & Language
Open Settings for appearance, 🇺🇸 English or 🇪🇸 Español, line numbers, folding, current-line and preview-selection highlights, font size, line spacing, text width, spellcheck, and autosave. Language is an app preference: changing it leaves document content unchanged. Legacy lang frontmatter is ignored.
Autosave applies to existing files after a pause in typing. Unsaved drafts can be recovered after restart. If a file changes outside Folio, autosave pauses and offers Reload, Save my version, or Save As.
2. Files, History & Sharing
Use Save options → Save as Folio document… to create a portable .folio file. It contains Markdown, local images and attachments, the document's appearance, named styles, and up to 100 saved versions. Open it like an ordinary document.
Markdown stays supported. Save As can convert a Folio document to .md, placing its assets beside it in .assets/ and retaining supported font and color overrides in frontmatter.
Saved Versions
The history button opens saved versions, including their text, assets, and styles. Restoring a version creates an unsaved draft; save it to record a new version. Unchanged saves do not create duplicate versions, and Folio retains the latest 100.
Choose Save a copy without history… in the history dialog to share only the current document and assets.
PDF, PNG & Markdown Export
Export PDF uses the paginated layout shown in the preview, including orientation, headers, footers, tables, math, and diagrams. The arrow beside it offers Markdown + assets (.zip), which packages the current draft and local attachments with portable paths. Extract the ZIP before opening its Markdown file. It also offers PNG images…: numbered page files at 1×, 2×, or 3× resolution, or a single stitched long image that joins every page top to bottom. The images are rasterized from the finished PDF, so they match it exactly, including mixed-orientation pages.
PDF, PNG, and Markdown ZIP export work with both Markdown and Folio documents. ZIP export contains the current document and assets without revision history. Missing local files are reported before a package is produced.
3. Document Layouts & Frontmatter
Folio documents are 100% standard Markdown. You can optionally include a YAML frontmatter block at the very top of your document to configure layouts, metadata, invoices, or running headers and footers.
Open Document for Document properties: choose a layout and page orientation, edit layout-specific metadata, and configure the table of contents, headers, and footers. These choices are saved in frontmatter.
Cover Report / SOW (layout: report)
The default layout for statements of work, proposals, whitepapers, and formal reports. Generates a branded cover page with metadata fields, followed by numbered pages.
---
layout: report
title: Enterprise Cloud Architecture Proposal
kicker: Technical Proposal
client: Acme Global Industries
prepared-for: Marcus Vance, CTO
prepared-by: Meridian Cloud Advisory
date: October 12, 2026
valid-until: November 12, 2026
document-id: SOW-2026-089
theme: editorial
---
# Executive Summary
This proposal outlines the multi-region migration strategy...Invoices (layout: invoice)
Use flat frontmatter fields for issuer/client details, dates, status, and totals. Write line items as a Markdown table in the body. Folio displays the supplied amounts; it does not calculate totals from the table.
---
layout: invoice
title: Invoice INV-2026-0042
invoice-number: INV-2026-0042
date: 2026-10-13
due-date: 2026-11-13
status: Due
from: Example Studio
from-email: billing@example.com
client: Northstar Technologies
currency: USD
subtotal: "$4,500.00"
tax: "$360.00"
tax-rate: "8%"
total: "$4,860.00"
payment-terms: Net 30 days
theme: editorial
---
### Services
| Description | Hours | Rate | Amount |
|:---|---:|---:|---:|
| Architecture consulting | 30 | $150.00 | $4,500.00 |
### Payment Instructions
Contact billing@example.com for payment details.Simple Documents & Running Headers/Footers (layout: simple)
Ideal for memos, technical specs, meeting notes, articles, and short policies where a cover page is unnecessary. You can customize running headers and footers directly:
---
layout: simple
title: Real-Time Sync Engine Spec
header-left: "Folio Engine V2"
header-right: "Confidential"
footer-left: "Revision 1.4"
footer-right: "Page {page} of {pages}"
theme: graphite
---
# Architecture Overview
This specification details the conflict-free replicated data types...Scientific Articles (layout: scientific)
Choose New → Scientific Article for a manuscript starter, or select Scientific Article in Document properties. The article starts on the first page with a title, authors, affiliations, abstract, and keywords, followed by the main text flowing in two journal-style columns, with figures, tables, and diagrams wrapping inside a column. It supports ordinary Markdown equations, figures, footnotes, tables, and references.
---
layout: scientific
theme: scientific
title: Reproducible State Estimation
authors: [Alex Rivera, Sam Chen]
affiliations:
- Example Research Lab
abstract: |
A comparison of two state-estimation methods.
keywords: [estimation, reproducibility]
journal: Example Journal
doi: "10.xxxx/example"
---
## 1. Introduction
Research question and contribution.The Scientific theme is the default for this layout when no theme is specified. Dates and publication details appear when supplied; headers and a table of contents are optional. The MCP preset is scientific-paper.
Curriculum Vitae (layout: cv)
Choose New → Curriculum Vitae for a resume starter. Document properties offers name, role, contact details, location, and website fields. Use Markdown headings for experience, education, and other sections.
Landscape Pages
Document properties → Page orientation selects Portrait or Landscape for the entire document, including report covers and PDF export. The setting is stored as orientation: landscape. New → Landscape Presentation starts a wide document with page breaks between sections.
---
layout: simple
orientation: landscape
title: Quarterly Review
theme: slate
---
# Quarterly Review
Opening summary.
<!-- pagebreak -->
## Delivery MetricsMermaid Diagrams & KaTeX Math
Folio natively paginates Mermaid diagrams and LaTeX equations:
- Mermaid: Use standard fenced
```mermaidblocks. Folio colors them according to your active theme swatch! - LaTeX: Use
$E = mc^2$or\(...\)inline. Put display delimiters$$or\[and\]on their own lines. Fencedmathblocks also work. Insert offers editable inline and display examples.
$$
\frac{\partial f}{\partial x} = 2x
$$Equations use bundled KaTeX fonts in preview and PDF. Escape a literal dollar sign as \$ when it could be mistaken for a math delimiter. Math support is for equations inside Markdown; complete .tex documents are not imported.
4. Styles & Typography
Folio bundles 7 curated design presets crafted specifically for print pagination:
Create & Save Styles
Choose Edit styles… in the style picker, or open the inspector's Style tab. Font choices show live previews, and the main color controls update your document immediately. More options contains the detailed palette, including code syntax colors.
- Duplicate style starts from the current theme and edits.
- New style starts from a built-in theme.
- Save style changes updates the named style; save the document to persist its library.
Named styles appear under My styles in the picker. They are stored inside the .folio document along with the active style and revision snapshots. A Markdown draft with named styles offers a Folio save so the library is retained; exporting Markdown carries the applied font/color overrides. Previously saved app styles remain available and are copied into a document when used.
Reusable named styles and their MCP tools are listed under Next release in the changelog.
Per-Document Overrides
You can override any theme's color palette or font families inside your Markdown frontmatter:
---
theme: editorial
theme-overrides:
heading: "#2563eb"
cover-accent: "#2563eb"
font-display: "Space Grotesk, sans-serif"
font-body: "Inter, sans-serif"
font-code: "JetBrains Mono, monospace"
font-mono: "JetBrains Mono, monospace"
---Page Breaks and Landscape Sections
Use Insert → Page break, or put <!-- pagebreak --> on its own line. For an individual wide section inside a portrait document, use the landscape comments below on separate lines:
<!-- Force a clean page break before a new section -->
<!-- pagebreak -->
<!-- Rotate a wide financial table or diagram into landscape mode -->
<!-- landscape -->
| Q1 Revenue | Q2 Revenue | Q3 Revenue | Q4 Revenue | Total YTD | Margin |
|:---|:---|:---|:---|:---|:---|
| $1,200,000 | $1,450,000 | $1,800,000 | $2,100,000 | $6,550,000 | 38.2% |
<!-- /landscape -->5. Model Context Protocol (MCP) Integration
Folio includes a native Model Context Protocol (MCP) server. This allows AI coding agents and LLM clients (such as Claude Desktop, Cursor, Google Antigravity, Cline, and Windsurf) to inspect document schemas, create branded documents, customize frontmatter, lint formatting, and compile pixel-perfect PDFs end-to-end.
Zero-Clone Connection via Native App Flag (--mcp)
You do not need to clone this repository, install Node.js, or hardcode development paths. If you have Folio.app installed in your Applications folder, launch it directly in headless MCP mode:
/Applications/Folio.app/Contents/MacOS/Folio --mcpPro Tip: Create a system-wide folio CLI shortcut
Run this one-line command in your terminal to symlink Folio to your PATH:sudo ln -sf /Applications/Folio.app/Contents/MacOS/Folio /usr/local/bin/folio
Then you can simply configure your AI tools to run folio --mcp anywhere!
Client Configuration Snippets
Copy and paste the configuration block for your preferred AI client:
Claude Desktop
File: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"folio": {
"command": "/Applications/Folio.app/Contents/MacOS/Folio",
"args": ["--mcp"]
}
}
}Cursor
File: .cursor/mcp.json or Settings > Features > MCP
{
"mcpServers": {
"folio": {
"command": "/Applications/Folio.app/Contents/MacOS/Folio",
"args": ["--mcp"]
}
}
}Google Antigravity
File: ~/.gemini/config/mcp_config.json
{
"mcpServers": {
"folio": {
"command": "/Applications/Folio.app/Contents/MacOS/Folio",
"args": ["--mcp"]
}
}
}The 12 MCP Agent Tools
The document tools read and write Markdown. The five style tools operate on an existing .folio file saved in the app. This reference follows the current source; see the changelog for released availability.
| Tool Name | Purpose |
|---|---|
folio_list_document_types | Lists 10 built-in presets, including scientific-paper, plus custom workspace presets. No inputs. |
folio_get_document_type | Takes typeId; returns fields, defaults, starter content, supported placeholders, and editable theme tokens. |
folio_create_document | Takes required title and content; optional type, theme, metadata, themeOverrides, and outputPath. Returns Markdown and lint findings. |
folio_customize_document | Takes source or filePath, with optional setLayout, setTheme, setMetadata, setThemeOverrides, setHeader, setFooter, and outputPath. |
folio_lint_document | Takes source or filePath; checks fences, landscape markers, local heading anchors, tables, and frontmatter guidance. Returns counts and findings. |
folio_export_pdf | Takes inputPath or source, required outputPath, and optional theme/lang export overrides. Renders portrait or landscape PDF pages. |
folio_register_document_type | Takes required id, name, description, and baseLayout; optional defaults, headers/footers, fields, and starterTemplate. Saves to .folio/presets/<id>.json. |
folio_list_styles | Reads named document styles, the active style, font choices, and editable tokens from a .folio file. |
folio_create_style | Creates a named style inside the document from a base theme and overrides. |
folio_duplicate_style | Copies a named style or the current document appearance. |
folio_update_style | Updates a saved style without applying it to the document. |
folio_apply_style | Applies a document style while preserving attachments and recording a restorable revision. |
Pass outputPath to create/customize when you want to save the returned Markdown. Customizing a file without an output path returns changes without writing them; use the same input and output path to overwrite it. Metadata updates may rewrite YAML comments. Supply an empty content string to create from the preset's starter body.
Style tools take a required filePath. List styles to discover IDs and available font/color tokens. Create, duplicate, and update change the library; apply changes the document's appearance. Style mutations preserve attachments and record a restorable revision when something changes. Updates to an open file use the editor's external-change/reload flow.
For folio_create_style, supply name, theme, and optional overrides. Duplicate accepts optional styleId and name. Update requires styleId with optional name, theme, and overrides; its override map replaces the saved map. Apply requires styleId.
Create a Scientific Article
Inspect scientific-paper with folio_get_document_type, then call folio_create_document with these arguments:
{
"type": "scientific-paper",
"title": "Reproducible State Estimation",
"metadata": {
"authors": ["Alex Rivera", "Sam Chen"],
"affiliations": ["Example Research Lab"],
"orientation": "portrait"
},
"content": "## 1. Introduction\n\nResearch question and contribution.\n",
"outputPath": "./article.md"
}Lint with folio_lint_document using filePath: "./article.md", then export with folio_export_pdf using inputPath: "./article.md" and outputPath: "./article.pdf". Set metadata.orientation to landscape for a wide document. Layouts are report, simple, invoice, cv, and scientific.
To export a saved style through MCP, apply it to the existing Folio file, then pass the returned markdown as source to lint and PDF export. The create/export document tools do not directly read or create Folio archives.
See the complete MCP reference for all parameter names and examples.
Custom Presets in .folio/presets/
Registering a custom document format saves it into .folio/presets/<id>.json under the MCP server's working directory. Start the server in your workspace to discover that workspace's presets.
6. Development & Contributing
Contributing to Folio or running the app from source is straightforward:
Prerequisites
- macOS (Apple Silicon or Intel)
- Node.js 22.12 or newer
- pnpm 11+ (
corepack enable && corepack prepare pnpm@latest --activate)
Cloning & Running Locally
# 1. Clone the repository
git clone https://github.com/carlosrivera/folio.git
cd folio
# 2. Install dependencies
pnpm install
# 3. Start development environment
pnpm devpnpm dev starts the Vite renderer server on localhost:5173 and launches the Electron application with hot reloading.
Running Tests & Verification
# Run Vitest unit tests (lib, diff, document parser, linting, mcp server)
pnpm test
# Run full project verification (TypeScript + Vitest + Render Tests + Editor Smoke)
pnpm check
# Run headless golden visual regression tests
pnpm test:render
# Test MCP server directly over stdio
pnpm mcpPackaging macOS Releases Locally
Folio uses electron-builder to produce separate Apple Silicon and Intel apps, disk images, and ZIP archives:
# Build macOS distributables (.dmg and .zip) into dist-packaged.noindex/
pnpm dist:mac
# Build unpackaged directory app for inspection
pnpm dist:dirFor a signed release, FOLIO_NOTARY_PROFILE=ocelo-notary pnpm release:mac:local uses the configured Keychain credentials, verifies both app bundles, and notarizes and staples the signed disk images. This requires the project's signing/notarization setup.
Create the GitHub release draft, then run pnpm release:mac:upload to upload the verified Mac artifacts. The upload checks remote sizes and SHA-256 hashes before removing that version's local staging files; failed uploads keep local output. Build output uses dist-packaged.noindex/ to keep staging copies out of Spotlight.
Landing Page & Docs Development
# Run Astro docs & landing server locally
pnpm landing:dev
# Build static production site to landing/dist/
pnpm landing:build
# Preview the production build
pnpm landing:previewPushes to main deploy the website through GitHub Pages. Documentation lives at /folio/docs/; shared navigation uses the same directory URL on desktop and mobile.