Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
API page
  • Loading branch information
yufeih committed Jan 13, 2024
commit 6fb45ccab0543635cf3563959e94afe09d34720f
17 changes: 11 additions & 6 deletions src/Docfx.Build/ApiPage/ApiPageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ public FileModel Load(FileAndType file, ImmutableDictionary<string, object> meta
var yml = EnvironmentContext.FileAbstractLayer.ReadAllText(file.File);
var json = JsonSerializer.Serialize(deserializer.Deserialize<object>(yml));
var data = JsonSerializer.Deserialize<ApiPage>(json, ApiPage.JsonSerializerOptions);
var content = new Dictionary<string, object>(metadata.OrderBy(item => item.Key))
var content = new Dictionary<string, object>(metadata.OrderBy(item => item.Key));

if (data.metadata is not null)
{
["title"] = data.title,
["content"] = ApiPageHtmlTemplate.Render(data, Markup).ToString(),
["yamlmime"] = "ApiPage",
["_disableNextArticle"] = true,
};
foreach (var (key, value) in data.metadata.OrderBy(item => item.Key))
content[key] = value.Value;
}

content["title"] = data.title;
content["content"] = ApiPageHtmlTemplate.Render(data, Markup).ToString();
content["yamlmime"] = "ApiPage";
content["_disableNextArticle"] = true;

var localPathFromRoot = PathUtility.MakeRelativePath(EnvironmentContext.BaseDirectory, EnvironmentContext.FileAbstractLayer.GetPhysicalPath(file.File));

Expand Down
1 change: 1 addition & 0 deletions src/Docfx.Dotnet/Docfx.Dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" />
<PackageReference Include="ICSharpCode.Decompiler" />
<PackageReference Include="IgnoresAccessChecksToGenerator" PrivateAssets="All" />
<PackageReference Include="OneOf" />
Expand Down