Skip to content

Commit

Permalink
add sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles DE VANDIERE committed Nov 19, 2019
1 parent 5243562 commit 9ad99a9
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# XMLDoc2Markdown

See generated sample documentation [here](sample).
10 changes: 10 additions & 0 deletions docs/sample/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# References

## MyClassLib

- [`Class1`](MyClassLib/Class1)

## MyClassLib.SubNamespace

- [`GenericClass<T>`](MyClassLib.SubNamespace/GenericClass{T})
- [`SubClass`](MyClassLib.SubNamespace/SubClass)
19 changes: 19 additions & 0 deletions docs/sample/MyClassLib.SubNamespace/GenericClass{T}.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# GenericClass&lt;T&gt;

`Namespace: MyClassLib.SubNamespace`

Generic class.

```csharp
public class GenericClass<T>
```

## Methods

| Type | Name | Summary |
| --- | --- | --- |
| `T` | GetGenericInstance() | Gets a new instance of generic param. |

---

[`< Back`](./)
20 changes: 20 additions & 0 deletions docs/sample/MyClassLib.SubNamespace/SubClass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SubClass

`Namespace: MyClassLib.SubNamespace`

Sub class from [MyClassLib.Class1](MyClassLib#class1)

```csharp
public class SubClass
: Class1
```

## Methods

| Type | Name | Summary |
| --- | --- | --- |
| `String` | ToString() | Convert instance to string. |

---

[`< Back`](./)
27 changes: 27 additions & 0 deletions docs/sample/MyClassLib/Class1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Class1

`Namespace: MyClassLib`

Class 1

```csharp
public class Class1
```

## Properties

| Type | Name | Summary |
| --- | --- | --- |
| `Int32` | Bar | The bar. |
| `String` | Foo | The foo. |

## Methods

| Type | Name | Summary |
| --- | --- | --- |
| `void` | DoSomeThing(`String` paramOne, `Int32` paramTwo) | Do some thing. |
| `String` | GetSomeThingElse(`String` param) | Gets some thing else. |

---

[`< Back`](./)
42 changes: 42 additions & 0 deletions sample/MyClassLib/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
namespace MyClassLib
{
/// <summary>
/// Class 1
/// </summary>
public class Class1
{
/// <summary>
/// The foo.
/// </summary>
/// <value>The foo.</value>
public string Foo { get; set; }

/// <summary>
/// The bar.
/// </summary>
/// <value>The bar.</value>
public int Bar { get; set; }

/// <summary>
/// Initializes a new instance of the <see cref="Class1" /> class.
/// </summary>
public Class1() { }

/// <summary>
/// Do some thing.
/// </summary>
/// <param name="paramOne">The param one.</param>
/// <param name="paramTwo">The param two</param>
public void DoSomeThing(string paramOne, int paramTwo) { }

/// <summary>
/// Gets some thing else.
/// </summary>
/// <param name="param">The param.</param>
/// <returns>An empty string.</returns>
public string GetSomeThingElse(string param)
{
return string.Empty;
}
}
}
8 changes: 8 additions & 0 deletions sample/MyClassLib/MyClassLib.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

</Project>
24 changes: 24 additions & 0 deletions sample/MyClassLib/SubNamespace/GenericClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace MyClassLib.SubNamespace
{
/// <summary>
/// Generic class.
/// </summary>
/// <typeparam name="T">The type param.</typeparam>
public class GenericClass<T> where T : new()
{
/// <summary>
/// Initializes a new instance of the <see cref="GenericClass" /> class.
/// </summary>
public GenericClass() { }

/// <summary>
/// Gets a new instance of generic param.
/// </summary>
/// <typeparam name="T">The generic param.</typeparam>
/// <returns>The new instance.</returns>
public T GetGenericInstance<T>() where T : new()
{
return new T();
}
}
}
17 changes: 17 additions & 0 deletions sample/MyClassLib/SubNamespace/SubClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace MyClassLib.SubNamespace
{
/// <summary>
/// Sub class from <see cref="Class1" />
/// </summary>
public class SubClass : Class1
{
/// <summary>
/// Convert instance to string.
/// </summary>
/// <returns>A string.</returns>
public override string ToString()
{
return string.Empty;
}
}
}
2 changes: 1 addition & 1 deletion src/XMLDoc2Markdown/MarkdownGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public override string ToString()

mb.Header(1, Beautifier.BeautifyType(type, false).Replace("<", "&lt;").Replace(">", "&gt;"));
mb.AppendLine();
mb.CodeQuote($"Manespace: {type.Namespace}");
mb.CodeQuote($"Namespace: {type.Namespace}");
mb.AppendLine();
mb.AppendLine();

Expand Down

0 comments on commit 9ad99a9

Please sign in to comment.