From 6b567fdc0585cf77c8104df9b0a75c9fa7d41ec7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Jul 2018 16:24:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=ABDisqus=E8=A8=AD=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/docs/api/endpoints/view.pug | 4 ++-- src/docs/base.pug | 22 ++++++++++++++++++++++ src/docs/style.styl | 7 ++++++- src/server/web/docs.ts | 5 ++++- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/docs/api/endpoints/view.pug b/src/docs/api/endpoints/view.pug index 1d7801ab4..76e118330 100644 --- a/src/docs/api/endpoints/view.pug +++ b/src/docs/api/endpoints/view.pug @@ -10,9 +10,9 @@ block main p#url span.method POST span.host - = url.host + = endpointUrl.host | / - span.path= url.path + span.path= endpointUrl.path if endpoint.desc p#desc= endpoint.desc[lang] || endpoint.desc['ja'] diff --git a/src/docs/base.pug b/src/docs/base.pug index b67fd630c..aeafaefff 100644 --- a/src/docs/base.pug +++ b/src/docs/base.pug @@ -34,6 +34,28 @@ html(lang= lang) if content | !{content} + aside. +
+ + + footer block footer small= copyright diff --git a/src/docs/style.styl b/src/docs/style.styl index 5caa65ced..b01fe493a 100644 --- a/src/docs/style.styl +++ b/src/docs/style.styl @@ -40,7 +40,12 @@ main border none border-bottom solid 2px #eee - footer + > aside + margin-top 32px + padding-top 32px + border-top solid 2px #eee + + > footer margin 32px 0 0 0 border-top solid 2px #eee diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index f0181c4b9..81e5ace3e 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -173,9 +173,10 @@ router.get('/*/api/endpoints/*', async ctx => { const ep = endpoints.find(e => e.name === name); const vars = { + id: `api/endpoints/${name}`, title: name, endpoint: ep.meta, - url: { + endpointUrl: { host: config.api_url, path: name }, @@ -198,6 +199,7 @@ router.get('/*/api/entities/*', async ctx => { const x = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname + '/../../../src/docs/api/entities/' + entity + '.yaml'), 'utf-8')) as any; await ctx.render('../../../../src/docs/api/entities/view', Object.assign(await genVars(lang), { + id: `api/entities/${entity}`, name: x.name, desc: x.desc, props: sortParams(Object.entries(x.props).map(([k, v]) => parsePropDefinition(k, v))), @@ -228,6 +230,7 @@ router.get('/*/*', async ctx => { const md = fs.readFileSync(`${__dirname}/../../../src/docs/${doc}.${lang}.md`, 'utf8'); await ctx.render('../../../../src/docs/article', Object.assign({ + id: doc, html: conv.makeHtml(md), title: md.match(/^# (.+?)\r?\n/)[1], src: `https://github.com/syuilo/misskey/tree/master/src/docs/${doc}.${lang}.md`