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
Next Next commit
feat: expose type through the toc
  • Loading branch information
frarees committed Jul 8, 2024
commit efe7cbb29d409a0125dfb853256c53081f0349c2
5 changes: 5 additions & 0 deletions src/Docfx.DataContracts.Common/TocItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public class TocItemViewModel
[JsonPropertyName("order")]
public int? Order { get; set; }

[YamlMember(Alias = Constants.PropertyName.Type)]
[JsonProperty(Constants.PropertyName.Type)]
[JsonPropertyName(Constants.PropertyName.Type)]
public string Type { get; set; }

[YamlIgnore]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
Expand Down
1 change: 1 addition & 0 deletions src/Docfx.Dotnet/YamlViewModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public static TocItemViewModel ToTocItemViewModel(this MetadataItem item, string
{
Uid = item.Name,
Name = item.DisplayNames.GetLanguageProperty(SyntaxLanguage.Default),
Type = item.Type.ToString(),
};

if (item.Type is MemberType.Namespace)
Expand Down