Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
157 stars 26 forks source link

Add support for code examples from actual code #40

Closed basvanderlaken closed 3 years ago

basvanderlaken commented 3 years ago

This can be done by using the extended C# XML comments as shown on [https://ewsoftware.github.io/XMLCommentsGuide/html/1abd1992-e3d0-45b4-b43d-91fcfc5e5574.htm].

I have a branch with this functionality added. If you would allow me to create a pull request I can push it.

Doraku commented 3 years ago

You should be able to create pull requests if you fork this repo :) Since normally <code> elements are already supported, are you specifically talking about the attributes from Sandcastle? (language/source/...) It looks like a great addition indeed to not pollute actual code with example code.

basvanderlaken commented 3 years ago

Yes, I'm referring to the Sandcastle extension, although I thought these were originally extensions from Microsoft.

I've created the pull-request. In order for it to work, I had to update to .net5.0 due to version conflicts. with System.Reflection.Metadata

Doraku commented 3 years ago

I hope that's ok with you I decided to remove the Microsoft.CodeAnalysis.CSharp dependencies as it multiplied the packages size by 5-6 just for the code extraction. I redid the CodeRegion in this commit with regex (hopefully without error). The overall code should also be much more cleaner and easier to add new stuff too now.

basvanderlaken commented 3 years ago

That's great. My regex skills are horrible, so I thought it be best to solve this using the CSharp library.