frontmatter

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

fm: Markdown frontmatter batch editor

Harmonize, refactor, and batch edit YAML frontmatter using SQL expressions.

Designed for Markdown in general and Obsidian in particular. Vaults are modelled as big jagged tables where documents are rows and fields are columns.

Installation

Requirements: Git, Go, and Just:

git clone git@github.com/NoFuss-io/frontmatter.git
cd frontmatter
just install
just install-skill

⚠️ 👉 Note: I recommend only using fm on Vaults under version control or backup, in case you mess up. Like most terminal commands, it's got no undo feature.

In a nutshell

fm \
    SELECT [expression], ... \
    FROM [files] \
    WHERE [condition] \
    SORT BY [expression], ... \
    LIMIT [number]
fm UPDATE [files] SET [assignment], ... WHERE [condition];
fm ALTER [files] DROP [field], ... WHERE [condition];
fm ALTER [files] RENAME [field] TO [field], ... WHERE [condition];

For example:

fm select vegan, vegetarian from recipes/*
filename                                          vegan  vegetarian
--------                                          -----  ----------
Amaretto-grädde.md                                false  true
Apelsinkaka.md
Apfelstrudel.md
Baba ganoush.md                                   true
Bacon Jam.md
Baconlindad fläskfilé med örter och senapssås.md
Banan- och havrecookies.md                        true
Basilikakyckling.md
Bechamelsås.md                                    false  true
Belugabolognese.md                                true

Syntax

SQL syntax follows BigQuery dialect but implements only a subset of it (see manual).

Notably missing:

  • Functions (in the roadmap)
  • Joins
  • Aggregations
  • Window functions
Notable additions
Shorthand type checking and casting

Only return documents with a property of a given type:

fm 'select * from recipes/* where `Prep time`:int'
fm 'select * from recipes/* where `Prep time` and not `Prep time`:int'

Cast field to type:

fm 'update recipes/* set `Prep time`:int where `Prep time`'

Read more.

Documentation

Overview

Package frontmatter is the public library API for fm. It re-exports the types and functions that downstream Go applications need to parse, run, and inspect frontmatter queries against Markdown files.

Index

Constants

This section is empty.

Variables

View Source
var (
	ParseProgram = internal.ParseProgram
	ParseQuery   = internal.ParseQuery
	ReadDocument = internal.ReadDocument
	Write        = internal.Write
	ExpandGlobs  = internal.ExpandGlobs
	NewOutput    = internal.NewOutput
	PrintTable   = internal.PrintTable
)

Functions

This section is empty.

Types

type AlterQuery

type AlterQuery = internal.AlterQuery

type Document

type Document = internal.Document

type ExecOptions

type ExecOptions = internal.ExecOptions

type FilePath

type FilePath = internal.FilePath

type FrontMatter

type FrontMatter = internal.FrontMatter

type Output

type Output = internal.Output

type Program

type Program = internal.Program

type Query

type Query = internal.Query

type SelectQuery

type SelectQuery = internal.SelectQuery

type Table

type Table = internal.Table

type TableRow

type TableRow = internal.TableRow

type UpdateQuery

type UpdateQuery = internal.UpdateQuery

Directories

Path Synopsis
cmd
fm command

Jump to

Keyboard shortcuts

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