Entomy / LibLangly

The combined Langly runtime
https://entomy.github.io/LibLangly/
33 stars 7 forks source link

XML Doc Comment Parser #290

Open Entomy opened 3 years ago

Entomy commented 3 years ago

Cameron Young brought up here that it would be nice for a separate parser for .NET's Documentation Comments. This is something I've increasingly felt necessary as well, as DocFX has some issues I'm not sure they'll ever deal with. The major one I'm running into, is the inability to build docs for the three core languages at once, even though Microsoft likely has an internal extension to the system that allows them to do exactly this (or they write them all manually, which is insane). What I would like to be able to do, is build common docs from x-lang projects, primarily in C# and F#, and have the documentation site work for any of the three core languages, with a similar language selector system for changing the signatures or examples that docs.microsoft uses.

This requires two components similar to how compilers work, an analyzer, or more specifically, extractor, which only parses and analyzes enough of the sources to get the object signature, and the doc comments, and then a synthesizer which in this case doesn't synthesize executable code, but instead, a static website.

The analyzer itself is what's relevant here, and is two parts itself. First is the standard XML Documentation Comment language, which should be built into a unique assembly. This would then get embedded into special C#, VB, and F# "extractors" which understand only the necessary parts of those languages, enough for signature and documentation extraction. This would then form a parse tree with only the relevant parts. A separate static website synthesizer could then walk the parse tree to generate the sites, and actually address my x-lang concerns.

Entomy commented 3 years ago

I'm putting this with the v5.3 milestone because in order to do this without an entire C#, VB, and F# parser, it requires search capabilities in the patterns engine.

I'm not implementing entire parsers for the major .NET languages. 🤣