summaryrefslogtreecommitdiff
path: root/src/web/docs/api/mixins.pug
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-05 03:59:29 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-05 03:59:29 +0900
commitdbd3cdb308d2edf600b20a8b632045c6163ae326 (patch)
treede3630065fcddeb1916668ef3b0b43a219340e2e /src/web/docs/api/mixins.pug
parentFix (diff)
parentMerge pull request #1097 from syuilo/refactor (diff)
downloadmisskey-dbd3cdb308d2edf600b20a8b632045c6163ae326.tar.gz
misskey-dbd3cdb308d2edf600b20a8b632045c6163ae326.tar.bz2
misskey-dbd3cdb308d2edf600b20a8b632045c6163ae326.zip
Merge remote-tracking branch 'refs/remotes/origin/master' into vue-#972
Diffstat (limited to 'src/web/docs/api/mixins.pug')
-rw-r--r--src/web/docs/api/mixins.pug37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/web/docs/api/mixins.pug b/src/web/docs/api/mixins.pug
new file mode 100644
index 0000000000..686bf6a2b6
--- /dev/null
+++ b/src/web/docs/api/mixins.pug
@@ -0,0 +1,37 @@
+mixin propTable(props)
+ table.props
+ thead: tr
+ th %i18n:docs.api.props.name%
+ th %i18n:docs.api.props.type%
+ th %i18n:docs.api.props.optional%
+ 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=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
+ | ID)
+ else
+ | (ID)
+ else if prop.kind == 'entity'
+ | (
+ a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
+ | )
+ else if prop.kind == 'object'
+ if prop.def
+ | (
+ a(href=`#${prop.defName}`)= prop.defName
+ | )
+ else if prop.kind == 'date'
+ | (Date)
+ td.optional
+ if prop.optional
+ | %i18n:docs.api.props.yes%
+ else
+ | %i18n:docs.api.props.no%
+ td.desc!= prop.desc[lang] || prop.desc['ja']