Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript PHP Other
tree: eca2212d10

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
code
css
javascript
scss
templates
.gitignore
README.md
_config.php
config.rb

README.md

Silverstripe 3.0 MarkdownEditor Field

Requires Silverstripe 3.0 and a modern browser.

A simple, yet versatile field for nice textediting in the Silverstripe CMS. It's based on the ACE Editor.

Features:

Suggest Link: [Testlink](: leads to an autosuggest-field. <<<<<<< HEAD Suggest Image: ![Image Description](! opens an image-autosuggest field.

Getting the markdown editor field as a replacement for TinyMCE is easy:

public function getCMSFields() {
        $fields = parent::getCMSFields();
        $md = new MarkdownField('Content', 'Content');
        $md->addExtraClass('stacked'); // Little different Layout in CMS
        $fields->addFieldToTab('Root.Main', $md);
        return $fields;
}

To use the Markdown-Formatted Content on the website, use e.g. instead of $Content $Content.Parse(MarkdownParser).

To get the same Syntax Highlighting as in the preview pane inside the Editor, include markdown/javascript/lib/highlight/src/highlight.pack.js to your template. Initialization could look like this (with jQuery):

$(document).ready(function() {
  $('pre code').each(function(i, e) {hljs.highlightBlock(e)});
});

More examples are on http://softwaremaniacs.org/soft/highlight/en/description/ (All credit to them)

The Markdown Logo was made by Dustin Curtis. All other icons were made by Orman Clark Premium Pixels

Suggest Image: [Image Description](! opens an image-autosuggest field.


Credits for Markdown Logo go to Dustin Curtis. All other icons were made by Orman Clark Premium Pixels

dbd28e79c3ee8754086350fd3747a5ae2b4877b6

Something went wrong with that request. Please try again.