From ce97879d6c24c77545870ed1b888039499c31703 Mon Sep 17 00:00:00 2001 From: Joel Knight Date: Wed, 8 Jan 2020 21:43:39 -0700 Subject: [PATCH 1/3] 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 }} From 92cc5bcd230494e95dcbe6432b17579a20c164b8 Mon Sep 17 00:00:00 2001 From: Joel Knight Date: Sat, 25 Jan 2020 21:18:08 -0700 Subject: [PATCH 2/3] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Radek KozieĊ‚ --- layouts/shortcodes/prismjs.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/prismjs.html b/layouts/shortcodes/prismjs.html index dabc24b..8673049 100644 --- a/layouts/shortcodes/prismjs.html +++ b/layouts/shortcodes/prismjs.html @@ -6,8 +6,8 @@
Date: Sun, 26 Jan 2020 14:53:18 -0700
Subject: [PATCH 3/3] Apply suggestions from code review

Co-Authored-By: Radek Kozie. 
---
 layouts/shortcodes/prismjs.html | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/layouts/shortcodes/prismjs.html b/layouts/shortcodes/prismjs.html
index 8673049..238f419 100644
--- a/layouts/shortcodes/prismjs.html
+++ b/layouts/shortcodes/prismjs.html
@@ -3,21 +3,19 @@
   
{{ $inner }}
{{ else }} {{ if .IsNamedParams }} -
{{ $inner }}
{{ else }}