2020-06-18 01:21:15 +03:00
|
|
|
{{ $inner := replaceRE "^\n" "" .Inner | string }}
|
2020-01-09 07:43:39 +03:00
|
|
|
{{ if len .Params | eq 0 }}
|
|
|
|
<pre><code>{{ $inner }}</code></pre>
|
|
|
|
{{ else }}
|
|
|
|
{{ if .IsNamedParams }}
|
2020-01-27 00:53:18 +03:00
|
|
|
<pre class="
|
|
|
|
{{- if .Get "lang" }}language-{{ .Get "lang" }}{{ end }}
|
|
|
|
{{- if .Get "line-numbers" }} line-numbers{{ end }}
|
|
|
|
{{- if .Get "command-line" }} command-line{{ end }}"
|
|
|
|
{{- /* line highlight plugin */ -}}
|
|
|
|
{{- if .Get "line" }} data-line="{{ .Get "line" }}"{{ end }}
|
|
|
|
{{- /* line number plugin */ -}}
|
|
|
|
{{- if .Get "start" }} data-start="{{ .Get "start" }}"{{ end }}
|
|
|
|
{{- /* command-line plugin */ -}}
|
|
|
|
{{- if .Get "user" }} data-user="{{ .Get "user" }}"{{ end }}
|
|
|
|
{{- if .Get "host" }} data-host="{{ .Get "host" }}"{{ end }}
|
|
|
|
{{- if .Get "prompt" }} data-prompt="{{ .Get "prompt" }}"{{ end }}
|
|
|
|
{{- if .Get "output" }} data-output="{{ .Get "output" }}"{{ end }}
|
2020-01-09 07:43:39 +03:00
|
|
|
><code {{ if .Get "lang" }}class="language-{{ .Get "lang" }}"{{ end }}
|
|
|
|
>{{ $inner }}</code></pre>
|
|
|
|
{{ else }}
|
|
|
|
<pre class="language-{{ .Get 0 }}">
|
|
|
|
<code class="language-{{ .Get 0 }}">{{ $inner }}</code></pre>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|