mizzkey/src/docs/api/endpoints/view.pug

51 lines
1.1 KiB
Text
Raw Normal View History

2018-07-15 19:05:19 +09:00
extends ../../base
2017-12-15 00:23:45 +09:00
include ../mixins
block meta
2018-04-18 18:39:04 +09:00
link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css")
2017-12-15 00:23:45 +09:00
block main
2018-07-16 06:19:19 +09:00
h1= title
2017-12-15 00:23:45 +09:00
2017-12-17 04:02:30 +09:00
p#url
span.method POST
span.host
= url.host
| /
span.path= url.path
2017-12-15 00:23:45 +09:00
2018-07-16 06:19:19 +09:00
if endpoint.desc
p#desc= endpoint.desc[lang] || endpoint.desc['ja']
2017-12-15 00:23:45 +09:00
2018-07-16 06:19:19 +09:00
if endpoint.requireCredential
div.ui.info: p= i18n('docs.api.endpoints.require-credential')
2018-07-16 07:54:08 +09:00
if endpoint.limit
div.ui.warn: p!= i18n('docs.api.endpoints.limit').replace('{duration}', endpoint.limit.duration).replace('{max}', endpoint.limit.max)
2018-07-16 06:19:19 +09:00
if params && Object.keys(params).length > 0
2018-07-16 03:53:03 +09:00
section
h2= i18n('docs.api.endpoints.params')
+propTable(params)
if paramDefs
each paramDef in paramDefs
section(id= paramDef.name)
h3= paramDef.name
+propTable(paramDef.params)
2018-07-16 06:19:19 +09:00
if params && Object.keys(params).length == 0
section
h2= i18n('docs.api.endpoints.params')
p= i18n('docs.api.endpoints.no-params')
2017-12-15 00:23:45 +09:00
2017-12-16 05:04:02 +09:00
if res
section
2018-07-06 12:17:38 +09:00
h2= i18n('docs.api.endpoints.res')
2017-12-16 05:04:02 +09:00
+propTable(res)
2018-07-07 13:34:42 +09:00
if resDefs
each resDef in resDefs
section(id= resDef.name)
h3= resDef.name
+propTable(resDef.props)