Download the PHP package dikki/markdown without Composer
On this page you can find all versions of the php package dikki/markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dikki/markdown
More information about dikki/markdown
Files in dikki/markdown
Package markdown
Short Description Write and Parse Markdown Content for Your Websites
License MIT
Homepage https://dikki.website/components/markdown
Informations about the package markdown
Dikki Markdown
Dikki Markdown is a league/commonmark
wrapper you can use to fetch contents, including the front matter, from markdown
files. Say you
write your blog posts in markdown. You can use this package to fetch the contents of the markdown file as html and the
rest of the front matter as arrays.
You can also convert html to markdown using this package.
Basically, it is just a wrapper around league/commonmark and league/html-to-markdown.
Installation
Usage
The below examples will illustrate.
Example 1: getting the contents of a markdown post:
sample-post.md:
using the parser in your app:
Output:
As you can see, you get an array of meta-data you passed as Yaml in the markdown file as well as the content you wrote.
Converting Html to Markdown
Simply use the HtmltoMdConverter()
class's convert()
method:
All versions of markdown with dependencies
league/commonmark Version ^2.5
league/html-to-markdown Version ^5.1
nette/utils Version ^4.0
symfony/yaml Version *