Docs updates
This commit is contained in:
parent
f820a06bac
commit
028786d348
13 changed files with 208 additions and 60 deletions
|
@ -4,7 +4,71 @@
|
|||
<p class="mb-1">
|
||||
This page details the different argument types available for commands.
|
||||
</p>
|
||||
<h2 id="delay" class="z-title is-2 mt-2 mb-1">Delay</h2>
|
||||
|
||||
<h2 id="string" class="z-title is-2 mt-2 mb-1">string</h2>
|
||||
<p class="mb-1">
|
||||
Any text
|
||||
</p>
|
||||
|
||||
<h2 id="number" class="z-title is-2 mt-2 mb-1">number</h2>
|
||||
<p class="mb-1">
|
||||
Any number
|
||||
</p>
|
||||
|
||||
<h2 id="user" class="z-title is-2 mt-2 mb-1">user</h2>
|
||||
<p class="mb-1">
|
||||
Anything that uniquely identifies a user. This includes:
|
||||
</p>
|
||||
<ul class="z-list z-ul mb-1">
|
||||
<li>User ID <code>108552944961454080</code></li>
|
||||
<li>User mention <code>@Dark#1010</code></li>
|
||||
<li>Loose user mention <code>Dark#1010</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="userId" class="z-title is-2 mt-2 mb-1">userId</h2>
|
||||
<p class="mb-1">
|
||||
A valid user ID, e.g. <code>108552944961454080</code>
|
||||
</p>
|
||||
|
||||
<h2 id="channel" class="z-title is-2 mt-2 mb-1">channel</h2>
|
||||
<p class="mb-1">
|
||||
Anything that uniquely identifies a channel. This includes:
|
||||
</p>
|
||||
<ul class="z-list z-ul mb-1">
|
||||
<li>Channel ID <code>473087035574321152</code></li>
|
||||
<li>Channel mention <code>#my-channel</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="channelId" class="z-title is-2 mt-2 mb-1">channelId</h2>
|
||||
<p class="mb-1">
|
||||
A valid channel ID, e.g. <code>473087035574321152</code>
|
||||
</p>
|
||||
|
||||
<h2 id="role" class="z-title is-2 mt-2 mb-1">role</h2>
|
||||
<p class="mb-1">
|
||||
Anything that uniquely identifies a role. This includes:
|
||||
</p>
|
||||
<ul class="z-list z-ul mb-1">
|
||||
<li>Role ID <code>473085927053590538</code></li>
|
||||
<li>Role mention <code>@MyRole</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="member" class="z-title is-2 mt-2 mb-1">member</h2>
|
||||
<p class="mb-1">
|
||||
Anything that uniquely identifies a member currently on the server. This includes:
|
||||
</p>
|
||||
<ul class="z-list z-ul mb-1">
|
||||
<li>User ID <code>108552944961454080</code></li>
|
||||
<li>User Mention <code>@Dark#1010</code></li>
|
||||
<li>Loose user mention <code>Dark#1010</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="resolvedMember" class="z-title is-2 mt-2 mb-1">resolvedMember</h2>
|
||||
<p class="mb-1">
|
||||
See <code>member</code> above
|
||||
</p>
|
||||
|
||||
<h2 id="delay" class="z-title is-2 mt-2 mb-1">delay</h2>
|
||||
<p class="mb-1">
|
||||
A delay is used to specify an amount of time. It uses simple letters to specify time durations.<br>
|
||||
For example, <code>2d15h27m3s</code> would be 2 days, 15 hours, 27 minutes and 3 seconds.
|
||||
|
@ -40,18 +104,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</b-collapse>
|
||||
|
||||
<h2 id="string" class="z-title is-2 mb-1">String</h2>
|
||||
|
||||
<h2 id="user" class="z-title is-2 mt-2 mb-1">User</h2>
|
||||
<p class="mb-1">
|
||||
Anything that uniquely identifies a user. This includes:
|
||||
</p>
|
||||
<ul class="z-list z-ul mb-1">
|
||||
<li>User ID <code>108552944961454080</code></li>
|
||||
<li>User Mention <code>@Dark#1010</code></li>
|
||||
<li>Loose user mention <code>Dark#1010</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -28,15 +28,21 @@
|
|||
<aside class="menu">
|
||||
<p class="menu-label">General</p>
|
||||
<ul class="menu-list">
|
||||
<li><router-link to="/docs">Introduction</router-link></li>
|
||||
<li><router-link to="/docs/introduction">Introduction</router-link></li>
|
||||
<li><router-link to="/docs/configuration-format">Configuration format</router-link></li>
|
||||
<li><router-link to="/docs/plugin-configuration">Plugin configuration</router-link></li>
|
||||
<li><router-link to="/docs/permissions">Permissions</router-link></li>
|
||||
</ul>
|
||||
|
||||
<p class="menu-label">Descriptions</p>
|
||||
<p class="menu-label">Reference</p>
|
||||
<ul class="menu-list">
|
||||
<li><router-link to="/docs/descriptions/argument-types">Argument types</router-link></li>
|
||||
<li><router-link to="/docs/reference/argument-types">Argument types</router-link></li>
|
||||
</ul>
|
||||
|
||||
<p class="menu-label">Setup guides</p>
|
||||
<ul class="menu-list">
|
||||
<li><router-link to="/docs/setup-guides/logs">Logs</router-link></li>
|
||||
<li><router-link to="/docs/setup-guides/moderation">Moderation</router-link></li>
|
||||
</ul>
|
||||
|
||||
<p class="menu-label">Plugins</p>
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
<div v-else>
|
||||
<h1 class="z-title is-1 mb-1">{{ data.info.prettyName || data.name }}</h1>
|
||||
|
||||
<!-- Description -->
|
||||
<MarkdownBlock :content="data.info.description" class="content"></MarkdownBlock>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li v-bind:class="{'is-active': tab === 'usage'}">
|
||||
|
@ -18,8 +21,10 @@
|
|||
|
||||
<!-- Usage tab -->
|
||||
<div class="usage" v-if="tab === 'usage'">
|
||||
<!-- Description -->
|
||||
<MarkdownBlock :content="data.info.description" class="content"></MarkdownBlock>
|
||||
<div v-if="!hasUsageInfo">
|
||||
This plugin has no usage information.
|
||||
See <router-link v-bind:to="'/docs/plugins/' + pluginName + '/configuration'">Configuration</router-link>.
|
||||
</div>
|
||||
|
||||
<!-- Usage guide -->
|
||||
<div v-if="data.info.usageGuide">
|
||||
|
@ -32,11 +37,11 @@
|
|||
<h2 id="commands" class="z-title is-2 mt-2 mb-1">Commands</h2>
|
||||
<div v-for="command in data.commands">
|
||||
<h3 class="z-title is-3 mt-2 mb-1">!{{ command.trigger }}</h3>
|
||||
<div v-if="command.config.requiredPermission">
|
||||
Permission: <code>{{ command.config.requiredPermission }}</code>
|
||||
<div v-if="command.config.extra.requiredPermission">
|
||||
Permission: <code>{{ command.config.extra.requiredPermission }}</code>
|
||||
</div>
|
||||
<div v-if="command.config.info && command.config.info.basicUsage">
|
||||
Basic usage: <code>{{ command.config.info.basicUsage }}</code>
|
||||
<div v-if="command.config.extra.info && command.config.extra.info.basicUsage">
|
||||
Basic usage: <code>{{ command.config.extra.info.basicUsage }}</code>
|
||||
</div>
|
||||
<div v-if="command.config.aliases && command.config.aliases.length">
|
||||
Shortcut:
|
||||
|
@ -68,7 +73,7 @@
|
|||
<ul class="z-list z-ul">
|
||||
<li v-for="param in command.parameters">
|
||||
<code>{{ renderParameter(param) }}</code>
|
||||
<router-link :to="'/docs/descriptions/argument-types#' + (param.type || 'string')">{{ param.type || 'string' }}</router-link>
|
||||
<router-link :to="'/docs/reference/argument-types#' + (param.type || 'string')">{{ param.type || 'string' }}</router-link>
|
||||
<MarkdownBlock v-if="command.config.info && command.config.info.parameterDescriptions && command.config.info.parameterDescriptions[param.name]"
|
||||
:content="command.config.info.parameterDescriptions[param.name]"
|
||||
class="content">
|
||||
|
@ -76,6 +81,20 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mt-2" v-if="command.config.options && command.config.options.length">
|
||||
Options:
|
||||
<ul class="z-list z-ul">
|
||||
<li v-for="opt in command.config.options">
|
||||
<code>{{ renderOption(opt) }}</code>
|
||||
<router-link :to="'/docs/reference/argument-types#' + (opt.type || 'string')">{{ opt.type || 'string' }}</router-link>
|
||||
<MarkdownBlock v-if="command.config.info && command.config.info.optionDescriptions && command.config.info.optionDescriptions[opt.name]"
|
||||
:content="command.config.info.optionDescriptions[opt.name]"
|
||||
class="content">
|
||||
</MarkdownBlock>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</b-collapse>
|
||||
</div>
|
||||
|
@ -134,7 +153,14 @@
|
|||
|
||||
async mounted() {
|
||||
this.loading = true;
|
||||
|
||||
await this.$store.dispatch("docs/loadPluginData", this.pluginName);
|
||||
|
||||
// If there's no usage info, use Configuration as the default tab
|
||||
if (!this.hasUsageInfo && ! this.$route.params.tab) {
|
||||
this.tab = 'configuration';
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
|
@ -152,6 +178,17 @@
|
|||
return `[${str}]`;
|
||||
}
|
||||
},
|
||||
renderOption(opt) {
|
||||
let str = `--${opt.name}`;
|
||||
if (opt.shortcut) {
|
||||
str += `|-${opt.shortcut}`;
|
||||
}
|
||||
if (opt.required) {
|
||||
return `<${str}>`;
|
||||
} else {
|
||||
return `[${str}]`;
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -167,6 +204,12 @@
|
|||
data(state) {
|
||||
return state.plugins[this.pluginName];
|
||||
},
|
||||
hasUsageInfo() {
|
||||
if (!this.data) return true;
|
||||
if (this.data.commands.length) return true;
|
||||
if (this.data.info.usageGuide) return true;
|
||||
return false;
|
||||
},
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
|
8
dashboard/src/components/docs/WorkInProgress.vue
Normal file
8
dashboard/src/components/docs/WorkInProgress.vue
Normal file
|
@ -0,0 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<h1 class="z-title is-1 mb-1">Work in progress</h1>
|
||||
<p class="mb-1">
|
||||
This page is a work in progress.
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
|
@ -19,6 +19,10 @@ export const router = new VueRouter({
|
|||
children: [
|
||||
{
|
||||
path: "",
|
||||
redirect: "/docs/introduction",
|
||||
},
|
||||
{
|
||||
path: "introduction",
|
||||
component: () => import("./components/docs/Introduction.vue"),
|
||||
},
|
||||
{
|
||||
|
@ -34,9 +38,17 @@ export const router = new VueRouter({
|
|||
component: () => import("./components/docs/PluginConfiguration.vue"),
|
||||
},
|
||||
{
|
||||
path: "descriptions/argument-types",
|
||||
path: "reference/argument-types",
|
||||
component: () => import("./components/docs/ArgumentTypes.vue"),
|
||||
},
|
||||
{
|
||||
path: "setup-guides/logs",
|
||||
component: () => import("./components/docs/WorkInProgress.vue"),
|
||||
},
|
||||
{
|
||||
path: "setup-guides/moderation",
|
||||
component: () => import("./components/docs/WorkInProgress.vue"),
|
||||
},
|
||||
{
|
||||
path: "plugins/:pluginName/:tab?",
|
||||
component: () => import("./components/docs/Plugin.vue"),
|
||||
|
|
|
@ -61,3 +61,17 @@ $tabs-link-active-border-bottom-color: $grey-lighter;
|
|||
background: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu-label {
|
||||
&:not(:first-child) {
|
||||
margin-top: 1.4em;
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-list .router-link-active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue