diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index b912d4c9..a05af72f 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,3 +1,6 @@ +import type MarkdownIt from 'markdown-it' +import type StateBlock from 'markdown-it/lib/rules_block/state_block' + import { URL, fileURLToPath } from 'node:url' import { resolve } from 'path' @@ -172,5 +175,42 @@ export default defineConfig({ } }, - ignoreDeadLinks: true + ignoreDeadLinks: true, + + markdown: { + config: (md) => { + md.use(discordBannerPlugin); + }, + } }) + +// Custom Markdown-it plugin +function discordBannerPlugin(md: MarkdownIt) { + const marker = '[ discord banner ]' + + md.block.ruler.before( + 'fence', + 'discord-banner', + (state: StateBlock, startLine: number, endLine: number, silent: boolean): boolean => { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + + // Match the custom marker + if (state.src.slice(start, max).trim() !== marker) { + return false; + } + + if (silent) return true; + + // Create a token for the banner component + const token = state.push('discord-banner', 'div', 0); + token.map = [startLine, startLine + 1]; + state.line = startLine + 1; + + return true; + }); + + // Render the component + md.renderer.rules['discord-banner'] = () => '' +} + diff --git a/docs/.vitepress/theme/assets/css/tailwind.css b/docs/.vitepress/theme/assets/css/tailwind.css index 0f952902..4ca3191f 100644 --- a/docs/.vitepress/theme/assets/css/tailwind.css +++ b/docs/.vitepress/theme/assets/css/tailwind.css @@ -204,6 +204,10 @@ } } + .kit-button.kit-button-small { + font-size: 12px; + } + .kit-button.kit-button-cornflower { @apply text-cornflower; @apply hocus:text-white hocus:bg-cornflower; diff --git a/docs/.vitepress/theme/components/DiscordBanner.vue b/docs/.vitepress/theme/components/DiscordBanner.vue new file mode 100644 index 00000000..8afaec29 --- /dev/null +++ b/docs/.vitepress/theme/components/DiscordBanner.vue @@ -0,0 +1,25 @@ + + + diff --git a/docs/.vitepress/theme/components/DiscordModal.vue b/docs/.vitepress/theme/components/DiscordModal.vue deleted file mode 100644 index 9a7f2357..00000000 --- a/docs/.vitepress/theme/components/DiscordModal.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 5f876a4b..bb32ece1 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -5,10 +5,10 @@ import DefaultTheme from 'vitepress/theme' import PlatformSelect from './components/PlatformSelect.vue' import PlatformSnippet from './components/PlatformSnippet.vue' import GithubStartButton from './components/GithubStartButton.vue' +import DiscordBanner from './components/DiscordBanner.vue' import './assets/css/fonts.css' import './assets/css/tailwind.css' import './style.css' -import DiscordModal from './components/DiscordModal.vue' const isPlatformModalOpen = ref(false) @@ -33,11 +33,11 @@ export default { 'nav-bar-content-after': () => h(GithubStartButton, { class: 'ml-4 pt-2' }), - 'doc-bottom': () => h(DiscordModal) }) }, enhanceApp({ app, router, siteData }) { app.component('PlatformSnippet', PlatformSnippet) app.provide('isPlatformModalOpen', isPlatformModalOpen) + app.component('DiscordBanner', DiscordBanner); } } satisfies Theme diff --git a/docs/src/docs/overview.md b/docs/src/docs/overview.md index 2e13f013..eac2a85c 100644 --- a/docs/src/docs/overview.md +++ b/docs/src/docs/overview.md @@ -61,6 +61,8 @@ AI/ML projects often deal with large, unstructured datasets, such as images, vid One of the core strengths of KitOps is its ability to keep data and code versions in sync. This crucial feature solves the reproducibility issues that frequently arise in AI/ML development, ensuring consistency and reliability across project stages. +[ discord banner ] + ### 🚀 Deployment Ready Designed with a focus on deployment, ModelKits package assets in standard formats so you can depoly them as [containers or to Kubernetes](./deploy.md). They're also [compatible with nearly any tool](./modelkit/compatibility.md) - helping you get your model to production faster and more efficiently.