Doraku / DefaultDocumentation

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

Nested types #17

Closed nxrighthere closed 4 years ago

nxrighthere commented 4 years ago

Just noticed that nested types are not handled properly.

Code:

// <summary>
/// Key codes
/// </summary>
public static class Keys {
    public const string MouseX = "MouseX";
    public const string MouseY = "MouseY";
    public const string MouseScrollUp = "MouseScrollUp";
    public const string MouseScrollDown = "MouseScrollDown";
    public const string MouseWheelAxis = "MouseWheelAxis";

    /// <summary>
    /// Gamepad
    /// </summary>
    public static class Gamepad {
        public const string LeftX = "Gamepad_LeftX";
        public const string LeftY = "Gamepad_LeftY";
        public const string RightX = "Gamepad_RightX";
        public const string RightY = "Gamepad_RightY";

        ...

Result:

result

I think nested classes should be located in Keys class under Classes section. 🤔

Doraku commented 4 years ago

I took the way microsoft presents its own documentation as a reference (example) but it wouldn't hurt to add those links on the parent type page too.

nxrighthere commented 4 years ago

Ah I see, thanks. Maybe we can make it optional?

Doraku commented 4 years ago

I added an enum you will be able to set with the DefaultDocumentationNestedTypeVisibility element in your csproj. I think the values should be self explanatory ;)

    public enum NestedTypeVisibility
    {
        Namespace,
        DeclaringType,
        Everywhere
    }
nxrighthere commented 4 years ago

Looks nice, thanks!