Work in progress

This commit is contained in:
Freeze455
2021-09-04 09:03:29 +02:00
parent 48392b2e9f
commit 0f09a95d17
4 changed files with 103 additions and 2 deletions

View File

@@ -119,7 +119,7 @@
v-else
:key="item.name"
:to="item.href"
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'w-full group flex items-center px-2 py-2 text-base font-medium rounded-md']">
:class="[item.current ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'w-1/2 ml-auto group flex items-center py-2 text-base font-medium rounded-md']">
{{ item.label }}
</router-link>
</template>

View File

@@ -9,12 +9,14 @@ import Event from './base/Event.vue'
import Middleware from './base/Middleware.vue'
import Hook from './base/Hook.vue'
import Deployment from './advanced/Deployment.vue'
import PartialHooks from './base/PartialHooks.vue'
const routes: RouteRecordRaw[] = [
{ path: '/documentation/getting-started', component: GettingStarted },
{ path: '/documentation/starting', component: Starting },
{ path: '/documentation/environment', component: Environment },
{ path: '/documentation/structure', component: Structure },
{ path: '/documentation/partial-hooks', component: PartialHooks },
{ path: '/documentation/commands', component: Command },
{ path: '/documentation/slash-commands', component: SlashCommand },
{ path: '/documentation/events', component: Event },

View File

@@ -0,0 +1,98 @@
<template>
<Documentation title="Hooks">
<p>
The @discord-factory/core module is intended to simplify access to certain resources such as commands,events registered within the instance of your application.
</p>
<div class="space-y-5">
<h2>useClient</h2>
<p>
Returns the instance of the Discord Client linked to the bot.
</p>
<CodeHighlight class="w-min" :code="useClient" />
</div>
<div class="space-y-5">
<h2>useCommands</h2>
<p>
Returns the set of commands registered within the application instance.
</p>
<CodeHighlight class="w-min" :code="useCommands" />
</div>
<div class="space-y-5">
<h2>useEvents</h2>
<p>
Returns the set of events registered within the application instance.
</p>
<CodeHighlight class="w-min" :code="useEvents" />
</div>
<div class="space-y-5">
<h2>useMiddlewares</h2>
<p>
Returns the set of middlewares registered within the application instance.
</p>
<CodeHighlight class="w-min" :code="useMiddlewares" />
</div>
<div class="space-y-5">
<h2>useHooks</h2>
<p>
Returns the set of hooks registered within the application instance.
</p>
<CodeHighlight class="w-min" :code="useHooks" />
</div>
<div class="space-y-5">
<h2>useProviders</h2>
<p>
Returns the set of providers registered within the application instance.
</p>
<CodeHighlight class="w-min" :code="useProviders" />
</div>
</Documentation>
</template>
<script setup lang="ts">
import Documentation from '../../../../components/Documentation.vue'
import CodeHighlight from '../../../../components/CodeHighlight.vue'
import Divider from '../../../../components/Divider.vue'
import LinkExternal from '../../../../components/LinkExternal.vue'
import AlertInfo from '../../../../components/AlertInfo.vue'
const useClient = `
import { Application } from '@discord-factory/core'
const client = Application.getClient()
console.log(client)`
const useCommands = `
import { Application } from '@discord-factory/core'
const commands = Application.getCommands()
console.log(commands)`
const useEvents = `
import { Application } from '@discord-factory/core'
const events = Application.getEvents()
console.log(events)`
const useMiddlewares = `
import { Application } from '@discord-factory/core'
const middlewares = Application.getMiddlewares()
console.log(middlewares)`
const useHooks = `
import { Application } from '@discord-factory/core'
const hooks = Application.getHooks()
console.log(hooks)`
const useProviders = `
import { Application } from '@discord-factory/core'
const providers = Application.getProviders()
console.log(providers)`
</script>

View File

@@ -14,14 +14,15 @@ export const socials = [
]
export const documentation = [
{ label: 'Getting starting', href: '/documentation/getting-started', isMenu: false },
{
label: 'Basic',
isMenu: true,
child: [
{ label: 'Getting starting', href: '/documentation/getting-started', isMenu: false },
{ label: 'Starting', href: '/documentation/starting', isMenu: false },
{ label: 'Environment', href: '/documentation/environment', isMenu: false },
{ label: 'Structure', href: '/documentation/structure', isMenu: false },
{ label: 'Partial Hoohs', href: '/documentation/partial-hooks', isMenu: false },
{ label: 'Commands', href: '/documentation/commands', isMenu: false },
{ label: 'Slash Commands', href: '/documentation/slash-commands', isMenu: false },
{ label: 'Events', href: '/documentation/events', isMenu: false },