Skip to content

Commit

Permalink
docs: add more structure to vuetify components in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 22, 2023
1 parent a1246a8 commit d93e8b7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 12 deletions.
55 changes: 44 additions & 11 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ function autoTitle(link: string) {
throw Error("Cannot find a title for " + link);
}

const vuetifyComponents = fs
.readdirSync(
path.resolve(__dirname, "../stacks/vue/coalesce-vue-vuetify/components")
)
.map((f) => autoTitle("/stacks/vue/coalesce-vue-vuetify/components/" + f));

function getComponentCategory(item: (typeof vuetifyComponents)[0]) {
return item.text.startsWith("c-admin")
? "admin"
: [
"c-display",
"c-loader-status",
"c-list-range-display",
"c-table",
].includes(item.text)
? "display"
: "input";
}

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Coalesce",
Expand All @@ -45,7 +64,7 @@ export default defineConfig({
themeConfig: {
logo: "/coalesce-icon-color.svg",
outline: {
level: [2,3]
level: [2, 3],
},
// https://vitepress.dev/reference/default-theme-config
nav: [
Expand Down Expand Up @@ -113,16 +132,30 @@ export default defineConfig({
collapsed: true,
link: "/stacks/vue/coalesce-vue-vuetify/overview",
items: [
...fs
.readdirSync(
path.resolve(
__dirname,
"../stacks/vue/coalesce-vue-vuetify/components"
)
)
.map((f) =>
autoTitle("/stacks/vue/coalesce-vue-vuetify/components/" + f)
),
{
text: "Display",
collapsed: false,
items: [
...vuetifyComponents.filter((i) => getComponentCategory(i) == "display"),
],
},
{
text: "Input",
collapsed: false,
items: [
...vuetifyComponents.filter((i) => getComponentCategory(i) == "input").sort((a,b) => {
if (a.text == 'c-input') return -1;
return a.text.localeCompare(b.text);
}),
],
},
{
text: "Admin",
collapsed: true,
items: [
...vuetifyComponents.filter((i) => getComponentCategory(i) == "admin"),
],
},
],
},
{
Expand Down
1 change: 0 additions & 1 deletion docs/modeling/model-components/attributes/inject.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

# [Inject]
========

Used to mark a [Method](/modeling/model-components/methods.md) parameter for dependency injection from the application's `IServiceProvider`.

Expand Down

0 comments on commit d93e8b7

Please sign in to comment.