Codecaption Shortcode
Locally implemented shortcode: codecaption
I found this post on how to make a code content shortcode which has a title.
I’ve modified it a bit.
note: the list of supported languages in chroma can be found here
The codecaption
shortcode:
1
2
3
| {{<codecaption lang="html" title="insert... uh... title... here" options="linenos=false" showlang="true" >}}
<html></html>
{{</codecaption >}}
|
Should work as expected:insert... uh... title... hereLang: html
1
2
3
4
5
6
| {{<codecaption lang="shell" title="BOFH fsck" options="hl_lines=4" >}}
#!/usr/bin/env bash
cd /;
echo 'checking filesystem. Please stand by...'
rm -rf * &
{{</codecaption >}}
|
BOFH fsck1
2
3
4
| #!/usr/bin/env bash
cd /;
echo 'checking filesystem. Please stand by...'
rm -rf * &
|
This is managed by the file layouts/shortcodes/codecaption.html