diff --git a/src/components/Documentation.vue b/src/components/Documentation.vue index 2292734..a9ecf24 100644 --- a/src/components/Documentation.vue +++ b/src/components/Documentation.vue @@ -233,4 +233,8 @@ ul { @apply leading-8 } } +code.active { + @apply px-1.5 py-0.5 rounded-md bg-gray-200; +} + \ No newline at end of file diff --git a/src/templates/modules/documentation/Routes.ts b/src/templates/modules/documentation/Routes.ts index 155a4cb..6787f68 100644 --- a/src/templates/modules/documentation/Routes.ts +++ b/src/templates/modules/documentation/Routes.ts @@ -1,12 +1,14 @@ import { RouteRecordRaw } from 'vue-router' -import GettingStarted from './Getting-started.vue' -import Starting from './Starting.vue' -import Environment from './Environment.vue' +import GettingStarted from './base/Getting-started.vue' +import Starting from './base/Starting.vue' +import Environment from './base/Environment.vue' +import Structure from './base/Structure.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 }, ] export default routes \ No newline at end of file diff --git a/src/templates/modules/documentation/Environment.vue b/src/templates/modules/documentation/base/Environment.vue similarity index 91% rename from src/templates/modules/documentation/Environment.vue rename to src/templates/modules/documentation/base/Environment.vue index fe59b12..6b1c70c 100644 --- a/src/templates/modules/documentation/Environment.vue +++ b/src/templates/modules/documentation/base/Environment.vue @@ -43,13 +43,13 @@ diff --git a/src/templates/modules/documentation/Starting.vue b/src/templates/modules/documentation/base/Starting.vue similarity index 88% rename from src/templates/modules/documentation/Starting.vue rename to src/templates/modules/documentation/base/Starting.vue index c31692f..e38bb8f 100644 --- a/src/templates/modules/documentation/Starting.vue +++ b/src/templates/modules/documentation/base/Starting.vue @@ -78,11 +78,11 @@ diff --git a/src/templates/modules/documentation/base/Structure.vue b/src/templates/modules/documentation/base/Structure.vue new file mode 100644 index 0000000..e053419 --- /dev/null +++ b/src/templates/modules/documentation/base/Structure.vue @@ -0,0 +1,194 @@ + + + diff --git a/src/utils/Navigation.ts b/src/utils/Navigation.ts index ae09925..ced3f00 100644 --- a/src/utils/Navigation.ts +++ b/src/utils/Navigation.ts @@ -21,6 +21,7 @@ export const documentation = [ { 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 }, ] }, ] diff --git a/src/utils/Types.ts b/src/utils/Types.ts new file mode 100644 index 0000000..4b2b0f1 --- /dev/null +++ b/src/utils/Types.ts @@ -0,0 +1,78 @@ +const globalContextType = ` +export type Context = HookEntity | EventEntity | MiddlewareEntity | CommandEntity | SlashCommandEntity + +type File = { + path: string, + filename: string, + extension: string, + size: number +} +` + +export const eventEntity = ` + type EventEntity = { + type: 'event' + event: K + file: File + run (args: any[]): Promise +} +` + +export const commandEntity = ` +type CommandEntity = { + type: 'command' + label: string + description: string + tag: string + alias?: string[] + usages?: string[] + roles?: snowflake[] + permissions?: PermissionResolvable[] + middlewares?: string[] + file: File + run (message: Message, args: string[]): Promise +} +` + +export const shashCommandEntity = ` +type SlashCommandEntity = { + type: 'slash-command' + file: File + scope: snowflake[] + roles: snowflake[] + context: Context + run (interaction CommandInteraction): Promise +} + +type Context = { + scope: ScopeContext + roles?: string[] + options: SlashOption +} + +export type SlashOption = { + name: string + description: string + options: ApplicationCommandOption[] +} +` + +export const middlewareEntity = ` +type MiddlewareEntity = { + type: 'middleware' + file: File + pattern: string + run (context: MiddlewareContext): Promise +} +` + +export const hookEntity = ` +type HookEntity = { + type: 'hook' + file: File + hook: HookType + run (context: MiddlewareContext): Promise +} + +type HookType = 'app:command:preload' | 'app:command:cancelled' | 'app:command:executed' | 'app:message:received' +` \ No newline at end of file