damcclean / metaparsedown-extra
Adds the ability to pharse YAML and Markdown extra. Powered by Parsedown Extra.
Installs: 1 505
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- erusev/parsedown-extra: ^0.7.1 || ^0.8.0
- symfony/yaml: ^3.3 || ^5.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2022-03-17 21:32:39 UTC
README
MetaPharsedown-extra extends erusev/parsedown, a markdown parser, by adding the ability to have metadata in markdown files in the form of valid yaml. MetaPharsedown uses the Symfony Yaml component to parse and extract the metadata.
This package is a fork on top of MetaParsedown, that uses Parsedown Extra instead of Parsedown.
All the methods in this package are the same as the standard MetaParsedown package.
Installation
composer require damcclean/metaparsedown-extra
Usage
$mp = new MetaParsedown(); $markdown = file_get_contents(....); $html = $mp->text($markdown); // Return the html, without meta data $meta = $mp->meta($markdown); // Return array of key/values and pairs $bare = $mp->stripMeta($markdown); // Return markdown without yaml block
You can find more documentation on the original Parsedown-extra package.