hyn/frontmatter
最新稳定版本:1.1.1
Composer 安装命令:
composer require hyn/frontmatter
包简介
Markdown including meta information parsing from frontmatters
README 文档
README
An easy package to parse any markdown file that includes some kind of meta data (commonly known as frontmatter).
Installation
composer require hyn/frontmatter
Usage
The easiest way is using inversion of control, but feel free to instantiate the class the way you see fit:
$parser = new \Hyn\Frontmatter\Parser(new \cebe\markdown\Markdown); // Uses json per default, but set specifically: $parser->setFrontmatter(\Hyn\Frontmatter\Frontmatters\JsonFrontmatter::class); // Use toml: $parser->setFrontmatter(\Hyn\Frontmatter\Frontmatters\TomlFrontmatter::class); // Or use yaml: $parser->setFrontmatter(\Hyn\Frontmatter\Frontmatters\YamlFrontmatter::class); // And parse the markdown file: $contents = $parser->parse(file_get_contents('the-file.md')); // Get meta $meta = $parser->getMeta();
统计信息
- 总下载量: 37.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-09