vuepress-plugin-live icon indicating copy to clipboard operation
vuepress-plugin-live copied to clipboard

vitepress support

Open SamWangCoder opened this issue 2 years ago • 5 comments

firstly,thank you for your work. Is there a plan to support vitepress?

SamWangCoder avatar Jul 18 '22 09:07 SamWangCoder

There is a plan, but it will not be called vuepress-plugin-live

elevatebart avatar Jul 18 '22 14:07 elevatebart

I do not have this as a top priority right now. If you have a few cycles to start the plugin on your own, here is my brain download:

If you need it, creating it is very often the best way to have it quickly.

  • vuepress and vitepress both use markdown-it to process markdown. So the markdown plugin should be able to be used the same.
  • vue-live is now compatible with vite, so you should not have any trouble with the use of vue-live as a component in a vitepress website
  • I have still to figure out a few things:
    • how to pass options to the theme
    • how to do the custom layout if we want to keep this option.
    • how to package it all as a simple-to-install plugin

elevatebart avatar Jul 18 '22 14:07 elevatebart

Thanks for your brain download! I will try create it maybe later. I have tryied put repl into vitepress, but this way is not convenience enough.

SamWangCoder avatar Jul 18 '22 18:07 SamWangCoder

There is one more thing I have not figured out how to do.

To compile templates, Vue needs its bundle time version in the browser. To do that, we set an alias of vue to vue/dist/vue.esm-bundler.js. Sadly, import alias do not seem to be implemented in VitePress (yet). I believe we would need some custom plugin. Remeber. that VitePress is still alpha 😉

elevatebart avatar Jul 19 '22 02:07 elevatebart

Yes! I have tried to merge your vite-vue-live to vitepress proj but failed. Vitepress ignore the config of vite.alias. So I try to merge Ant Design Vue Playground into my proj, it works. But can not import local components into repl real-time. In consideration of VitePress still a alpha version, I'll try create a plugin later.

SamWangCoder avatar Jul 19 '22 03:07 SamWangCoder