Create custom shortcode for root shell
This commit is contained in:
parent
9fa1446713
commit
1e0db19aaf
15
plugins/shortcode-custom/CustomPrismjs.php
Normal file
15
plugins/shortcode-custom/CustomPrismjs.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace Grav\Plugin\Shortcodes;
|
||||||
|
|
||||||
|
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||||
|
|
||||||
|
class CustomPrismjs extends Shortcode
|
||||||
|
{
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->shortcode->getHandlers()->add('sh-root', function(ShortcodeInterface $sc) {
|
||||||
|
return '<pre class="command-line language-sh" data-prompt="#" data-continuation-str="\" tabindex="0"><code class="language-sh">'.$sc->getContent().'</code></pre>';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
3
plugins/shortcode-custom/CustomShortcodes.php
Normal file
3
plugins/shortcode-custom/CustomShortcodes.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
include('CustomPrismjs.php');
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user