website icon indicating copy to clipboard operation
website copied to clipboard

Can Wyam generate a report about missing documentation?

Open gep13 opened this issue 9 years ago • 14 comments

I was thinking along the lines of:

  • Missing Summary Information
  • Missing Examples for Aliases
  • etc

For the Addin Documentation. This doesn't have to appear as an actual page on the website, but perhaps as a downloadable artifact?

gep13 avatar Mar 23 '17 07:03 gep13

This sounds to me more of something which would fit for a feature in Cake.AddinDiscoverer.

@Jericho What do you think?

pascalberger avatar Oct 03 '20 19:10 pascalberger

AddinDisco can certainly generate a new report (markdown, Excel, or any format really) as long as I understand where to get the information from.

Jericho avatar Oct 03 '20 19:10 Jericho

You would need to inspect aliases of the addins and parse XML documentation for each to inspect if doc is missing, they don't contain examples, etc. Parsing of XML documentation for addins is something which Wyam currently already does for generating the documentation for cakebuild.net, we therefore should also be able to implement it as part of the website documentation generation. But only from scope I think Cake.AddinDiscoverer would be the better place.

pascalberger avatar Oct 03 '20 19:10 pascalberger

Funny, you suggested something similar quite a while ago and it inspired me to attempt to inspect addins using reflection but I didn't succeed. If I remember correctly, I was getting errors because of missing types due to the fact that addins reference packages, which reference other packages, which reference more packages, etc.

I need to revisit the issue and refresh my memory.

Jericho avatar Oct 03 '20 19:10 Jericho

Reflection won't help for XML comments, since they are not part of the assembly, but instead written to an XML file. You would need to check for and parse this. This is the part which Wyam already has implemented.

pascalberger avatar Oct 03 '20 19:10 pascalberger

ok but won't I still need to scan the assembly to figure out which class(es) and/or method(s) are decorated with the appropriate Cake attribute?

Jericho avatar Oct 03 '20 19:10 Jericho

Sure, you'll need to detect the aliases through reflection and then parse the xml comment from the xml file. Do you think it is worth to implement this all in AddinDiscoverer or better as part of the website generation where we the detection and parsing already have in place?

pascalberger avatar Oct 03 '20 19:10 pascalberger

Detecting the aliases is what I tried when you suggested it (about 2 1/2 years ago) and unfortunately, I failed. I am willing to give it another go. If I succeed, I will be happy to also parse the XML file and generate the report, but if I don't succeed then, sorry: no report for you! ;-)

Jericho avatar Oct 03 '20 19:10 Jericho

Benefit of a separate tool from site, is that it wouldn't slow down/take resources from each website build. Also it only needs to run once per version published to NuGet.

devlead avatar Oct 03 '20 20:10 devlead

@Jericho For reading XML comments you might want to have a look at https://github.com/RicoSuter/Namotion.Reflection which provides an API for it.

pascalberger avatar Oct 07 '20 21:10 pascalberger

Does anybody have a sample of what the report should look like?

Jericho avatar Oct 13 '20 20:10 Jericho

How about one an Excel sheet containing one tab per addin, and inside the tab a list like:

| Member name               | Issue                               |
|---------------------------|-------------------------------------|
| MyNamespace.MyClass.Foo   | Summary description misssing        |
| MyNamespace.MyClass.Bar   | Example missing                     |

pascalberger avatar Oct 13 '20 20:10 pascalberger

I wrote something for Bakery a couple of years ago that gets type information without Reflection via Mono.Cecil and maps each member to the XML documentation. Perhaps this could be used to find unmapped members as well. @mholo65 Do you remember what I mean?

patriksvensson avatar Oct 13 '20 20:10 patriksvensson

@patriksvensson yep, and using Mono.Cecil over reflection have the benefit of not loading the assembly into the app domain. In Bakery we pull out XML docs for addins in order to keep the docs for the generated DSL. This way intellisense will show documentation for generated DSL, which is nice.

bjorkstromm avatar Oct 13 '20 20:10 bjorkstromm