Structured-object check types validate structured frontmatter fields using schema-backed checks.

Check types in this family:

  • Field enum: Require that a field is one of a fixed set of values.
  • Field type: Require that a frontmatter field has a specific type.
  • Number range: Constrain a numeric field to a minimum and/or maximum value.
  • Required field: Require that a frontmatter field exists.
  • Sentence case: Require a string field to read as sentence case, not Title Case.
  • String length: Constrain the minimum and/or maximum length of a string field.
  • Unique field: Require that no two items share a value for a frontmatter field.
  • Object validation: Validate frontmatter metadata against a named JSON Schema from schemas:.

Worked example#

The notes collection binds the book schema, which requires title and an integer year. This item satisfies both, so check exits 0 and prints OK.

Input#

notes/dune.md

---
title: Dune
year: 1965
---
# Dune

.katalyst/storage/my_directory.yaml

type: filesystem
root: .
collections:
  notes:
    path: notes
    schema: book

.katalyst/schemas/book.yaml

type: object
required: [title, year]
properties:
  title: { type: string }
  year:  { type: integer }

Command#

$ katalyst check notes/dune
<project>/notes/dune.md: OK