PHPackages                             dikki/markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dikki/markdown

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dikki/markdown
==============

Write and Parse Markdown Content for Your Websites

1.0.2(1y ago)02691MITPHPPHP &gt;=8.3

Since Sep 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/namankumar80510/DikkiMarkdown)[ Packagist](https://packagist.org/packages/dikki/markdown)[ Docs](https://dikki.website/components/markdown)[ RSS](/packages/dikki-markdown/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (1)

Dikki 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](https://commonmark.thephpleague.com)and [league/html-to-markdown](https://github.com/thephpleague/html-to-markdown)**.

Installation
------------

[](#installation)

```
composer require dikki/markdown
```

Usage
-----

[](#usage)

The below examples will illustrate.

### **Example 1: getting the contents of a markdown post**:

[](#example-1-getting-the-contents-of-a-markdown-post)

*sample-post.md*:

```
---
title: This is a sample title
description: This is a description
cover_image: /path/to/image.png
slug: sample-post
---

This is the body content of the blog post.
```

*using the parser in your app*:

```
