Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed May 6, 2024
1 parent 2e988ba commit ec86419
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/Doki.Abstractions/AssemblyDocumentation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ public sealed record AssemblyDocumentation : ContentList
/// <summary>
/// Gets the name of the assembly.
/// </summary>
public string FileName { get; internal init; } = null!;
public string FileName { get; init; } = null!;

/// <summary>
/// Gets the version of the assembly.
/// </summary>
public string? Version { get; internal init; }
public string? Version { get; init; }

/// <summary>
/// Gets the NuGet package ID of the assembly.
/// </summary>
public string? PackageId { get; internal init; }
public string? PackageId { get; init; }
}
6 changes: 3 additions & 3 deletions src/Doki.Abstractions/ContentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public record ContentList : DocumentationObject
/// <summary>
/// Gets the name of the content list.
/// </summary>
public string Name { get; internal init; } = null!;
public string Name { get; init; } = null!;

/// <summary>
/// Gets the description of the content list.
/// </summary>
public string? Description { get; internal init; }
public string? Description { get; init; }

/// <summary>
/// Gets the items in the content list.
/// </summary>
public DocumentationObject[] Items { get; internal set; } = [];
public DocumentationObject[] Items { get; set; } = [];
}
27 changes: 14 additions & 13 deletions src/Doki.Output.ClassLibrary/ClassLibraryOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static class Documentation
public static readonly AssemblyDocumentation[] Assemblies =
[
""");
contentListContent.AppendLine();

foreach (var item in contentList.Items)
{
Expand All @@ -80,25 +81,25 @@ private static void BuildAssemblyDocumentation(AssemblyDocumentation assemblyDoc
StringBuilder contentListContent)
{
contentListContent.AppendLine($$"""
new AssemblyDocumentation
{
Name = "{{assemblyDocumentation.Name}}",
Description = "{{assemblyDocumentation.Description}}",
FileName = "{{assemblyDocumentation.FileName}}",
Version = "{{assemblyDocumentation.Version}}",
PackageId = "{{assemblyDocumentation.PackageId}}",
Items =
[
new AssemblyDocumentation
{
Name = "{{assemblyDocumentation.Name}}",
Description = "{{assemblyDocumentation.Description}}",
FileName = "{{assemblyDocumentation.FileName}}",
Version = "{{assemblyDocumentation.Version}}",
PackageId = "{{assemblyDocumentation.PackageId}}",
Items =
[
""");

foreach (var item in assemblyDocumentation.Items)
{
BuildContentList(item, contentListContent, 3);
BuildContentList(item, contentListContent, 4);
}

contentListContent.AppendLine("""
]
},
]
},
""");
}

Expand All @@ -107,7 +108,7 @@ private static void BuildContentList(DocumentationObject documentationObject, St
{
if (documentationObject is not ContentList contentList) return;

var i = new string(' ', indent);
var i = new string(' ', indent * 4);

contentListContent.AppendLine($$"""
{{i}}new ContentList
Expand Down

0 comments on commit ec86419

Please sign in to comment.