summaryrefslogtreecommitdiff
path: root/src/docs/api/mixins.pug
blob: 9e03abefebdfea4b0753b0fc9824ec2da83a0609 (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
mixin propTable(props)
	table.props
		thead: tr
			th= i18n('docs.api.props.name')
			th= i18n('docs.api.props.type')
			th= i18n('docs.api.props.description')
		tbody
			each prop in props
				tr
					td.name= prop.name
					td.type
						i= prop.type
						if prop.kind == 'id'
							if prop.entity
								|  (
								a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
								|  ID)
							else
								|  (ID)
						else if prop.kind == 'entity'
							|   (
							a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
							| )
						else if prop.kind == 'object'
							if prop.hasDef
								|  (
								a(href=`#${prop.name}`)= prop.name
								| )
						else if prop.kind == 'date'
							|  (Date)
					td.desc!= prop.desc ? prop.desc[lang] || prop.desc['ja'] : null