1

I would like our lightning web components to self document on confluence. Kind of like javadocs for LWC. One idea I was thinking about was to have a nightly job that runs and uses JSDoc (https://jsdoc.app/) to parse the comments in the JS file and export them in a documentation folder somewhere which are later imported into confluence using the confluence CLI. Is there a better way to do this that someone here may point me towards? Thanks

9
  • I entirely agree with using JSDoc, as covered in this answer. How you get it into confluence is beyond the scope of this forum, IMHO.
    – Phil W
    May 29, 2020 at 16:31
  • 3
    This may not meet your needs exactly, but Lightning components are already self-documenting to an extent, provided developers are being detailed with your components. You can see your component library by going here: https://<your-domain>.lightning.force.com/docs/component-library
    – nbrown
    May 29, 2020 at 16:32
  • 3
    Just to follow up on my last comment, it looks like LWC don't get documented in that manner yet, per Salesforce: Documentation for Lightning web components developed in your org isn’t yet supported The Component Reference doesn’t display documentation for your custom Lightning web components. With that limitation in mind, I think a tool like JSDoc is perfect for the job. But the nuances of building something that uses that, I think, is outside the scope of this StackExchange.
    – nbrown
    May 29, 2020 at 16:37
  • That doesn't work well for off-org documentation, of course. For example, documentation you provide to (potential) customers when you are an ISV that provides an App on the AppExchange. I'm also not sure how you actually set up the "definition" for a LWC.
    – Phil W
    May 29, 2020 at 16:37
  • 3
    FYI, I have heard that such a tool is being developed, but we likely won't get to see it as customers until 2021.
    – sfdcfox
    May 29, 2020 at 17:03

0

Browse other questions tagged .