Skip to content

Commit

Permalink
feat(apireference): Add support for nested types
Browse files Browse the repository at this point in the history
Add support for nested types to generation of API reference.
Nested types will show up in the list of types and get a documentation page just like top-level types.
A list of nested types is included in documentation page of the surrounding type.

See PR #6
  • Loading branch information
ap0llo authored Dec 29, 2019
2 parents 642a5e6 + f5099ca commit 965c709
Show file tree
Hide file tree
Showing 47 changed files with 2,119 additions and 314 deletions.
2 changes: 1 addition & 1 deletion docs/demoprojects/api/DemoProject/DemoAttribute/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
An example of an custom attribute class for methods

```csharp
[AttributeUsage(AttributeTargets.Method | AttributeTargets.All)]
[AttributeUsage(AttributeTargets.Method)]
public class DemoAttribute : Attribute
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
An example of a custom attribute that is used to annotate a property with custom flags.

```csharp
[AttributeUsage(AttributeTargets.Property | AttributeTargets.All)]
[AttributeUsage(AttributeTargets.Property)]
public class DemoPropertyAnnotationAttribute : Attribute
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NestedTypesDemo.NestedClass1 Constructors

**Declaring Type:** [NestedTypesDemo.NestedClass1](../index.md)

```csharp
public NestedClass1();
```
___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NestedTypesDemo.NestedClass1 Class

**Declaring Type:** [NestedTypesDemo](../index.md)

**Namespace:** [DemoProject](../../index.md)

**Assembly:** DemoProject

This is an example of a nested class

```csharp
public class NestedTypesDemo.NestedClass1
```

**Inheritance:** objectNestedTypesDemo.NestedClass1

## Constructors

| Name | Description |
| --------------------------------------- | ----------- |
| [NestedClass1()](constructors/index.md) | |

___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NestedTypesDemo.NestedClass2.NestedClass3 Constructors

**Declaring Type:** [NestedTypesDemo.NestedClass2.NestedClass3](../index.md)

```csharp
public NestedClass3();
```
___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NestedTypesDemo.NestedClass2.NestedClass3 Class

**Declaring Type:** [NestedTypesDemo.NestedClass2](../index.md)

**Namespace:** [DemoProject](../../../index.md)

**Assembly:** DemoProject

This is an example of an nested class within a nested class

```csharp
public class NestedTypesDemo.NestedClass2.NestedClass3
```

**Inheritance:** objectNestedTypesDemo.NestedClass2.NestedClass3

## Constructors

| Name | Description |
| --------------------------------------- | ----------- |
| [NestedClass3()](constructors/index.md) | |

___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NestedTypesDemo.NestedClass2 Constructors

**Declaring Type:** [NestedTypesDemo.NestedClass2](../index.md)

```csharp
public NestedClass2();
```
___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NestedTypesDemo.NestedClass2 Class

**Declaring Type:** [NestedTypesDemo](../index.md)

**Namespace:** [DemoProject](../../index.md)

**Assembly:** DemoProject

This is an example of a nested class that in turn contains nested types

```csharp
public class NestedTypesDemo.NestedClass2
```

**Inheritance:** objectNestedTypesDemo.NestedClass2

## Constructors

| Name | Description |
| --------------------------------------- | ----------- |
| [NestedClass2()](constructors/index.md) | |

## Nested Types

| Name | Description |
| ------------------------------------------------------------------ | ----------------------------------------------------------- |
| [NestedTypesDemo.NestedClass2.NestedClass3](NestedClass3/index.md) | This is an example of an nested class within a nested class |

___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# NestedTypesDemo.NestedInterface1 Interface

**Declaring Type:** [NestedTypesDemo](../index.md)

**Namespace:** [DemoProject](../../index.md)

**Assembly:** DemoProject

This is an example of a nested interface

```csharp
public interface NestedTypesDemo.NestedInterface1
```
___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NestedTypesDemo Constructors

**Declaring Type:** [NestedTypesDemo](../index.md)

```csharp
public NestedTypesDemo();
```
___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
31 changes: 31 additions & 0 deletions docs/demoprojects/api/DemoProject/NestedTypesDemo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NestedTypesDemo Class

**Namespace:** [DemoProject](../index.md)

**Assembly:** DemoProject

This class shows an example of how the documentation for nested types looks.

