Skip to content

Commit 468da7f

Browse files
committed
Simplify toml
1 parent b3d04ce commit 468da7f

File tree

2 files changed

+34
-55
lines changed

2 files changed

+34
-55
lines changed

layouts/shortcodes/figure.html

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,25 @@
1717
{{< tomlToTable >}}
1818

1919
[[row]]
20-
type = 'header'
21-
22-
[[row.column]]
23-
body = 'Project'
24-
25-
[[row.column]]
26-
body = 'Available Packages'
20+
column = [
21+
"Project",
22+
"Available Packages",
23+
"Download location"
24+
]
2725

2826
[[row]]
29-
30-
[[row.column]]
31-
body = 'NumPy'
32-
33-
[[row.column]]
34-
body = '''Official *source code* (all platforms) and *binaries* for<br />
35-
**Windows**, **Linux**, and **Mac OS X**'''
27+
column = [
28+
"NumPy",
29+
"Official *source code* (all platforms) and *binaries* for<br/>\n**Windows**, **Linux**, and **Mac OS X**\n",
30+
"[PyPi page for NumPy](https://pypi.python.org/pypi/numpy)"
31+
]
3632

3733
[[row]]
38-
39-
[[row.column]]
40-
body = 'SciPy'
41-
42-
[[row.column]]
43-
body = '''Official *source code* (all platforms) and *binaries* for<br />
44-
**Windows**, **Linux**, and **Mac OS X**'''
34+
column = [
35+
"SciPy",
36+
"Official *source code* (all platforms) and *binaries* for<br/>\n**Windows**, **Linux** and **Mac OS X**\n",
37+
"[SciPy release page](https://github.com/scipy/scipy/releases) (sources)<br/>\n[PyPI page for SciPy](https://pypi.python.org/pypi/scipy) (all)\n"
38+
]
4539

4640
{{< /tomlToTable >}}
4741

layouts/shortcodes/tomlToTable.html

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,25 @@
1313
stub-columns = 1
1414

1515
[[row]]
16-
17-
[[row.column]]
18-
body = 'Project'
19-
20-
[[row.column]]
21-
body = 'Available Packages'
22-
23-
[[row.column]]
24-
body = 'Download location'
16+
column = [
17+
"Project",
18+
"Available Packages",
19+
"Download location"
20+
]
2521

2622
[[row]]
27-
28-
[[row.column]]
29-
body = 'NumPy'
30-
31-
[[row.column]]
32-
body = '''Official *source code* (all platforms) and *binaries* for<br />
33-
**Windows**, **Linux**, and **Mac OS X**'''
34-
35-
[[row.column]]
36-
body = '[PyPi page for NumPy](https://pypi.python.org/pypi/numpy)'
23+
column = [
24+
"NumPy",
25+
"Official *source code* (all platforms) and *binaries* for<br/>\n**Windows**, **Linux**, and **Mac OS X**\n",
26+
"[PyPi page for NumPy](https://pypi.python.org/pypi/numpy)"
27+
]
3728

3829
[[row]]
39-
40-
[[row.column]]
41-
body = 'SciPy'
42-
43-
[[row.column]]
44-
body = '''Official *source code* (all platforms) and *binaries* for<br />
45-
**Windows**, **Linux**, and **Mac OS X**'''
46-
47-
[[row.column]]
48-
body = '''[SciPy release page](https://github.com/scipy/scipy/releases) (sources)<br />
49-
[PyPI page for SciPy](https://pypi.python.org/pypi/scipy) (all)'''
30+
column = [
31+
"SciPy",
32+
"Official *source code* (all platforms) and *binaries* for<br/>\n**Windows**, **Linux** and **Mac OS X**\n",
33+
"[SciPy release page](https://github.com/scipy/scipy/releases) (sources)<br/>\n[PyPI page for SciPy](https://pypi.python.org/pypi/scipy) (all)\n"
34+
]
5035

5136
{{< /tomlToTable >}}
5237

@@ -74,10 +59,10 @@
7459
{{- if $header }}<thead>
7560
{{- range $row_idx, $row := $header }}
7661
{{ if (modBool $row_idx 2) }}<tr class="row-odd">{{- else }}<tr class="row-even">{{- end }}
77-
{{- range $col_idx, $col := .column }}
62+
{{- range $col_idx, $col := $row.column }}
7863
{{- $alignment := or (index $align $col_idx) "left" }}
7964
<th class="head" style="text-align:{{ $alignment }}">
80-
{{ $col.body | markdownify }}
65+
{{ $col | markdownify }}
8166
</th>
8267
{{- end }}
8368
</tr>
@@ -87,10 +72,10 @@
8772
<tbody>
8873
{{- range $row_idx, $row := $body }}
8974
{{ if (modBool (add $row_idx $headerrows) 2) }}<tr class="row-odd">{{- else }}<tr class="row-even">{{- end }}
90-
{{- range $col_idx, $col := .column }}
75+
{{- range $col_idx, $col := $row.column }}
9176
{{- $alignment := or (index $align $col_idx) "left" }}
9277
<td class="head" style="text-align:{{ $alignment }}">
93-
{{ $col.body | markdownify }}
78+
{{ $col | markdownify }}
9479
</td>
9580
{{- end }}
9681
</tr>

0 commit comments

Comments
 (0)