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

feat: document the slots of a component #1362

Closed
brandyscarney opened this issue Feb 7, 2019 · 6 comments
Closed

feat: document the slots of a component #1362

brandyscarney opened this issue Feb 7, 2019 · 6 comments
Labels

Comments

@brandyscarney
Copy link
Member

Stencil version:

 @stencil/core@0.17.0

I'm submitting a:

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

It would be nice to document the slot options on a component, something like this could go above the component:

/** 
 * @slot start places to the left of the label
 * @slot end places to the right of the label
*/
@Component(..
@ionitron-bot ionitron-bot bot added the triage label Feb 7, 2019
@manucorporat
Copy link
Contributor

Seems like a good idea!

Right now we can support this use case, using the docsTags of each component:

docsTags: [
  {'name: 'slot', text: 'start places to the left of the label'},
  {'name: 'slot', text: 'end places to the right of the label'}
]

but it would be great to provide this as a end-to-end feature:

slots: [
  {name: "start", docs: "places to the left of the label"}
  {name: "end", docs: "places to the right of the label"}
]

@brandyscarney
Copy link
Member Author

@manucorporat How soon can you add this? I need it tomorrow.

@amwmedia
Copy link

amwmedia commented Feb 8, 2019

If I were able to implement the fully baked solution proposed, would a PR be welcomed? 😉

Ideally I'd like to see this provide slot documentation even in cases where no comments are present. We should be able to glean the docs data from the markup used in the template if that's AST parse-able.

@brandyscarney @manucorporat

@NKBelousov
Copy link

NKBelousov commented Dec 9, 2019

Nice idea, it would be great to immediately understand if component supports slots

@brandyscarney
Copy link
Member Author

This has been added in Stencil, you can see it in action here: https://github.com/ionic-team/ionic/blob/6e0b9c45489889266620ee2ca38c33fdf8ce3f3b/core/src/components/button/button.tsx#L12-L15

We haven't added it to be displayed in the docs yet, but the data is there for the site to use.

@NKBelousov
Copy link

This has been added in Stencil, you can see it in action here: https://github.com/ionic-team/ionic/blob/6e0b9c45489889266620ee2ca38c33fdf8ce3f3b/core/src/components/button/button.tsx#L12-L15

We haven't added it to be displayed in the docs yet, but the data is there for the site to use.

Thanks

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

No branches or pull requests

4 participants