Added GitHub links to API

This commit is contained in:
Eduard Urbach 2018-04-12 23:30:49 +02:00
parent ea2e08d88d
commit 16d0e17aa5
3 changed files with 18 additions and 15 deletions

View File

@ -1,21 +1,24 @@
component API(types []*autodocs.Type) component API(types []*autodocs.Type)
.api-docs-page .api-docs-page
h1 API h1.mountable API
h2 Endpoints h2.mountable Endpoints
ul ul
li li.mountable
strong REST: strong REST:
span https://notify.moe/api span https://notify.moe/api
li li.mountable
strong GraphQL: strong GraphQL:
span https://notify.moe/graphql span https://notify.moe/graphql
h2 Types h2.mountable Types
table.api-types table.api-types
tbody tbody
each typ in types each typ in types
tr tr.mountable
td td
a(href=typ.Endpoint())= typ.Name a(href=typ.Endpoint())= typ.Name
td= typ.Comment td= typ.Comment
td
a(href=typ.GitHubLink())
RawIcon("github")

View File

@ -1,2 +1,2 @@
.api-types .api-types
max-width 100% // ...

View File

@ -1,28 +1,28 @@
component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField) component APIDocs(t reflect.Type, examples []string, fields []*utils.APIField)
.api-docs-page .api-docs-page
h1= t.Name() h1.mountable= t.Name()
h2 Examples h2.mountable Examples
if len(examples) == 0 if len(examples) == 0
p.no-data No examples available yet. p.no-data.mountable No examples available yet.
else else
.buttons .buttons.mountable
each example in examples each example in examples
a.button(href=example, target="_blank") a.button(href=example, target="_blank")
Icon("external-link") Icon("external-link")
span= strings.TrimPrefix(example, "/api") span= strings.TrimPrefix(example, "/api")
h2 Fields h2.mountable Fields
table table
thead thead
tr tr.mountable
th Field th Field
th Type th Type
tbody tbody
each field in fields each field in fields
tr.api-field tr.api-field.mountable
td.api-field-json(title=field.Name + " (Go)")= field.JSON td.api-field-json(title=field.Name + " (Go)")= field.JSON
td.api-field-type= field.Type td.api-field-type= field.Type