Skip to content

Commit 28ae9c7

Browse files
committed
Add legend to figure using tomlToTable
1 parent 80008b3 commit 28ae9c7

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

layouts/shortcodes/figure.html

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,36 @@
99
width = 200
1010
caption = 'A figure is an image with a caption and/or a legend:'
1111
legend = '''
12-
**TODO: need to convert yamltotable to tomltotable**
12+
{{< tomlToTable >}}
13+
14+
[[row]]
15+
type = 'header'
16+
17+
[[row.column]]
18+
body = 'Project'
19+
20+
[[row.column]]
21+
body = 'Available Packages'
22+
23+
[[row]]
24+
25+
[[row.column]]
26+
body = 'NumPy'
27+
28+
[[row.column]]
29+
body = '''Official *source code* (all platforms) and *binaries* for<br />
30+
**Windows**, **Linux**, and **Mac OS X**'''
31+
32+
[[row]]
33+
34+
[[row.column]]
35+
body = 'SciPy'
36+
37+
[[row.column]]
38+
body = '''Official *source code* (all platforms) and *binaries* for<br />
39+
**Windows**, **Linux**, and **Mac OS X**'''
40+
41+
{{< /tomlToTable >}}
1342

1443
This paragraph is also part of the legend.
1544
'''
@@ -46,7 +75,9 @@
4675
</span><a class="headerlink" href="#{{ $id }}" title="Link to this image">#</a></p>
4776
{{- with $figure.legend }}
4877
<div class="legend">
49-
{{ . | markdownify -}}
78+
{{- with (trim . "\n") }}
79+
{{ . | safeHTML }}
80+
{{- end }}
5081
</div>
5182
{{- end }}
5283
</figcaption>

0 commit comments

Comments
 (0)