diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-08-01 08:34:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-01 08:34:22 +0900 |
| commit | 77faf7a84cc28d9a24803940730e59706edd4ec8 (patch) | |
| tree | a3a366deedc99a98bcfe7358eb48aff0ff5fe71c /src/docs/api/endpoints | |
| parent | New translations ja.yml (English) (diff) | |
| parent | Merge pull request #2033 from syuilo/greenkeeper/qrcode-1.2.2 (diff) | |
| download | misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.tar.gz misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.tar.bz2 misskey-77faf7a84cc28d9a24803940730e59706edd4ec8.zip | |
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/docs/api/endpoints')
| -rw-r--r-- | src/docs/api/endpoints/style.styl | 23 | ||||
| -rw-r--r-- | src/docs/api/endpoints/view.pug | 76 |
2 files changed, 99 insertions, 0 deletions
diff --git a/src/docs/api/endpoints/style.styl b/src/docs/api/endpoints/style.styl new file mode 100644 index 0000000000..e7e32b3395 --- /dev/null +++ b/src/docs/api/endpoints/style.styl @@ -0,0 +1,23 @@ +@import "../style" + +#url + padding 8px 12px 8px 8px + font-family Consolas, 'Courier New', Courier, Monaco, monospace + color #fff + background #222e40 + border-radius 4px + overflow auto + white-space nowrap + + > .method + display inline-block + margin 0 8px 0 0 + padding 0 6px + color #fff + background #17afc7 + border-radius 4px + user-select none + pointer-events none + + > .host + opacity 0.7 diff --git a/src/docs/api/endpoints/view.pug b/src/docs/api/endpoints/view.pug new file mode 100644 index 0000000000..76e1183302 --- /dev/null +++ b/src/docs/api/endpoints/view.pug @@ -0,0 +1,76 @@ +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 + = endpointUrl.host + | / + span.path= endpointUrl.path + + if endpoint.desc + p#desc= endpoint.desc[lang] || endpoint.desc['ja'] + + if endpoint.requireCredential + div.ui.info: p + i.fas.fa-id-card-alt(style="margin-right: 4px") + = i18n('docs.api.endpoints.require-credential') + + if endpoint.kind + div.ui.info: p + i.fas.fa-unlock-alt(style="margin-right: 4px") + != i18n('docs.api.endpoints.require-permission').replace('{permission}', `<code>${endpoint.kind}</code>`) + + if endpoint.limit + div.ui.info.warn: p + i.far.fa-clock(style="margin-right: 4px") + b!= i18n('docs.api.endpoints.has-limit') + if endpoint.limit.duration + != i18n('docs.api.endpoints.duration-limit').replace('{duration}', endpoint.limit.duration).replace('{max}', endpoint.limit.max) + if endpoint.limit.minInterval + != i18n('docs.api.endpoints.min-interval-limit').replace('{interval}', endpoint.limit.minInterval) + + 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') + + if resProps + +propTable(resProps) + + if resDefs + each resDef in resDefs + section(id= resDef.name) + h3= resDef.name + +propTable(resDef.props) + else + if res.type.startsWith('entity') + a(href=`/docs/${lang}/api/entities/${kebab(res.entity)}`)= res.entity + +block footer + div.ui.info: p + i.fas.fa-info-circle(style="margin-right: 4px") + = i18n('docs.api.endpoints.generated') + p + = i18n('docs.api.endpoints.show-src') + a(href=src target="_blank")= i18n('docs.api.endpoints.show-src-link') |