32 lines
724 B
Plaintext
Raw Normal View History

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