Yii2 widget for Lepture Markdown Editor
Mar 29, 2014, 7:49:00 PMUses https://github.com/lepture/editor - "a markdown editor you really want".
I am using this editor on my blog and prefer it over EpicEditor. It's much handy to write posts with realtime basic highlight of Markdown syntax.
Demo
Installation via Composer
add to require
section of your composer.json
"ijackua/yii2-lepture-markdown-editor-widget"
and run composer update
Usage example
Active widget
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
])
Simple widget
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'name' => 'editor',
'value' => '# Hello world'
])
Editor options
see on official site
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
'leptureOptions' => [
'toolbar' => false
]
])
Marked options (markdown parser used by Lepture Editor)
see on official Marked site
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
'markedOptions' => [
'tables' => false
]
])