Download the PHP package undefinedoffset/silverstripe-markdown without Composer
On this page you can find all versions of the php package undefinedoffset/silverstripe-markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download undefinedoffset/silverstripe-markdown
More information about undefinedoffset/silverstripe-markdown
Files in undefinedoffset/silverstripe-markdown
Package silverstripe-markdown
Short Description Adds a field and a data type that allows for Markdown editing, uses the github api to render the html
License BSD-3-Clause
Informations about the package silverstripe-markdown
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
- SilverStripe 4.x
- PHP cURL Support
Installation
- Install with composer:
composer require undefinedoffset/silverstripe-markdown ^2.0
- Run
dev/build?flush=all
to regenerate the manifest
Usage
Use the Markdown data type as your fields data type, then use the MarkdownEditor field in the cms for editing.
Page class
Template
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.
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:
GithubMarkdownRenderer
The following options are available on the default GithubMarkdownRenderer:
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 for this to work - it can be installed with composer.
Note: This renderer does not support Github Flavoured Markdown.
All versions of silverstripe-markdown with dependencies
michelf/php-markdown Version ^1.8
ext-json Version *
ext-curl Version *