Skip to content

honkinglin/vite-plugin-tdoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-tdoc

Transform markdown into anything for vite plugin

Inspired by vitepress

Getting started

// vite config
import vitePluginTdoc from 'vite-plugin-tdoc';

export default {
  plugins: [
    vitePluginTdoc({
      markdown: {
        container(md, container) {},  // markdown-it-container
        attrs: {}, // markdown-it-attrs
        anchor: {}, // markdown-it-anchor
        toc: {}, // markdown-it-toc-done-right
        config(md) {}, // custom md config
        lineNumbers: false, // highlight lineNumber
      },
      plugins: [], // other plugins for vite
      transforms: { // markdown transform progress
        before({ source, file, md }) {}, // before transform
        render({ source, file, md }) {}, // custom render or use default render
        after({ result, source, file, md }) {} // after render or default render
      }
    })
  ]
}

Schematics

Schematics

License

MIT.

About

Transform markdown into anything for vite plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published