Browse Source
Merge pull request #23804 from abpframework/TocHeading-class
Refactor TocHeading and TocItem from records to classes
pull/23811/head
Engincan VESKE
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
27 additions and
2 deletions
-
modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/TableOfContents/TocHeading.cs
|
|
|
@ -2,6 +2,31 @@ |
|
|
|
|
|
|
|
namespace Volo.Docs.TableOfContents; |
|
|
|
|
|
|
|
public record TocHeading(int Level, string Text, string Id); |
|
|
|
public class TocHeading |
|
|
|
{ |
|
|
|
public int Level { get; set; } |
|
|
|
|
|
|
|
public record TocItem(TocHeading Heading, List<TocItem> Children); |
|
|
|
public string Text { get; set; } |
|
|
|
|
|
|
|
public string Id { get; set; } |
|
|
|
|
|
|
|
public TocHeading(int level, string text, string id) |
|
|
|
{ |
|
|
|
Level = level; |
|
|
|
Text = text; |
|
|
|
Id = id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class TocItem |
|
|
|
{ |
|
|
|
public TocHeading Heading { get; set; } |
|
|
|
|
|
|
|
public List<TocItem> Children { get; set; } |
|
|
|
|
|
|
|
public TocItem(TocHeading heading, List<TocItem> children) |
|
|
|
{ |
|
|
|
Heading = heading; |
|
|
|
Children = children; |
|
|
|
} |
|
|
|
} |