Skip to content

pixelandtonic/Parsedown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.