-
Notifications
You must be signed in to change notification settings - Fork 210
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
Documenting custom elements #328
Comments
This is an interesting request, with web components adding their custom HTML elements to pages, I expect that there will be other similar requests in the future. Currently, I don't see an easy way to add real support for custom elements. It seems like this would need to be a new primary tag ala Would using the |
I did plan on using the I've almost found success writing |
I've just seen a similar question recently. I'm not familiar with Web Components for now, so I'm not sure what is best way for this. However, I feel it's interesting improvements, I'd love to do it if there is a thing that I can! |
Well I'm glad to see there's interest here! Here's some things in particular that I'd like to document for each of my custom elements that currently have no semantic YUIDoc attribute:
The first three of those could cross link automatically, kind of like how the MDN documentation is for elements. |
We're looking at allocating some time to this in the near future as it is becoming more important to us as we expand the custom elements provided by our API. Do you have any thoughts on how we should proceed before we start? |
@andyearnshaw I haven't started a specific work yet, and I feel that I need to become more familiar with Web Components and Polymer world. Anyway, I'm welcome your contributions at anytime. 👍 |
I've just started work on this and already hit a snag! /**
* The interface for an <x-foo> element.
* @class XFooElement
*/
/**
* Renders a foo.
* @element x-foo
*/
var XFooElement = document.registerElement( ...args );
/**
* Gets or sets the bar.
* @property {string} bar
*/
/**
* Sets the bar. Linked to the property of the same name.
* @attribute bar
*/
Object.defineProperty(XFooElement.prototype, 'bar', { ... }); How should Some advice on how to proceed here would be great! 🙏 |
I would like to maintain a backward compatibility, and I prefer using |
#371 have been merged. This feature will be available in the next version. |
We have an API we provide to 3rd-parties, for which I've written a custom HTML elements (
document.register
) polyfill and a handful of custom elements, with more on the way. We're currently using YUIDoc to document the rest of the API, but I'd also like to document these custom elements, along with their attributes and behaviour, in their own section (ie, next to Classes and Modules). Is this currently possible?Being able to write something like this would be great:
The text was updated successfully, but these errors were encountered: