-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#27: Added ApiDescription class for generating library Public Api in …
…form of markdown
- Loading branch information
1 parent
02989b0
commit 0161852
Showing
8 changed files
with
362 additions
and
95 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../Synergy.Documentation.Tests/Architecture/Debt/Todos.Technical.Debt.verified.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Technical Debt for Synergy.Contracts | ||
|
||
Total: 5 | ||
|
||
## [ApiDescription.cs](../../../Synergy.Documentation/Api/ApiDescription.cs) | ||
- TODO: Marcin Celej [from: Marcin Celej on: 08-04-2023]: Duplicated class | ||
|
||
## [CodeFile.cs](../../../Synergy.Documentation/Code/CodeFile.cs) | ||
- TODO: Marcin Celej [from: Marcin Celej on: 14-05-2023]: rename to SourceFile | ||
|
||
## [CodeFolder.cs](../../../Synergy.Documentation/Code/CodeFolder.cs) | ||
- TODO: Marcin Celej [from: Marcin Celej on: 14-05-2023]: Rename to SourceFolder | ||
|
||
## [TodoPattern.cs](../../../Synergy.Documentation/Todos/Patterns/TodoPattern.cs) | ||
- TODO: Marcin Celej [from: Marcin Celej on: 14-04-2023]: Add way to exclude some files from the scan - by path | ||
|
||
## [TodoExplorer.cs](../../../Synergy.Documentation/Todos/TodoExplorer.cs) | ||
- TODO: Marcin Celej [from: Marcin Celej on: 30-04-2023]: Publish this library via nuget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Synergy.Documentation.Api; | ||
|
||
namespace Synergy.Documentation.Tests.Architecture.Public; | ||
|
||
[UsesVerify] | ||
public class Api | ||
{ | ||
[Fact] | ||
public async Task Generate() | ||
{ | ||
// ARRANGE | ||
var assembly = typeof(ApiDescription).Assembly; | ||
|
||
// ACT | ||
var publicApi = ApiDescription.GenerateFor(assembly); | ||
|
||
// ASSERT | ||
await Verifier.Verify(publicApi, "md") | ||
.UseMethodName("of." + assembly.GetName() | ||
.Name); | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
...ocumentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Synergy.Documentation | ||
|
||
## Todos.TodoExplorer (abstract class) | ||
- TodoExplorer.DebtFor( | ||
name: string, | ||
from: CodeFolder, | ||
currentPath: string [CallerFilePath, Optional], | ||
patterns: params TodoPattern[] [ParamArray] | ||
) : string | ||
|
||
## Todos.Patterns.CsharpTodoPattern (record) : TodoPattern, IEquatable<TodoPattern>, IEquatable<CsharpTodoPattern> | ||
- FileExtension: string { get; set; } | ||
- Regex: Regex { get; set; } | ||
- TodoExtractor: Func<Match, string> { get; set; } | ||
- ctor() | ||
|
||
## Todos.Patterns.GherkinTodoPattern (record) : TodoPattern, IEquatable<TodoPattern>, IEquatable<GherkinTodoPattern> | ||
- FileExtension: string { get; set; } | ||
- Regex: Regex { get; set; } | ||
- TodoExtractor: Func<Match, string> { get; set; } | ||
- ctor() | ||
|
||
## Todos.Patterns.TextTodoPattern (record) : TodoPattern, IEquatable<TodoPattern>, IEquatable<TextTodoPattern> | ||
- FileExtension: string { get; set; } | ||
- Regex: Regex { get; set; } | ||
- TodoExtractor: Func<Match, string> { get; set; } | ||
- ctor() | ||
|
||
## Todos.Patterns.TodoPattern (abstract class) : IEquatable<TodoPattern> | ||
- FileExtension: string { get; set; } | ||
- Regex: Regex { get; set; } | ||
- TodoExtractor: Func<Match, string> { get; set; } | ||
|
||
## Code.ClassReader (class) | ||
- ctor() | ||
- ClassReader.ReadMethodBody( | ||
methodName: string, | ||
sourceFilePath: string [CallerFilePath, Optional] | ||
) : string? [NullableContext] | ||
|
||
## Code.CodeFile (class) | ||
- Extension: string { get; } | ||
- FileName: string { get; } | ||
- FileNameWithoutExtension: string { get; } | ||
- FilePath: string { get; } | ||
- Folder: CodeFolder { get; } | ||
- ctor( | ||
filePath: string | ||
) | ||
- CodeFile.Current( | ||
path: string [CallerFilePath, Optional] | ||
) : CodeFolder | ||
- RelativeTo( | ||
folder: CodeFolder | ||
) : CodeFile | ||
- ToString() : string | ||
|
||
## Code.CodeFolder (class) | ||
- Path: string { get; } | ||
- ctor( | ||
path: string | ||
) | ||
- CodeFolder.Current( | ||
path: string [CallerFilePath, Optional] | ||
) : CodeFolder | ||
- File( | ||
fileName: string | ||
) : CodeFile | ||
- ToString() : string | ||
- Up( | ||
jumps: int [Optional] | ||
) : CodeFolder | ||
|
||
## Api.ApiDescription (abstract class) | ||
- ApiDescription.For( | ||
method: MethodInfo, | ||
withAttributes: bool [Optional] | ||
) : string | ||
- ApiDescription.GenerateFor( | ||
assembly: Assembly | ||
) : string | ||
- ApiDescription.GenerateFor( | ||
types: IEnumerable<Type>, | ||
description: StringBuilder? [Nullable, Optional], | ||
assemblyName: string? [Nullable, Optional] | ||
) : string | ||
- ApiDescription.GetTypeName( | ||
method: MethodInfo | ||
) : string | ||
- ApiDescription.GetTypeName( | ||
parameter: ParameterInfo | ||
) : string | ||
- ApiDescription.GetTypeName( | ||
type: Type | ||
) : string | ||
|
||
## Api.ClassDocumentation (class) : Markdown+Document, IEnumerable<Markdown+IElement>, IEnumerable | ||
- ctor( | ||
type: Type | ||
) | ||
- Append( | ||
element: Markdown+IElement | ||
) : Markdown+Document | ||
- Append( | ||
newElements: IEnumerable<Markdown+IElement> | ||
) : Markdown+Document | ||
- GetEnumerator() : IEnumerator<Markdown+IElement> | ||
- ToString() : string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
Documentation/Synergy.Documentation.Tests/Todos/Todos.Technical.Debt.verified.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.