ドキュメントをmisskey-hubに移行
This commit is contained in:
parent
c625a3fa5b
commit
8630542146
1355 changed files with 13 additions and 60421 deletions
|
|
@ -16,10 +16,10 @@
|
|||
</template>
|
||||
</div>
|
||||
<div class="sub">
|
||||
<MkA to="/docs" @click.passive="close()" v-click-anime>
|
||||
<a href="https://misskey-hub.net/help.html" target="_blank" @click.passive="close()" v-click-anime>
|
||||
<i class="fas fa-question-circle icon"></i>
|
||||
<div class="text">{{ $ts.help }}</div>
|
||||
</MkA>
|
||||
</a>
|
||||
<MkA to="/about" @click.passive="close()" v-click-anime>
|
||||
<i class="fas fa-info-circle icon"></i>
|
||||
<div class="text">{{ $t('aboutX', { x: instanceName }) }}</div>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export default defineComponent({
|
|||
methods: {
|
||||
whatIsNew() {
|
||||
this.$refs.modal.close();
|
||||
this.$router.push('/docs/general/changelog');
|
||||
window.open(`https://misskey-hub.net/docs/releases.html#_${version.replace(/\./g, '-')}`, '_blank');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
</section>
|
||||
<section class="_debobigegoItem" style="text-align: center; padding: 0 16px;">
|
||||
{{ $ts._aboutMisskey.about }}<br><MkA class="_link" to="/docs/general/misskey">{{ $ts.learnMore }}</MkA>
|
||||
{{ $ts._aboutMisskey.about }}<br><a href="https://misskey-hub.net/docs/misskey.html" target="_blank" class="_link">{{ $ts.learnMore }}</a>
|
||||
</section>
|
||||
<FormGroup>
|
||||
<FormLink to="https://github.com/misskey-dev/misskey" external>
|
||||
|
|
|
|||
|
|
@ -1,240 +0,0 @@
|
|||
<template>
|
||||
<div class="qyqbqfal" v-size="{ max: [500] }">
|
||||
<div class="main">
|
||||
<div class="title">{{ title }}</div>
|
||||
<div class="body" v-html="body"></div>
|
||||
<div class="footer">
|
||||
<MkLink :url="`https://github.com/misskey-dev/misskey/blob/master/src/docs/${lang}/${doc}.md`" class="at">{{ $ts.docSource }}</MkLink>
|
||||
<p v-if="lang !== 'ja-JP'">{{ $ts.translateWarn }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent } from 'vue';
|
||||
import MarkdownIt from 'markdown-it';
|
||||
import MarkdownItAnchor from 'markdown-it-anchor';
|
||||
import { url, lang } from '@client/config';
|
||||
import MkLink from '@client/components/link.vue';
|
||||
import * as symbols from '@client/symbols';
|
||||
|
||||
const markdown = MarkdownIt({
|
||||
html: true
|
||||
});
|
||||
|
||||
markdown.use(MarkdownItAnchor, {
|
||||
slugify: (s) => encodeURIComponent(String(s).trim().replace(/\s+/g, '-'))
|
||||
});
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
MkLink
|
||||
},
|
||||
|
||||
props: {
|
||||
doc: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
[symbols.PAGE_INFO]: computed(() => this.title ? {
|
||||
title: this.title,
|
||||
icon: 'fas fa-question-circle',
|
||||
} : null),
|
||||
title: null,
|
||||
body: null,
|
||||
markdown: null,
|
||||
lang,
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
doc: {
|
||||
handler() {
|
||||
this.fetchDoc();
|
||||
},
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
fetchDoc() {
|
||||
fetch(`${url}/doc-assets/${lang}/${this.doc}.md`).then(res => res.text()).then(md => {
|
||||
this.parse(md);
|
||||
}).catch(() => {
|
||||
fetch(`${url}/doc-assets/ja-JP/${this.doc}.md`).then(res => res.text()).then(md => {
|
||||
this.parse(md);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
parse(md: string) {
|
||||
// 変数置換
|
||||
md = md.replace(/\{_URL_\}/g, url);
|
||||
|
||||
// markdown の全容をパースする
|
||||
const parsed = markdown.parse(md, {});
|
||||
if (parsed.length === 0) return;
|
||||
|
||||
const buf = [...parsed];
|
||||
const headingTokens = [];
|
||||
let headingStart = 0;
|
||||
|
||||
// もっとも上にある見出しを抽出する
|
||||
while (buf[0].type !== 'heading_open') {
|
||||
buf.shift();
|
||||
headingStart++;
|
||||
}
|
||||
buf.shift();
|
||||
while (buf[0].type as string !== 'heading_close') {
|
||||
const token = buf.shift();
|
||||
if (token) {
|
||||
headingTokens.push(token);
|
||||
}
|
||||
}
|
||||
|
||||
// 抽出した見出しを除く部分をbodyとして抽出する
|
||||
const bodyTokens = [...parsed];
|
||||
bodyTokens.splice(headingStart, headingTokens.length + 2);
|
||||
|
||||
// 各々レンダーする
|
||||
this.title = markdown.renderer.render(headingTokens, {}, {});
|
||||
this.body = markdown.renderer.render(bodyTokens, {}, {});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.qyqbqfal {
|
||||
padding: 32px;
|
||||
background: var(--panel);
|
||||
line-height: 1.5;
|
||||
|
||||
&.max-width_500px {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
> .main {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
|
||||
> .title {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
padding: 0 0 0.75em 0;
|
||||
margin: 0 0 1em 0;
|
||||
border-bottom: solid 2px var(--divider);
|
||||
}
|
||||
|
||||
> .body {
|
||||
> *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
> *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
::v-deep(a) {
|
||||
color: var(--link);
|
||||
}
|
||||
|
||||
::v-deep(blockquote) {
|
||||
display: block;
|
||||
margin: 8px;
|
||||
padding: 6px 0 6px 12px;
|
||||
color: var(--fg);
|
||||
border-left: solid 3px var(--fg);
|
||||
opacity: 0.7;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep(h2) {
|
||||
font-size: 1.25em;
|
||||
padding: 0 0 0.5em 0;
|
||||
margin: 1.5em 0 1em 0;
|
||||
border-bottom: solid 0.5px var(--divider);
|
||||
}
|
||||
|
||||
::v-deep(h3) {
|
||||
margin: 1.25em 0 0.5em 0;
|
||||
}
|
||||
|
||||
::v-deep(table) {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
::v-deep(kbd.group) {
|
||||
display: inline-block;
|
||||
padding: 2px;
|
||||
border: 1px solid var(--divider);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
::v-deep(kbd.key) {
|
||||
display: inline-block;
|
||||
padding: 6px 8px;
|
||||
border: solid 0.5px var(--divider);
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
::v-deep(code) {
|
||||
display: inline-block;
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
tab-size: 2;
|
||||
background: #272822;
|
||||
color: #f8f8f2;
|
||||
border-radius: 6px;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
::v-deep(pre) {
|
||||
background: #272822;
|
||||
color: #f8f8f2;
|
||||
border-radius: 6px;
|
||||
padding: 12px 16px;
|
||||
|
||||
> code {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep(.info) {
|
||||
font-size: 90%;
|
||||
background: var(--infoBg);
|
||||
color: var(--infoFg);
|
||||
padding: 1em;
|
||||
margin: 0.75em 0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
::v-deep(.warn) {
|
||||
font-size: 90%;
|
||||
background: var(--infoWarnBg);
|
||||
color: var(--infoWarnFg);
|
||||
padding: 1em;
|
||||
margin: 0.75em 0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
> .footer {
|
||||
padding: 1.5em 0 0 0;
|
||||
margin: 1.5em 0 0 0;
|
||||
border-top: solid 2px var(--divider);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
<template>
|
||||
<div class="vtaihdtm">
|
||||
<div class="body">
|
||||
<div class="search">
|
||||
<MkInput v-model="query" :debounce="true" type="search" class="" :placeholder="$ts.search">
|
||||
<template #prefix><i class="fas fa-search"></i></template>
|
||||
</MkInput>
|
||||
</div>
|
||||
<div class="list">
|
||||
<MkFolder>
|
||||
<template #header>{{ $ts._docs.generalTopics }}</template>
|
||||
<div class="docs">
|
||||
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('general/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
||||
<div class="title">{{ doc.title }}</div>
|
||||
<div class="summary">{{ doc.summary }}</div>
|
||||
<div class="read">{{ $ts._docs.continueReading }}</div>
|
||||
</MkA>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<template #header>{{ $ts._docs.features }}</template>
|
||||
<div class="docs">
|
||||
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('features/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
||||
<div class="title">{{ doc.title }}</div>
|
||||
<div class="summary">{{ doc.summary }}</div>
|
||||
<div class="read">{{ $ts._docs.continueReading }}</div>
|
||||
</MkA>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<template #header>{{ $ts._docs.advancedTopics }}</template>
|
||||
<div class="docs">
|
||||
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('advanced/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
||||
<div class="title">{{ doc.title }}</div>
|
||||
<div class="summary">{{ doc.summary }}</div>
|
||||
<div class="read">{{ $ts._docs.continueReading }}</div>
|
||||
</MkA>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<template #header>{{ $ts._docs.admin }}</template>
|
||||
<div class="docs">
|
||||
<MkA v-for="doc in docs.filter(doc => doc.path.startsWith('admin/'))" :key="doc.path" :to="`/docs/${doc.path}`" class="doc">
|
||||
<div class="title">{{ doc.title }}</div>
|
||||
<div class="summary">{{ doc.summary }}</div>
|
||||
<div class="read">{{ $ts._docs.continueReading }}</div>
|
||||
</MkA>
|
||||
</div>
|
||||
</MkFolder>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { url, lang } from '@client/config';
|
||||
import * as symbols from '@client/symbols';
|
||||
import MkFolder from '@client/components/ui/folder.vue';
|
||||
import MkInput from '@client/components/form/input.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
MkFolder,
|
||||
MkInput,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
[symbols.PAGE_INFO]: {
|
||||
title: this.$ts.help,
|
||||
icon: 'fas fa-question-circle'
|
||||
},
|
||||
docs: [],
|
||||
query: null,
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
query() {
|
||||
fetch(`${url}/docs.json?lang=${lang}&q=${this.query}`).then(res => res.json()).then(docs => {
|
||||
this.docs = docs;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
fetch(`${url}/docs.json?lang=ja-JP`).then(res => res.json()).then(jaDocs => {
|
||||
fetch(`${url}/docs.json?lang=${lang}`).then(res => res.json()).then(docs => {
|
||||
this.docs = jaDocs.map(doc => {
|
||||
const exist = docs.find(d => d.path === doc.path);
|
||||
return exist || doc;
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.vtaihdtm {
|
||||
background: var(--panel);
|
||||
|
||||
> .body {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
|
||||
> .search {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
> .list {
|
||||
padding: 0 16px;
|
||||
|
||||
.docs {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
||||
grid-gap: 12px;
|
||||
margin: 0 0 16px 0;
|
||||
|
||||
> .doc {
|
||||
display: inline-block;
|
||||
padding: 16px;
|
||||
border: solid 1px var(--divider);
|
||||
border-radius: 6px;
|
||||
|
||||
&:hover {
|
||||
border: solid 1px var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
> .title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> .summary {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
> .read {
|
||||
color: var(--link);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
// SPECIFICATION: /src/docs/ja-JP/advanced/share-page.md
|
||||
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import MkButton from '@client/components/ui/button.vue';
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<div>{{ $ts._tutorial.step7_1 }}</div>
|
||||
<I18n :src="$ts._tutorial.step7_2" tag="div">
|
||||
<template #help>
|
||||
<MkA class="_link" to="/docs">{{ $ts.help }}</MkA>
|
||||
<a href="https://misskey-hub.net/help.html" target="_blank" class="_link">{{ $ts.help }}</a>
|
||||
</template>
|
||||
</I18n>
|
||||
<div>{{ $ts._tutorial.step7_3 }}</div>
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export default defineComponent({
|
|||
text: this.$ts.help,
|
||||
icon: 'fas fa-question-circle',
|
||||
action: () => {
|
||||
os.pageWindow('/docs');
|
||||
window.open(`https://misskey-hub.net/help.md`, '_blank');
|
||||
}
|
||||
}], ev.currentTarget || ev.target);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ export default defineComponent({
|
|||
text: this.$ts.help,
|
||||
icon: 'fas fa-question-circle',
|
||||
action: () => {
|
||||
os.pageWindow('/docs');
|
||||
window.open(`https://misskey-hub.net/help.md`, '_blank');
|
||||
}
|
||||
}], ev.currentTarget || ev.target);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ export default defineComponent({
|
|||
text: this.$ts.help,
|
||||
icon: 'fas fa-question-circle',
|
||||
action: () => {
|
||||
os.pageWindow('/docs');
|
||||
window.open(`https://misskey-hub.net/help.md`, '_blank');
|
||||
}
|
||||
}], ev.currentTarget || ev.target);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -28,10 +28,8 @@ const defaultRoutes = [
|
|||
{ path: '/about', component: page('about') },
|
||||
{ path: '/about-misskey', component: page('about-misskey') },
|
||||
{ path: '/featured', component: page('featured') },
|
||||
{ path: '/docs', component: page('docs') },
|
||||
{ path: '/theme-editor', component: page('theme-editor') },
|
||||
{ path: '/advanced-theme-editor', component: page('advanced-theme-editor') },
|
||||
{ path: '/docs/:doc(.*)', component: page('doc'), props: route => ({ doc: route.params.doc }) },
|
||||
{ path: '/explore', component: page('explore') },
|
||||
{ path: '/explore/tags/:tag', props: true, component: page('explore') },
|
||||
{ path: '/federation', component: page('federation') },
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export default defineComponent({
|
|||
|
||||
methods: {
|
||||
help() {
|
||||
this.$router.push('/docs/keyboard-shortcut');
|
||||
window.open(`https://misskey-hub.net/docs/keyboard-shortcut.md`, '_blank');
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
help() {
|
||||
this.$router.push('/docs/keyboard-shortcut');
|
||||
window.open(`https://misskey-hub.net/docs/keyboard-shortcut.md`, '_blank');
|
||||
},
|
||||
|
||||
onTransition() {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
help() {
|
||||
this.$router.push('/docs/keyboard-shortcut');
|
||||
window.open(`https://misskey-hub.net/docs/keyboard-shortcut.md`, '_blank');
|
||||
},
|
||||
|
||||
onTransition() {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
help() {
|
||||
this.$router.push('/docs/keyboard-shortcut');
|
||||
window.open(`https://misskey-hub.net/docs/keyboard-shortcut.md`, '_blank');
|
||||
},
|
||||
|
||||
onTransition() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue