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

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

silverstripers/markdown
=======================

Markdown DB field and form field for SilverStripe

2.0.0(8y ago)112.5k↓100%9[4 issues](https://github.com/HelloBetterLTD/markdownfield/issues)[1 PRs](https://github.com/HelloBetterLTD/markdownfield/pulls)BSD-3-ClauseJavaScript

Since Aug 29Pushed 3y ago4 watchersCompare

[ Source](https://github.com/HelloBetterLTD/markdownfield)[ Packagist](https://packagist.org/packages/silverstripers/markdown)[ RSS](/packages/silverstripers-markdown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

MarkdownField
=============

[](#markdownfield)

[![CircleCI](https://camo.githubusercontent.com/6fe42bc5ce55c9f4ed3afc136d864f353b3ae3ef4a16698e90999c7e79b16a0b/68747470733a2f2f636972636c6563692e636f6d2f67682f53696c76657253747269706572732f6d61726b646f776e6669656c642f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/SilverStripers/markdownfield/tree/master)[![codecov](https://camo.githubusercontent.com/fac67fbe7d86d9660313cbef2fd5b13cfff4de52111663fef146a4b204ebee41/68747470733a2f2f636f6465636f762e696f2f67682f53696c76657253747269706572732f6d61726b646f776e6669656c642f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/SilverStripers/markdownfield)

This module introduces a new DB field type Markdown &amp; Markdown Editor. It uses github style Markdown style. And uses the simple markdown editor.

The module is still under development, but soon will be ready, with link popups and image selectors.

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

[](#installation)

Use composer

```
composer require silverstripers/markdown dev-master

```

Basic Usage
-----------

[](#basic-usage)

To use the markdown DB field in your data objects the basic code would look like

```

class MyDataClass extends DataObject
{

    private static $db = [
		'MarkdownContent'		=> 'MarkdownText'
	];

}

```

MarkdownText knows to add a markdown editor for your fields, but if you need to manually specify the type of field use

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

    $fields->addFieldsToTab('Root.Sidebar', [
        \SilverStripers\markdown\forms\MarkdownEditorField::create('MarkdownContent', 'Content'),
    ]);

    return $fields;
}

```

Force all the fields to use Markdown
------------------------------------

[](#force-all-the-fields-to-use-markdown)

If you are looking to replace all the fields of HTMLText to markdown use the following configs in the config.yml.

This should override any instances of the HTMLText replacements with MarkdownText

```
---
Name: myconfigs
After:
  - '#corefieldtypes'
---
SilverStripe\Core\Injector\Injector:
  HTMLText:
    class: SilverStripers\markdown\db\MarkdownText

```

Add preview styles
------------------

[](#add-preview-styles)

You can add your own CSS styles to the editor previews. This would let the users to check how their content will be displayed before they save in.

To achived this create a css file in `mysite/css/` and name it as `editor.css`.

Your CSS rules have to be nested in a class so it wont affect other areas of the CMS.

```
.markdown-preview {
    background-color: white;
    padding: 20px;
    font-size: 20px;
}

.markdown-preview h1 {
    font-size: 30px;
}

```

If you are using a separate config and wanting to add styles to that EditorConfig you just add a new class name. This is possible because the fields adds the EditorConfig's identifier on to the preview pane. The below is an example for the default configs.

```
.markdown-preview.default {
    background-color: white;
    padding: 20px;
    font-size: 14px;
    line-height: 20px;
}

.markdown-preview.default h1 {
    font-size: 24px;
    line-height: 30px;
}

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% 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 ~23 days

Recently: every ~17 days

Total

6

Last Release

3059d ago

Major Versions

1.0.0 → 2.0.0-beta12017-10-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a6fa4ab2a74fee1ac574bf15dd3ce1f38f31fee60c186b4b24ee8d7e3090b52?d=identicon)[silverstripers](/maintainers/silverstripers)

---

Top Contributors

[![fonsekaean](https://avatars.githubusercontent.com/u/143939?v=4)](https://github.com/fonsekaean "fonsekaean (80 commits)")[![Firesphere](https://avatars.githubusercontent.com/u/680570?v=4)](https://github.com/Firesphere "Firesphere (1 commits)")

---

Tags

javascriptmarkdownmarkdown-editorphpsilverstripe-4silverstripe-modulesilverstripemarkdownmodule

### Embed Badge

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

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

###  Alternatives

[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)[undefinedoffset/silverstripe-markdown

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

126.5k1](/packages/undefinedoffset-silverstripe-markdown)[phptek/jsontext

JSON storage, querying and modification.

2222.2k2](/packages/phptek-jsontext)[unclecheese/silverstripe-serialised-dbfields

Provides serialised data (YAML, JSON) in text fields that are traverseable as nested ViewableData objects.

106.2k](/packages/unclecheese-silverstripe-serialised-dbfields)

PHPackages © 2026

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