File tree Expand file tree Collapse file tree 1 file changed +68
-0
lines changed
Expand file tree Collapse file tree 1 file changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ {{/*
2+
3+ doc: Render TOML to an HTML table.
4+
5+ {{< tomlToTable > }}
6+
7+ [[row]]
8+ type = 'header'
9+
10+ [[row.column]]
11+ body = 'Project'
12+
13+ [[row.column]]
14+ body = 'Available Packages'
15+
16+ [[row.column]]
17+ body = 'Download location'
18+
19+ [[row]]
20+
21+ [[row.column]]
22+ body = 'NumPy'
23+
24+ [[row.column]]
25+ body = '''Official *source code* (all platforms) and *binaries* for< br />
26+ **Windows**, **Linux**, and **Mac OS X**'''
27+
28+ [[row.column]]
29+ body = '[PyPi page for NumPy](https://pypi.python.org/pypi/numpy)'
30+
31+ [[row]]
32+
33+ [[row.column]]
34+ body = 'SciPy'
35+
36+ [[row.column]]
37+ body = '''Official *source code* (all platforms) and *binaries* for< br />
38+ **Windows**, **Linux**, and **Mac OS X**'''
39+
40+ [[row.column]]
41+ align = 'right'
42+ body = '''[SciPy release page](https://github.com/scipy/scipy/releases) (sources)< br />
43+ [PyPI page for SciPy](https://pypi.python.org/pypi/scipy) (all)'''
44+
45+ {{< /tomlToTable > }}
46+
47+ */}}
48+
49+ {{ $arg := .Get 0 }}
50+ {{ $data := .Inner | transform.Unmarshal }}
51+
52+ {{ with $data }}
53+ < table >
54+ {{ range $row := .row }}
55+ < tr >
56+ {{ $el := "td" }}
57+ {{ if (eq $row.type "header") }}
58+ {{ $el = "th" }}
59+ {{ end }}
60+ {{ range $col := .column }}
61+ {{ printf "< %s" $el | safeHTML }} colspan="{{ $col.colspan }}" rowspan="{{ $col.rowspan }}" {{ printf "> " | safeHTML }}
62+ {{ $col.body | markdownify }}
63+ {{ printf "</ %s> " $el | safeHTML }}
64+ {{ end }}
65+ </ tr >
66+ {{ end }}
67+ </ table >
68+ {{ end }}
You can’t perform that action at this time.
0 commit comments