diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-17 03:57:34 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-17 03:57:34 +0900 |
| commit | f88ac3c04e5d335860a41e59d3936fa38d1d9989 (patch) | |
| tree | 7a3b63b44381d2e1e509d6b02aa0152f6e652167 /src/docs/api/mixins.pug | |
| parent | :art: (diff) | |
| download | misskey-f88ac3c04e5d335860a41e59d3936fa38d1d9989.tar.gz misskey-f88ac3c04e5d335860a41e59d3936fa38d1d9989.tar.bz2 misskey-f88ac3c04e5d335860a41e59d3936fa38d1d9989.zip | |
Improve doc
Diffstat (limited to 'src/docs/api/mixins.pug')
| -rw-r--r-- | src/docs/api/mixins.pug | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/docs/api/mixins.pug b/src/docs/api/mixins.pug index 9e03abefeb..925aab2934 100644 --- a/src/docs/api/mixins.pug +++ b/src/docs/api/mixins.pug @@ -1,3 +1,24 @@ +mixin type(prop) + 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) + mixin propTable(props) table.props thead: tr @@ -9,23 +30,5 @@ mixin propTable(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) + +type(prop) td.desc!= prop.desc ? prop.desc[lang] || prop.desc['ja'] : null |