Parsedown plugin for Craft
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
parsedown
.gitignore
LICENSE
README.md Bumped version to 1.2 Nov 20, 2016
composer.json
composer.lock
releases.json

README.md

Parsedown plugin for Craft

This plugin adds Parsedown support to Craft.

Installation

To install Parsedown, follow these steps:

  1. Upload the parsedown/ folder to your craft/plugins/ folder.
  2. Go to Settings > Plugins from your Craft control panel and enable the Parsedown plugin.

Templating

To use Parsedown in your templates, just pass some text into the parsedown filter:

{{ entry.myBodyField|parsedown }}

A pd shortcut filter is also available:

{{ entry.myBodyField|pd }}

The filters also work in a single-line mode, where the text that’s passed in will not include wrapping <p> tags:

<h1>{{ entry.title|parsedown('line') }}</h1>

Plugin API

Other plugins can take advantage of Parsedown using the provided API:

$parsedText = craft()->parsedown->parseText($entry->myBodyField);

$parsedLine = craft()->parsedown->parseLine($entry->title);

Changelog

1.2

  • Updated erusev/parsedown to 1.6.1.

1.1

  • Updated to take advantage of new Craft 2.5 plugin features.

1.0

  • Initial release.