summaryrefslogtreecommitdiff
path: root/src/docs/api/endpoints/view.pug
blob: e7bfba086ef73c1bdf89879fac98a2fa4cc1695a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
extends ../../base
include ../mixins

block meta
	link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css")

block main
	h1= title

	p#url
		span.method POST
		span.host
			= url.host
			| /
		span.path= url.path

	if endpoint.desc
		p#desc= endpoint.desc[lang] || endpoint.desc['ja']

	if endpoint.requireCredential
		div.ui.info: p= i18n('docs.api.endpoints.require-credential')

	if params && Object.keys(params).length > 0
		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)
	if params && Object.keys(params).length == 0
		section
			h2= i18n('docs.api.endpoints.params')
			p= i18n('docs.api.endpoints.no-params')

	if res
		section
			h2= i18n('docs.api.endpoints.res')
			+propTable(res)

			if resDefs
				each resDef in resDefs
					section(id= resDef.name)
						h3= resDef.name
						+propTable(resDef.props)