Skip to content

Commit

Permalink
fixes & generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed May 6, 2024
1 parent 26cc519 commit 5ec6c34
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 42 deletions.
9 changes: 6 additions & 3 deletions docs/api/Doki.Abstractions/Doki/Doki.AssemblyDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Package: [Doki.Abstractions](https://www.nuget.org/packages/Doki.Abstractions)
**Represents the documentation for an assembly.**

```csharp
public sealed record AssemblyDocumentation : Doki.ContentList
public sealed record AssemblyDocumentation : Doki.DocumentationObject
```

Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → [ContentList](Doki.ContentList.md) → AssemblyDocumentation
Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → AssemblyDocumentation

Implements: [System.IEquatable<Doki.AssemblyDocumentation>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.AssemblyDocumentation>)

Expand All @@ -37,6 +37,9 @@ Implements: [System.IEquatable<Doki.AssemblyDocumentation>](https://learn.
|FileName|Gets the name of the assembly.|
|Version|Gets the version of the assembly.|
|PackageId|Gets the NuGet package ID of the assembly.|
|Name||
|Description||
|Namespaces||


## Methods
Expand All @@ -47,7 +50,7 @@ Implements: [System.IEquatable<Doki.AssemblyDocumentation>](https://learn.
|PrintMembers(System.Text.StringBuilder)||
|GetHashCode()||
|Equals(System.Object)||
|Equals(Doki.ContentList)||
|Equals(Doki.DocumentationObject)||
|Equals(Doki.AssemblyDocumentation)||


Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System

| |Summary|
|---|---|
|Assemblies|The root of the documentation, containing all assemblies/packages.|
|Object|An object in the documentation. This is the default content type.|
|Root|The root of the documentation, containing all assemblies/packages.|
|Assembly|An assembly in the documentation.|
|Namespace|A namespace in the documentation.|
|TypeReference|A type reference in the documentation.|
Expand All @@ -34,7 +35,7 @@ Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System
|Interface|An interface in the documentation.|
|Type|A type.|
|GenericTypeArgument|A generic type argument.|
|XmlDocumentation|A xml documentation object.|
|Xml|A xml content.|
|Text|A text content.|
|CodeBlock|A code block.|
|Link|A link.|
Expand Down
4 changes: 2 additions & 2 deletions docs/api/Doki.Abstractions/Doki/Doki.DocumentationObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract record DocumentationObject

Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → DocumentationObject

Derived: [CodeBlock](Doki.CodeBlock.md), [ContentList](Doki.ContentList.md), [Link](Doki.Link.md), [MemberDocumentation](Doki.MemberDocumentation.md), [TextContent](Doki.TextContent.md)
Derived: [AssemblyDocumentation](Doki.AssemblyDocumentation.md), [CodeBlock](Doki.CodeBlock.md), [DocumentationRoot](Doki.DocumentationRoot.md), [Link](Doki.Link.md), [MemberDocumentation](Doki.MemberDocumentation.md), [NamespaceDocumentation](Doki.NamespaceDocumentation.md), [TextContent](Doki.TextContent.md), [XmlDocumentation](Doki.XmlDocumentation.md)

Implements: [System.IEquatable<Doki.DocumentationObject>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.DocumentationObject>)

Expand All @@ -39,7 +39,7 @@ Implements: [System.IEquatable<Doki.DocumentationObject>](https://learn.mi
|EqualityContract||
|Id|Gets the ID of the documentation object.|
|Parent|Gets the parent of the documentation object.|
|Content|Gets the content type of the documentation object.|
|ContentType|Gets the content type of the documentation object.|


## Methods
Expand Down
49 changes: 49 additions & 0 deletions docs/api/Doki.Abstractions/Doki/Doki.DocumentationRoot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[Packages](../../README.md) / [Doki.Abstractions](../README.md) / [Doki](README.md) /

# DocumentationRoot Class

## Definition

Namespace: [Doki](README.md)

Assembly: [Doki.Abstractions.dll](../README.md)

Package: [Doki.Abstractions](https://www.nuget.org/packages/Doki.Abstractions)

---

```csharp
public sealed record DocumentationRoot : Doki.DocumentationObject
```

Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → DocumentationRoot

Implements: [System.IEquatable<Doki.DocumentationRoot>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.DocumentationRoot>)

## Constructors

| |Summary|
|---|---|
|DocumentationRoot()||


## Properties

| |Summary|
|---|---|
|EqualityContract||
|Assemblies||


## Methods

| |Summary|
|---|---|
|ToString()||
|PrintMembers(System.Text.StringBuilder)||
|GetHashCode()||
|Equals(System.Object)||
|Equals(Doki.DocumentationObject)||
|Equals(Doki.DocumentationRoot)||


5 changes: 3 additions & 2 deletions docs/api/Doki.Abstractions/Doki/Doki.MemberDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Implements: [System.IEquatable<Doki.MemberDocumentation>](https://learn.mi

| |Summary|
|---|---|
|MemberDocumentation()|Initializes a new instance of the [MemberDocumentation](Doki.MemberDocumentation.md) class.|
|MemberDocumentation(Doki.MemberDocumentation)|Initializes a new instance of the [MemberDocumentation](Doki.MemberDocumentation.md) class.|
|MemberDocumentation(Doki.MemberDocumentation)||
|MemberDocumentation()||


## Properties
Expand All @@ -41,6 +41,7 @@ Implements: [System.IEquatable<Doki.MemberDocumentation>](https://learn.mi
|Namespace|Gets the namespace of the member.|
|Assembly|Gets the assembly of the member.|
|Summary|Gets the summary of the member.|
|Content||


## Methods
Expand Down
51 changes: 51 additions & 0 deletions docs/api/Doki.Abstractions/Doki/Doki.NamespaceDocumentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[Packages](../../README.md) / [Doki.Abstractions](../README.md) / [Doki](README.md) /

# NamespaceDocumentation Class

## Definition

Namespace: [Doki](README.md)

Assembly: [Doki.Abstractions.dll](../README.md)

Package: [Doki.Abstractions](https://www.nuget.org/packages/Doki.Abstractions)

---

```csharp
public sealed record NamespaceDocumentation : Doki.DocumentationObject
```

Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → NamespaceDocumentation

Implements: [System.IEquatable<Doki.NamespaceDocumentation>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.NamespaceDocumentation>)

## Constructors

| |Summary|
|---|---|
|NamespaceDocumentation()||


## Properties

| |Summary|
|---|---|
|EqualityContract||
|Name||
|Description||
|Types||


## Methods

| |Summary|
|---|---|
|ToString()||
|PrintMembers(System.Text.StringBuilder)||
|GetHashCode()||
|Equals(System.Object)||
|Equals(Doki.DocumentationObject)||
|Equals(Doki.NamespaceDocumentation)||


1 change: 1 addition & 0 deletions docs/api/Doki.Abstractions/Doki/Doki.TypeDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Implements: [System.IEquatable<Doki.TypeDocumentation>](https://learn.micr
|Fields|Gets the fields of the type.|
|Properties|Gets the properties of the type.|
|Methods|Gets the methods of the type.|
|Content||


## Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Implements: [System.IEquatable<Doki.TypeDocumentationReference>](https://l
| |Summary|
|---|---|
|TypeDocumentationReference()|Initializes a new instance of the [TypeDocumentationReference](Doki.TypeDocumentationReference.md) class.|
|TypeDocumentationReference(Doki.TypeDocumentationReference)|Initializes a new instance of the [TypeDocumentationReference](Doki.TypeDocumentationReference.md) class.|
|TypeDocumentationReference(Doki.TypeDocumentationReference)||


## Properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Packages](../../README.md) / [Doki.Abstractions](../README.md) / [Doki](README.md) /

# ContentList Class
# XmlDocumentation Class

## Definition

Expand All @@ -12,41 +12,29 @@ Package: [Doki.Abstractions](https://www.nuget.org/packages/Doki.Abstractions)

---

**Represents a list of content.**

```csharp
public record ContentList : Doki.DocumentationObject
public sealed record XmlDocumentation : Doki.DocumentationObject
```

Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → ContentList

Derived: [AssemblyDocumentation](Doki.AssemblyDocumentation.md)
Inheritance: [System.Object](https://learn.microsoft.com/en-us/dotnet/api/System.Object) → [DocumentationObject](Doki.DocumentationObject.md) → XmlDocumentation

Implements: [System.IEquatable<Doki.ContentList>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.ContentList>)
Implements: [System.IEquatable<Doki.XmlDocumentation>](https://learn.microsoft.com/en-us/dotnet/api/System.IEquatable<Doki.XmlDocumentation>)

## Constructors

| |Summary|
|---|---|
|ContentList(Doki.ContentList)||
|ContentList()||


## Fields

| |Summary|
|---|---|
|Assemblies|Represents the assemblies content list.|
|XmlDocumentation()||


## Properties

| |Summary|
|---|---|
|EqualityContract||
|Name|Gets the name of the content list.|
|Description|Gets the description of the content list.|
|Items|Gets the items in the content list.|
|Name||
|Description||
|Contents||


## Methods
Expand All @@ -58,6 +46,6 @@ Implements: [System.IEquatable<Doki.ContentList>](https://learn.microsoft.
|GetHashCode()||
|Equals(System.Object)||
|Equals(Doki.DocumentationObject)||
|Equals(Doki.ContentList)||
|Equals(Doki.XmlDocumentation)||


4 changes: 3 additions & 1 deletion docs/api/Doki.Abstractions/Doki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@

- [AssemblyDocumentation](Doki.AssemblyDocumentation.md)
- [CodeBlock](Doki.CodeBlock.md)
- [ContentList](Doki.ContentList.md)
- [DocumentationContentType](Doki.DocumentationContentType.md)
- [DocumentationObject](Doki.DocumentationObject.md)
- [DocumentationObjectExtensions](Doki.DocumentationObjectExtensions.md)
- [DocumentationRoot](Doki.DocumentationRoot.md)
- [GenericTypeArgumentDocumentation](Doki.GenericTypeArgumentDocumentation.md)
- [Link](Doki.Link.md)
- [MemberDocumentation](Doki.MemberDocumentation.md)
- [NamespaceDocumentation](Doki.NamespaceDocumentation.md)
- [TextContent](Doki.TextContent.md)
- [TypeDocumentation](Doki.TypeDocumentation.md)
- [TypeDocumentationReference](Doki.TypeDocumentationReference.md)
- [XmlDocumentation](Doki.XmlDocumentation.md)


Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public interface IOutput
|---|---|
|BeginAsync(System.Threading.CancellationToken)||
|EndAsync(System.Threading.CancellationToken)||
|WriteAsync(Doki.ContentList, System.Threading.CancellationToken)|Writes the content list to the output.|
|WriteAsync(Doki.TypeDocumentation, System.Threading.CancellationToken)|Writes the type documentation to the output.|
|WriteAsync(Doki.DocumentationRoot, System.Threading.CancellationToken)|Writes the documentation.|
|WriteAsync(Doki.AssemblyDocumentation, System.Threading.CancellationToken)||
|WriteAsync(Doki.NamespaceDocumentation, System.Threading.CancellationToken)||
|WriteAsync(Doki.TypeDocumentation, System.Threading.CancellationToken)|Writes a specific type documentation.|


Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Implements: [IOutput](../../Doki.Output.Abstractions/Doki.Output/Doki.Output.IOu
| |Summary|
|---|---|
|BeginAsync(System.Threading.CancellationToken)||
|WriteAsync(Doki.ContentList, System.Threading.CancellationToken)||
|WriteAsync(Doki.TypeDocumentation, System.Threading.CancellationToken)||
|WriteAsync(Doki.DocumentationRoot, System.Threading.CancellationToken)||


Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Implements: [IOutput](../../Doki.Output.Abstractions/Doki.Output/Doki.Output.IOu
| |Summary|
|---|---|
|BeginAsync(System.Threading.CancellationToken)||
|WriteAsync(Doki.ContentList, System.Threading.CancellationToken)||
|WriteAsync(Doki.DocumentationRoot, System.Threading.CancellationToken)||
|WriteAsync(Doki.AssemblyDocumentation, System.Threading.CancellationToken)||
|WriteAsync(Doki.NamespaceDocumentation, System.Threading.CancellationToken)||
|WriteAsync(Doki.TypeDocumentation, System.Threading.CancellationToken)||


6 changes: 6 additions & 0 deletions src/Doki.Abstractions/DocumentationContentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
/// </summary>
public enum DocumentationContentType
{
/// <summary>
/// An object in the documentation. This is the default content type.
/// </summary>
// ReSharper disable once UnusedMember.Global
Object,

/// <summary>
/// The root of the documentation, containing all assemblies/packages.
/// </summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Doki.Abstractions/DocumentationRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

public sealed record DocumentationRoot : DocumentationObject
{
public string Name => "Packages";

internal AssemblyDocumentation[] InternalAssemblies = [];

public AssemblyDocumentation[] Assemblies
Expand Down
1 change: 1 addition & 0 deletions src/Doki.Output.Markdown/InternalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public static Element BuildLinkTo(this MarkdownBuilder builder, DocumentationObj
relativePath ??= indexFile ? builder.BuildRelativePath(to, "README.md") : builder.BuildRelativePath(to) + ".md";

text ??= to.Id;
if (text == "root") text = "Packages";

if (to is not TypeDocumentationReference { IsGeneric: true } type ||
type.GenericArguments.All(a => a.IsGenericParameter))
Expand Down
8 changes: 5 additions & 3 deletions src/Doki.Output.Markdown/MarkdownOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async Task WriteAsync(DocumentationRoot root, CancellationToken cancellat
{
ArgumentNullException.ThrowIfNull(root);

var (file, markdown) = Prepare(root, root.Name);
var (file, markdown) = Prepare(root, "Packages");

var items = new List<Element>();
foreach (var assemblyDocumentation in root.Assemblies)
Expand Down Expand Up @@ -46,7 +46,8 @@ public async Task WriteAsync(AssemblyDocumentation assemblyDocumentation,
{
ArgumentNullException.ThrowIfNull(assemblyDocumentation);

var (file, markdown) = Prepare(assemblyDocumentation, assemblyDocumentation.Name);
var (file, markdown) = Prepare(assemblyDocumentation, assemblyDocumentation.Name,
assemblyDocumentation.Description);

markdown.Add(new Heading("Namespaces", 2));
markdown.Add(new List
Expand All @@ -62,7 +63,8 @@ public async Task WriteAsync(NamespaceDocumentation namespaceDocumentation,
{
ArgumentNullException.ThrowIfNull(namespaceDocumentation);

var (file, markdown) = Prepare(namespaceDocumentation, namespaceDocumentation.Name);
var (file, markdown) = Prepare(namespaceDocumentation, namespaceDocumentation.Name,
namespaceDocumentation.Description);

markdown.Add(new Heading("Types", 2));
markdown.Add(new List
Expand Down

0 comments on commit 5ec6c34

Please sign in to comment.