Create custom shortcode for root shell

This commit is contained in:
RealStickman 2023-06-02 13:14:26 +00:00
parent 9fa1446713
commit 1e0db19aaf
2 changed files with 18 additions and 0 deletions

View 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>';
});
}
}
?>

View File

@ -0,0 +1,3 @@
<?php
include('CustomPrismjs.php');
?>