From ce97879d6c24c77545870ed1b888039499c31703 Mon Sep 17 00:00:00 2001 From: Joel Knight Date: Wed, 8 Jan 2020 21:43:39 -0700 Subject: [PATCH] Import shortcode to activate PrismJS plugins The shortcode takes named parameters that are relevant to the PrismJS plugins that Terminal bundles. - lang: the language contained in the code block - line: the line number(s) to highlight - line-numbers: displays line numbers in the margin - command-line: activates the command-line plugin which modifies the output to show a command line - user: the username to display in the prompt (used with the command-line parameter) - host: the hostname to display in the prompt (used with the command-line parameter) - prompt: override the default prompt (used with the command-line parameter) - output: specifies which line(s) contain CLI output (used with the command-line parameter) Example: {{< prismjs lang="bash" line="1,10-13" line-numbers="true" command-line="true" host="jump1" user="joel" output="2-9" >}} --- layouts/shortcodes/prismjs.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 layouts/shortcodes/prismjs.html diff --git a/layouts/shortcodes/prismjs.html b/layouts/shortcodes/prismjs.html new file mode 100644 index 0000000..dabc24b --- /dev/null +++ b/layouts/shortcodes/prismjs.html @@ -0,0 +1,27 @@ +{{ $inner := replaceRE "^\n" "" .Inner }} +{{ if len .Params | eq 0 }} +
{{ $inner }}
+{{ else }} + {{ if .IsNamedParams }} +
{{ $inner }}
+ {{ else }} +
+      {{ $inner }}
+ {{ end }} +{{ end }}