misskey/src/docs/api/mixins.pug

32 lines
823 B
Plaintext
Raw Normal View History

2017-12-15 00:23:45 +09:00
mixin propTable(props)
table.props
thead: tr
2018-07-06 12:17:38 +09:00
th= i18n('docs.api.props.name')
th= i18n('docs.api.props.type')
th= i18n('docs.api.props.description')
2017-12-15 00:23:45 +09:00
tbody
each prop in props
tr
td.name= prop.name
td.type
i= prop.type
if prop.kind == 'id'
if prop.entity
| (
2018-05-07 03:05:00 +09:00
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
2017-12-15 00:23:45 +09:00
| ID)
else
| (ID)
else if prop.kind == 'entity'
| (
2018-05-07 03:05:00 +09:00
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
2017-12-15 00:23:45 +09:00
| )
else if prop.kind == 'object'
2018-07-07 13:34:42 +09:00
if prop.hasDef
2017-12-15 00:23:45 +09:00
| (
2018-07-07 13:34:42 +09:00
a(href=`#${prop.name}`)= prop.name
2017-12-15 00:23:45 +09:00
| )
else if prop.kind == 'date'
| (Date)
2018-07-06 12:17:38 +09:00
td.desc!= prop.desc ? prop.desc[lang] || prop.desc['ja'] : null