Skip to content

A file that isn't valid YAML

pandoc.yaml, shortcuts.yaml and fonts/fonts-registry.yaml are read before any chapter, and the build stops when one does not parse.

What it looks like

ERROR: pandoc.yaml contains invalid YAML
  │ Error: bad file 'pandoc.yaml': go-yaml load error in parser (while parsing a flow sequence) at L1.C8-L2.C1: did not find expected ',' or ']'
  Fix the syntax error.
  See https://keystone.knight-owl.dev/errors/invalid-yaml/#your-metadata-file-doesnt-parse
ERROR: shortcuts.yaml contains invalid YAML
  │ Error: bad file 'shortcuts.yaml': go-yaml load error in scanner (while scanning for the next token) at L3.C1: found character that cannot start any token
  Fix the syntax error, or remove the file.
  See https://keystone.knight-owl.dev/errors/invalid-yaml/#your-shortcuts-file-doesnt-parse
ERROR: fonts/fonts-registry.yaml contains invalid YAML
  │ Error: bad file 'fonts/fonts-registry.yaml': go-yaml load error in scanner (while scanning a quoted scalar) at L2.C13-L3.C1: found unexpected end of stream
  Fix the syntax error, or remove the file.
  See https://keystone.knight-owl.dev/errors/invalid-yaml/#your-font-registry-doesnt-parse

What it means

The quoted line is the YAML parser's. L1.C8-L2.C1 is the stretch it could not read, from line 1, column 8; the mistake is in it. The usual causes are a tab in the indentation, a bracket or quote left open, and an unquoted value holding a colon and a space.

Your metadata file doesn't parse

Every build reads pandoc.yaml, so it has to parse.

Fix the syntax

What belongs in the file is on Book metadata.

Your shortcuts file doesn't parse

shortcuts.yaml is optional. An empty file, or one holding only comments, defines no shortcuts and builds as if it were absent.

A file that parses can still be refused as one that uses an alias or merge key the build can't read: an alias inside the anchor it names, which never ends, or a merge key (<<:) on something other than a map.

Fix the syntax, or remove the file

How the file is laid out is on Writing your own shortcuts.

Your font registry doesn't parse

fonts/fonts-registry.yaml is optional, and only fonts beyond the built-in set need it.

Fix the syntax, or remove the file

What an entry holds is on Typography & fonts.