Skip to content
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

I want to compile/render Vue templates #168

Open
mirisuzanne opened this issue Oct 13, 2017 · 7 comments
Open

I want to compile/render Vue templates #168

mirisuzanne opened this issue Oct 13, 2017 · 7 comments
Milestone

Comments

@mirisuzanne
Copy link
Member

No description provided.

@davisagli
Copy link
Contributor

How do we want this to work?

The Vue docs actually use "docs" as an example of adding a custom type of block to a single-file component: https://vue-loader.vuejs.org/en/configurations/custom-blocks.html

Within the block, the format would be up to us. Also use sassdoc directives here?

I was thinking that we could try to introspect the component so that we can render some things even if the developer doesn't write explicit documentation (such as name, parameters). But this requires actually executing the js code, which can get tricky (do we require using webpack and providing your webpack configuration so we can use the loaders?). But if we want to actually render components inline as examples we have to do that somehow.

@davisagli
Copy link
Contributor

As we discussed yesterday, being able to render examples of components is a pretty key feature.

That requires being able to execute the example in an environment that can import from other modules in the project. My current thinking about how to do this is:

  1. Use a webpack plugin to render the examples once the build is done, and write the resulting doc data to a JSON file.
  2. Add a directive from Herman to include pre-built JSON from that file.

This would be analogous to how we get data from Sass currently (Sass compilation produces JSON; Herman run consumes the JSON).

I think that given the difficulty and early status of this ticket compared to others in the 1.0 milestone, we should probably move this one to the stretch goals. Any objection?

@jgerigmeyer
Copy link
Member

Sounds good. I agree that while a nice feature, this is not necessary for 1.0.

@jgerigmeyer jgerigmeyer modified the milestones: Herman 1.0, Herman 1.x Stretch Goals Nov 8, 2017
@jgerigmeyer
Copy link
Member

@mirisuzanne
Copy link
Member Author

@jgerigmeyer @chrisvfritz Here's a rough draft for syntax, roughly based on the SassDoc annotations. Happy for feedback!

https://gist.github.com/mirisuzanne/d1f6cd8733bb30cacf149620c1db78f9

@jgerigmeyer
Copy link
Member

@chrisvfritz Okay, so here's a simple playground to work on Vue-Herman integration: oddbird/herman-test-project#4

I've added some notes there documenting what we've tried, and what I was planning to try next -- but you're certainly more knowledgable in this area, so feel free to ignore it and do whatever makes most sense!

@chrisvfritz
Copy link

Nice! I'll play around with this. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants