32 lines
654 B
Plaintext
Raw Normal View History

2018-03-27 23:32:49 +00:00
component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField)
.api-docs-page
2018-03-27 23:59:14 +00:00
h1= t.Name()
2018-03-27 22:26:06 +00:00
2018-03-27 23:32:49 +00:00
h2 Examples
if len(examples) == 0
2018-03-27 23:59:14 +00:00
p.no-data No examples available yet.
2018-03-27 23:32:49 +00:00
else
.buttons
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
h2 Fields
table
thead
2018-03-27 22:26:06 +00:00
tr
2018-03-27 23:32:49 +00:00
th Field
th Type
tbody
each field in fields
tr.api-field
td.api-field-json(title=field.Name + " (Go)")= field.JSON
td.api-field-type= field.Type
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