Skip to content

Variables

Variables let you define a value once and use it in multiple places. When the document is rendered, the variable placeholder is replaced with the actual value.

This is a feature unique to Bokuchi — it’s especially useful for templates, reports, and documents where the same information (like a project name, date, or author) appears in several places.

Write {{variableName}} anywhere in your document. In the preview, it will be replaced with the value you defined.

If you define a variable author with the value Alice, then:

Written by {{author}}

will display as:

Written by Alice

Global variables are available in all files. They are managed in the settings panel.

  1. Open Settings (Cmd+, on macOS / Ctrl+, on Windows/Linux)
  2. Go to the Global Variables tab
  3. Add a variable name and value, then click Add
Settings panel showing the Global Variables tab
  • Company name, department name
  • Author name
  • Common URLs or paths
Preview showing variables expanded to their actual values

You can define variables that apply only to the current file using an HTML comment at the top of the file:

<!-- @var title: Monthly Report -->
<!-- @var date: 2026-03-01 -->
<!-- @var author: Alice -->
# {{title}}
Date: {{date}}
Author: {{author}}
<!-- @var variableName: value -->

When the same variable name is defined both locally and globally:

  1. File-local variable — used first
  2. Global variable — used if no local definition exists
  3. Undefined — the {{variableName}} text is displayed as-is

You can export all global variables to a YAML file and import them on another machine or share them with your team.

  • Export: Settings > Global Variables > Export
  • Import: Settings > Global Variables > Import

Bokuchi can save a copy of your document with all variables replaced by their actual values. This is useful when you need to share a finalized version.

  • Settings — Configure global variables
  • Export — Export documents with variables expanded