final class Frontmatter

Splits a Markdown definition into its YAML frontmatter and its card body.

The frontmatter is delimited by --- lines and may hold only $schema, version and source.

Methods§

public function read(string $file): array{stdClass, string}

Reads a Markdown definition file.

Parameters

$filestringThe definition file

Returns

array{stdClass, string} The frontmatter and the body after it

Throws

InvalidInputException When the file has no frontmatter, it is not a mapping or has unknown keys
ParseException When the frontmatter is malformed YAML
Test cases 7
Called from 1
Calls 9

Test cases 13§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Method calls 1