PHPackages                             undefinedoffset/silverstripe-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. undefinedoffset/silverstripe-markdown

ActiveSilverstripe-vendormodule[Parsing &amp; Serialization](/categories/parsing)

undefinedoffset/silverstripe-markdown
=====================================

Adds a field and a data type that allows for Markdown editing, uses the github api to render the html

2.0.1(6y ago)126.5k7[3 issues](https://github.com/UndefinedOffset/silverstripe-markdown/issues)1BSD-3-ClausePHP

Since Jul 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/UndefinedOffset/silverstripe-markdown)[ Packagist](https://packagist.org/packages/undefinedoffset/silverstripe-markdown)[ RSS](/packages/undefinedoffset-silverstripe-markdown/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (9)Used By (1)

Markdown Editor and DBField
===========================

[](#markdown-editor-and-dbfield)

Adds a field and a data type that allows for Markdown editing, uses a supported renderer (default is the GitHub API) to render the HTML.

Requirements
------------

[](#requirements)

- SilverStripe 4.x
- PHP cURL Support

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

[](#installation)

- Install with [composer](https://getcomposer.org): `composer require undefinedoffset/silverstripe-markdown ^2.0`
- Run `dev/build?flush=all` to regenerate the manifest

Usage
-----

[](#usage)

Use the Markdown data type as your fields data type, then use the MarkdownEditor field in the cms for editing.

### Page class

[](#page-class)

```
use UndefinedOffset\Markdown\Forms\MarkdownEditor;

class MyPage extends Page
{
    public static $db = array(
        'MarkdownContent' => 'Markdown'
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $editor = new MarkdownEditor('MarkdownContent', 'Page Content (Markdown)');
        $editor->setRows(15); //optional, set number of rows in CMS
        $editor->setWrapMode(true); //optional, turn on word wrapping
        $fields->addFieldToTab('Root.Main', $editor);

        return $fields;
    }
}
```

### Template

[](#template)

```

    $MarkdownContent

```

You may also request the markdown using Github Flavored Markdown by calling $YourField.AsHTML(true) in your template by default Github Flavored Markdown is not used just regular Markdown is used.

```

    $MarkdownContent.AsHTML(true)

```

### Configuration

[](#configuration)

The default renderer is the GitHub renderer. However, other renderers are supported.

To set what renderer to use, in `_config.php` do the following:

```
use UndefinedOffset\Markdown\Model\FieldTypes\Markdown;

// Fully qualified (namespaced) class name of any implementation of IMarkdownRenderer will work:
Markdown::setRenderer('UndefinedOffset\\Markdown\\Renderer\\GithubMarkdownRenderer');
```

#### GithubMarkdownRenderer

[](#githubmarkdownrenderer)

The following options are available on the default GithubMarkdownRenderer:

```
use UndefinedOffset\Markdown\Renderer\GitHubMarkdownRenderer;

// authenticate to the Github API to get 5,000 requests per hour instead of 60
GithubMarkdownRenderer::useBasicAuth('github username', 'github password');
// whether or not to use Github Flavoured Markdown
GithubMarkdownRenderer::setUseGFM(true);
```

#### PHPMarkdownMarkdownRenderer

[](#phpmarkdownmarkdownrenderer)

PHPMarkdownMarkdownRenderer is simple and has no options. Use this to avoid the delay on page load the first time after editing that comes from using the Github renderer (especially if the page has many sections of markdown). You will need to install [PHP Markdown](https://github.com/michelf/php-markdown) for this to work - it can be installed with composer.

**Note:** This renderer does not support Github Flavoured Markdown.

```
use UndefinedOffset\Markdown\Model\FieldTypes\Markdown;

Markdown::setRenderer('UndefinedOffset\\Markdown\\Renderer\\PHPMarkdownMarkdownRenderer');
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~306 days

Recently: every ~218 days

Total

8

Last Release

2540d ago

Major Versions

0.2.2 → 2.0.0-alpha12017-01-09

1.0.0 → 2.0.02019-05-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/60d2d4134f2e196b585f3320d1d7245c03df87a521bc3e17184d16e7ba02f0ee?d=identicon)[UndefinedOffset](/maintainers/UndefinedOffset)

---

Top Contributors

[![UndefinedOffset](https://avatars.githubusercontent.com/u/1391558?v=4)](https://github.com/UndefinedOffset "UndefinedOffset (25 commits)")[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (7 commits)")[![muskie9](https://avatars.githubusercontent.com/u/870751?v=4)](https://github.com/muskie9 "muskie9 (3 commits)")

---

Tags

silverstripemarkdown

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/undefinedoffset-silverstripe-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/undefinedoffset-silverstripe-markdown/health.svg)](https://phpackages.com/packages/undefinedoffset-silverstripe-markdown)
```

###  Alternatives

[kartik-v/yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0

88265.8k6](/packages/kartik-v-yii2-markdown)[vtalbot/markdown

Markdown compiler for Laravel 5

100204.2k3](/packages/vtalbot-markdown)[maglnet/magl-markdown

Provides a ZF2 View Helper to render markdown syntax. It uses third-party libraries for the rendering and you can switch between different renderers.

22178.2k4](/packages/maglnet-magl-markdown)[silverstripers/markdown

Markdown DB field and form field for SilverStripe

112.5k](/packages/silverstripers-markdown)[phptek/jsontext

JSON storage, querying and modification.

2222.2k2](/packages/phptek-jsontext)[joomlatools/pages

Joomlatools Pages is a very fast just-in-time page generator and flexible framework that makes building websites with any CMS, API, or database fun again. It can be installed in Joomla as a component, or be used standalone

473.7k](/packages/joomlatools-pages)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
