runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
501 stars 63 forks source link

[feature] append to readme instead of create the whole thing #159

Open michaelwarren1106 opened 4 years ago

michaelwarren1106 commented 4 years ago

Imo, It would be great to have a feature when your output is markdown and going to some readme file, that you could just append the content generated by WCA instead of recreating the whole file.

I have a ton of "usage examples" of my components, and having them in plain markdown is an easier read than having them in a jsdoc style comment in the code.

Imo, if you added a default tag like <> then replaced that content in the target MD file instead of recreating the whole file, that would be great!

tpluscode commented 3 years ago

I would propose a solution where the generated markdown is appended after a certain "magic comment" such as

My written documentation

<!-- wca -->

Generated by web-component-analyzer

Everything after the comment would get replaced on subsequent runs of wca

michaelwarren1106 commented 3 years ago

Magic comments would be ideal also. To go even further if there were several magic comments such as one each for methods, props, events, etc that would give the absolute most flexibility for devs to structure their docs how they see fit using the info/analysis provided by wca