39 lines
846 B
Plaintext
Raw Normal View History

2019-11-18 05:55:12 +00:00
component APIType(t reflect.Type, examples []string, fields []*utils.APIField, embedded []string)
.api-docs
2018-04-12 21:30:49 +00:00
h1.mountable= t.Name()
2018-03-27 22:26:06 +00:00
2018-04-12 21:30:49 +00:00
h2.mountable Examples
2018-03-27 23:32:49 +00:00
if len(examples) == 0
2018-04-12 21:30:49 +00:00
p.no-data.mountable No examples available yet.
2018-03-27 23:32:49 +00:00
else
2018-04-12 21:30:49 +00:00
.buttons.mountable
2018-03-27 23:32:49 +00:00
each example in examples
2018-03-27 23:59:14 +00:00
a.button(href=example, target="_blank")
2018-03-27 23:32:49 +00:00
Icon("external-link")
2018-03-27 23:59:14 +00:00
span= strings.TrimPrefix(example, "/api")
2018-03-27 23:32:49 +00:00
2018-04-12 21:30:49 +00:00
h2.mountable Fields
2018-03-27 23:32:49 +00:00
table
thead
2018-04-12 21:30:49 +00:00
tr.mountable
2018-03-27 23:32:49 +00:00
th Field
th Type
tbody
each field in fields
2018-04-12 21:30:49 +00:00
tr.api-field.mountable
2018-03-27 23:32:49 +00:00
td.api-field-json(title=field.Name + " (Go)")= field.JSON
td.api-field-type= field.Type
2019-11-18 05:55:12 +00:00
if len(embedded) > 0
h2.mountable Embeds
ul
each embed in embedded
li.mountable= embed
2018-03-27 22:26:06 +00:00
2018-03-27 23:32:49 +00:00
.corner-buttons
a.button(href="/api")
Icon("code")
span Overview