Home

Awesome

Yii2 Lepture Markdown Editor widget

Latest Version on Packagist Software License Total Downloads

Yii2 widget for Lepture Markdown Editor (https://github.com/lepture/editor) - A markdown editor you really want

Demo

on http://lab.lepture.com/editor/

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
				]
			])

Credits

License

The MIT License (MIT). Please see License File for more information.