mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 20:27:40 +02:00
#431 markdown plugin added
This commit is contained in:
@@ -14,6 +14,7 @@ charset: UTF-8
|
||||
theme: default
|
||||
|
||||
plugins:
|
||||
- Markdown
|
||||
|
||||
pages:
|
||||
flush_cache: false
|
||||
|
24
site/plugins/Markdown/Markdown.php
Executable file
24
site/plugins/Markdown/Markdown.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Monstra;
|
||||
|
||||
class Markdown extends Plugin
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Monstra
|
||||
*/
|
||||
protected $monstra;
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*/
|
||||
public function __construct(Monstra $c)
|
||||
{
|
||||
$this->monstra = $c;
|
||||
$this->monstra['filters']->addListener('content', function($content) {
|
||||
return $this->monstra['markdown']->text($content);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
new Markdown($monstra);
|
13
site/plugins/Markdown/Markdown.yml
Executable file
13
site/plugins/Markdown/Markdown.yml
Executable file
@@ -0,0 +1,13 @@
|
||||
name: Markdown
|
||||
version: 1.0.0
|
||||
description: "Markdown parser plugin for Monstra"
|
||||
author:
|
||||
name: Sergey Romanenko
|
||||
email: awilum@msn.com
|
||||
url: http://monstra.org
|
||||
homepage: http://monstra.org
|
||||
bugs: http://monstra.org
|
||||
license: MIT
|
||||
|
||||
# Plugin settings
|
||||
enabled: true
|
Reference in New Issue
Block a user