New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DISCUSSION] Vuepress Docs Loader/Generator for Styleguides #1084
Comments
Thanks for your suggestion, it looks like a If yes, there is a WIP lib for it: https://github.com/posva/vuepress-plugin-example-preview |
@ulivz I would say that solves about half the request then, yes. The remainder would be providing a mechanism to read the |
That feature would be great! I some tired in find styleguide for vue but converted to react lib under the hood. |
that plugin is supposed to display a code sample along the running demo. It's based off what I used for vue-router docs but never got the time to finish it so it can be extensible |
@angeliski I've been doing some more research on this idea this morning and have a few things to add to the discussion.
chainWebpack: config => {
config.module
.rule('docs')
.resourceQuery('/blockType=docs/')
.use('docs')
.loader('vuepress-stories-loader'))
.end()
}
The main problem I am not quite sure how to solve is how to stream the Vue components' docs content into the Vuepress instance. Right now, Vuepress is building/watching based off of the static files in the specified directory ( The only thing I can think of is that we scaffold out the components' |
@posva I will see what I can do with that plugin @K3TH3R Really, It's a big problem... Maybe we can put a hook registration in the register components plugin to make something like a "copy/paste" just to webpack find... @ulivz You see a simple way to do that in the vuepress, using the plugin API? |
I would say for now checkout f3ltron/vuepress-component-docgen. I will be improving docgen soon with multiple new features among which, a live playground for your stories/examples. |
Hello just for push it :). The repo is now vuepress-plugin-docgen We are now in v1.2 Still in development but it is improving every day 👍 We are working a lot together with @elevatebart and we have created playground version v1 of vuepress-plugin-live. You can combinate with vuepress-plugin-docgen or just choose one of them. I hope you will like and give us a lot feedbacks |
Is this, or anything like this still being worked on? I see the repo has been archived. |
Hello @braddialpad the repo is not anymore maintain. The npm package should still be available but no more updates will be achieve. Probably better to check from vitepress now |
@jsbaguette @braddialpad I have a working version of vue-live with JSX and everything ready to ship. Once this shipped I am rebuilding styleguidist on top of vite, no vitepress, no nuxt 3, just the barebones so that anyone can jump on it. You can still use vue-docgen-cli in the meantime. It works well but needs a bit more setup than a turnkey solution like vue-styleguidist 5. |
Nice thanks, I think a combination of vue-live and vue-docgen could give me what I'm looking for. |
Feature request
I don't believe this will end up being a request specifically for VuePress, but I believe this is the most relevant place to begin the discussion so my apologies in advance if I'm in error.
One of the biggest ideas to hit the frontend world over the last several years has been the idea of Design Systems and consequently Styleguides. It's a clear and easy way to communicate pre-existing frontend work to new hires as well as provide them a concrete point of reference as they're onboarding into the development workflow.
Storybook already has Vue integration, but it's not very... Vue-y.
However, VuePress already supports Vue components inside of Markdown files and Vue-Loader has a relatively unknown and rarely used functionality for handling custom blocks. It seems to me like there's a way here to integrate a Styleguide + Docs functionality with Vuepress that is built from an application's components themselves and operates in a very "Vue" way.
What problem does this feature solve?
For application projects, it would allow us to couple our documentation closely to the implementation. I would expect there is still the need for a
docs
folder for non-component documentation, so this is more of an add-on rather than a requirement.What does the proposed API look like?
Let's imagine a button component with two color and size styles:
Like in Storybook, the
<story-template/>
component would render a string of our component's<template>
contents within acode
block while the<story>
block would insert the Vue component into the Markdown file.The
<docs>
tag would simply be a markdown rendering. That "path" attribute would be relative to whatever the chosendocs
folder is for the Vuepress instance. In the case of the VuePress defaultdocs
folder in the root of the directory, our button component's docs would become/docs/components/button.md
.How should this be implemented in your opinion?
I'm not sure if this is actually something that should be implemented inside of VuePress or whether it belongs in vue-loader or as it's own repo as a plugin for vue-cli. I don't quite understand the interplay between all of the libraries enough to know where this belongs. Wherever it ends up though, it seemed like it would need the most important discussion/consideration from VuePress which is why I decided to submit this here.
In particular, the community would probably want hot-reload for these components in development but they won't exist as actual markdown files inside of the
docs
folder so there's some juggling there between VuePress/Webpack/Vue-Loader.Are you willing to work on this yourself?**
I'm willing to help out however I can although my knowledge of Vue ecosystem internals is definitely lacking.
The text was updated successfully, but these errors were encountered: