Skip to content

Commit

Permalink
fix: remove table-of-content plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandros94 committed Mar 6, 2024
1 parent 2a7b24e commit 11cbdf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
14 changes: 2 additions & 12 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ export interface ModuleOptions {
uniqueSlugStartIndex?: number
tabIndex?: number | false
}
toc: false | {
includeLevel?: number[]
containerClass?: string
markerPattern?: RegExp
listType?: 'ol' | 'ul'
containerHeaderHtml?: string
containerFooterHtml?: string
}
}
/**
* Enable vue runtime compiler. Required to render components via plugins such markdown-it-mdc.
Expand Down Expand Up @@ -87,8 +79,7 @@ export default defineNuxtModule<ModuleOptions>({
dark: 'github-dark'
}
},
anchor: {},
toc: {}
anchor: {}
},
vueRuntimeCompiler: true
},
Expand All @@ -108,8 +99,7 @@ export default defineNuxtModule<ModuleOptions>({
githubAlerts: options.plugins.githubAlerts,
mdc: options.plugins.mdc,
shiki: options.plugins.shiki,
anchor: options.plugins.anchor,
toc: options.plugins.toc
anchor: options.plugins.anchor
},
vueRuntimeCompiler: options.vueRuntimeCompiler
}
Expand Down
7 changes: 1 addition & 6 deletions src/runtime/components/nuxt-markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ import MarkdownItGitHubAlerts from 'markdown-it-github-alerts'
import mdcPlugin from 'markdown-it-mdc'
import shiki from '@shikijs/markdown-it'
import anchor from 'markdown-it-anchor'
// @ts-expect-error missing types
import toc from 'markdown-it-table-of-contents'
const {
plugins: {
githubAlerts: githubAlertsOptions,
mdc: mdcOptions,
shiki: shikiOptions,
anchor: anchorOptions,
toc: tocOptions
anchor: anchorOptions
}
} = useRuntimeConfig().public.nuxtMarkdownRender as ModuleOptions
Expand Down Expand Up @@ -90,6 +87,4 @@ if (shikiOptions !== false)
md.value.use(await shiki(shikiOptions))
if (anchorOptions !== false)
md.value.use(anchor, anchorOptions)
if (tocOptions !== false)
md.value.use(toc, tocOptions)
</script>

0 comments on commit 11cbdf4

Please sign in to comment.