Added more API examples

This commit is contained in:
2018-03-28 01:59:14 +02:00
parent c5de0c6d6f
commit bf6a28faca
9 changed files with 69 additions and 43 deletions

View File

@ -1,13 +1,14 @@
component API(types []string)
h1 API
table
//- thead
//- tr
//- th Table
tbody
each typeName in types
tr
td= typeName
td
a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/"
.api-docs-page
h1 API
table
//- thead
//- tr
//- th Table
tbody
each typeName in types
tr
td= typeName
td
a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/"

View File

@ -1,17 +1,17 @@
component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField)
.api-docs-page
h1= "API: " + t.Name()
h1= t.Name()
h2 Examples
if len(examples) == 0
p.no-data No examples have been added to this type yet.
p.no-data No examples available yet.
else
.buttons
each example in examples
a.button(href="https://notify.moe" + example, target="_blank")
a.button(href=example, target="_blank")
Icon("external-link")
span= example
span= strings.TrimPrefix(example, "/api")
h2 Fields

View File

@ -1,6 +1,7 @@
.api-docs-page
h1,
h2
h2,
p
text-align left
table