bulldog / front-matter
YAMl/Markdown
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/bulldog/front-matter
Requires
- erusev/parsedown: ^1.7
- symfony/yaml: ^4.1
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.3
This package is auto-updated.
Last update: 2025-10-05 21:06:10 UTC
README
This uses Parsedown and Symfony/Yaml.
Example
This is an example source file. It has YAML at the top and Markdown under that.
--- title: Hello World --- # Hello World It is i, levi. [test](https://google.com)
Then we use the following PHP to read the config and the HTML.
<?php include 'vendor/autoload.php'; $fm = Bulldog\FrontMatter::load('file.yaml'); var_dump($fm->config()); // Output /* array(1) { 'title' => string(11) "Hello World" } */ var_dump($fm->html()); // Output /* string(85) "<h1>Hello World</h1><p>It is i, levi.</p><p><a href="https://google.com">test</a></p>" */