2018-03-27 23:32:49 +00:00
|
|
|
component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField)
|
|
|
|
.api-docs-page
|
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
|
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
|