```csharp
public class NestedTypesDemo
```

**Inheritance:** objectNestedTypesDemo

## Constructors

| Name | Description |
| ------------------------------------------ | ----------- |
| [NestedTypesDemo()](constructors/index.md) | |

## Nested Types

| Name | Description |
| ------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [NestedTypesDemo.NestedClass1](NestedClass1/index.md) | This is an example of a nested class |
| [NestedTypesDemo.NestedClass2](NestedClass2/index.md) | This is an example of a nested class that in turn contains nested types |
| [NestedTypesDemo.NestedInterface1](NestedInterface1/index.md) | This is an example of a nested interface |

___

*Documentation generated by [MdDocs](https://github.com/ap0llo/mddocs)*
27 changes: 16 additions & 11 deletions docs/demoprojects/api/DemoProject/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

## Classes

| Name | Description |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [DemoAttribute](DemoAttribute/index.md) | An example of an custom attribute class for methods |
| [DemoClass](DemoClass/index.md) | A class meant to demonstrate how the generated documentation looks like. |
| [DemoClass\<T1, T2\>](DemoClass-2/index.md) | An example of an generic class. |
| [DemoPropertyAnnotationAttribute](DemoPropertyAnnotationAttribute/index.md) | An example of a custom attribute that is used to annotate a property with custom flags. |
| [ListExample](ListExample/index.md) | Example class to showcase the different supported list formats. |
| [ObsoleteDemoClass](ObsoleteDemoClass/index.md) | A class meant to demonstrate how the generated documentation for a deprecated class looks like. |
| Name | Description |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [DemoAttribute](DemoAttribute/index.md) | An example of an custom attribute class for methods |
| [DemoClass](DemoClass/index.md) | A class meant to demonstrate how the generated documentation looks like. |
| [DemoClass\<T1, T2\>](DemoClass-2/index.md) | An example of an generic class. |
| [DemoPropertyAnnotationAttribute](DemoPropertyAnnotationAttribute/index.md) | An example of a custom attribute that is used to annotate a property with custom flags. |
| [ListExample](ListExample/index.md) | Example class to showcase the different supported list formats. |
| [NestedTypesDemo](NestedTypesDemo/index.md) | This class shows an example of how the documentation for nested types looks. |
| [NestedTypesDemo.NestedClass1](NestedTypesDemo/NestedClass1/index.md) | This is an example of a nested class |
| [NestedTypesDemo.NestedClass2](NestedTypesDemo/NestedClass2/index.md) | This is an example of a nested class that in turn contains nested types |
| [NestedTypesDemo.NestedClass2.NestedClass3](NestedTypesDemo/NestedClass2/NestedClass3/index.md) | This is an example of an nested class within a nested class |
| [ObsoleteDemoClass](ObsoleteDemoClass/index.md) | A class meant to demonstrate how the generated documentation for a deprecated class looks like. |

## Structs

Expand All @@ -19,9 +23,10 @@

## Interfaces

| Name | Description |
| ----------------------------------------- | ------------------------------------------------------------------------------------------- |
| [IDemoInterface](IDemoInterface/index.md) | A interface meant to demonstrate how the generated documentation for interfaces looks like. |
| Name | Description |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [IDemoInterface](IDemoInterface/index.md) | A interface meant to demonstrate how the generated documentation for interfaces looks like. |
| [NestedTypesDemo.NestedInterface1](NestedTypesDemo/NestedInterface1/index.md) | This is an example of a nested interface |

## Enums

Expand Down
25 changes: 25 additions & 0 deletions src/MdDocs.ApiReference.DemoProject/DemoProject.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions src/MdDocs.ApiReference.DemoProject/NestedTypesDemo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace DemoProject
{
/// <summary>
/// This class shows an example of how the documentation for nested types looks.
/// </summary>
public class NestedTypesDemo
{
/// <summary>
/// This is an example of a nested class
/// </summary>
public class NestedClass1
{ }

/// <summary>
/// This is an example of a nested class that in turn contains nested types
/// </summary>
public class NestedClass2
{
/// <summary>
/// This is an example of an nested class within a nested class
/// </summary>
public class NestedClass3
{ }
}

/// <summary>
/// This is an example of a nested interface
/// </summary>
public interface NestedInterface1
{ }
}
}
Loading

0 comments on commit 965c709

Please sign in to comment.