mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
♻️ Refactor: mermaid shortcode and codeblock render
This commit is contained in:
@@ -1 +1,2 @@
|
||||
{{- dict "Options" .Attributes "Inner" .Inner | partial "plugin/echarts.html" -}}
|
||||
{{- .Page.Store.Set "hasEcharts" true -}}
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
<pre class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</pre>
|
||||
<template>{{- .Inner | safeHTML }}</template>
|
||||
{{- dict "Options" .Attributes "Inner" .Inner | partial "plugin/mermaid.html" -}}
|
||||
{{- .Page.Store.Set "hasMermaid" true -}}
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
{{- $attrs := printf `style="width: %v; height: %v;"` $width $height -}}
|
||||
<div class="echarts" {{ $attrs | safeHTMLAttr }}></div>
|
||||
<template>{{ .Inner | transform.Unmarshal | jsonify }}</template>
|
||||
{{- page.Store.Set "hasEcharts" true -}}
|
||||
{{- /* EOF */ -}}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- /* Mermaid support for code fences extended and shortcodes. */ -}}
|
||||
<pre class="mermaid">{{ .Inner | safeHTML }}</pre>
|
||||
<template>{{ .Inner | safeHTML }}</template>
|
||||
{{- /* EOF */ -}}
|
||||
@@ -1,3 +1,4 @@
|
||||
{{- $options := .Get "width" | default (.Get 0) | dict "width" -}}
|
||||
{{- $options = .Get "height" | default (.Get 1) | dict "height" | merge $options -}}
|
||||
{{- dict "Options" $options "Inner" .Inner | partial "plugin/echarts.html" -}}
|
||||
{{- .Page.Store.Set "hasEcharts" true -}}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<pre class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</pre>
|
||||
<template>{{- .Inner | safeHTML }}</template>
|
||||
{{- $options := dict -}}
|
||||
{{- dict "Options" $options "Inner" .Inner | partial "plugin/mermaid.html" -}}
|
||||
{{- .Page.Store.Set "hasMermaid" true -}}
|
||||
|
||||
Reference in New Issue
Block a user