mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
Add custom rtl shortcode
This commit is contained in:
parent
f0b93761b1
commit
b729586690
2 changed files with 15 additions and 0 deletions
1
config/plugins/shortcode-core.yaml
Normal file
1
config/plugins/shortcode-core.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
custom_shortcodes: '/user/custom/shortcodes'
|
14
custom/shortcodes/RTLShortcode.php
Normal file
14
custom/shortcodes/RTLShortcode.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
namespace Grav\Plugin\Shortcodes;
|
||||
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
|
||||
class RTLShortcode extends Shortcode
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->shortcode->getHandlers()->add('rtl', function(ShortcodeInterface $sc) {
|
||||
return '<div dir="rtl">'.$sc->getContent().'</div>';
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue