Leisn.MarkdigToc.Signed
0.1.3
dotnet add package Leisn.MarkdigToc.Signed --version 0.1.3
NuGet\Install-Package Leisn.MarkdigToc.Signed -Version 0.1.3
<PackageReference Include="Leisn.MarkdigToc.Signed" Version="0.1.3" />
<PackageVersion Include="Leisn.MarkdigToc.Signed" Version="0.1.3" />
<PackageReference Include="Leisn.MarkdigToc.Signed" />
paket add Leisn.MarkdigToc.Signed --version 0.1.3
#r "nuget: Leisn.MarkdigToc.Signed, 0.1.3"
#:package Leisn.MarkdigToc.Signed@0.1.3
#addin nuget:?package=Leisn.MarkdigToc.Signed&version=0.1.3
#tool nuget:?package=Leisn.MarkdigToc.Signed&version=0.1.3
MarkdigToc

MarkdigToc is a extension for Markdig to generate table of content by parse [toc] in markdown document.
Currently just for render to html.
Usage
Use with default options:
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions() // Add most of all advanced extensions
.UseTableOfContent() //Add MarkdigToc extension
.Build();
var result=Markdown.ToHtml(@"
[TOC]
# t1
## t1.1
### t1.1.1
### t1.1.2
## t1.2
");
Console.WriteLine(result);
Use with custom options:
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions()
.UseTableOfContent(
tocAction: opt=>{ // toc options },
idAction: opt=>{ // auto id options }
).Build();
// ...
Options
CustomAutoIdOptions
Code copied from AutoIdentifierExtension, then added some code and options.
NOTICE: When use
UseTableOfContent, it will auto replace (AutoIdentifierExtension) or add (CustomAutoIdExtension).
AutoIdentifierOptionsOptions:Enum: default AutoIdentifierOptions.DefaultOption from
AutoIdentifierExtension:- None
- AutoLink
- AllowOnlyAscii
- Default
- Github
GenerateHeadingId?HeadingIdGenerator:Delegate: defalut nullDelegate for handle custom heading id creation.
Arguments:
level:
intThe level of current heading, usually be count of char #.
content:
stringThe content of current heading.
id:
string?Not null if already defined id in markdown strings.
e.g. title-id for
# title {#title-id}NOTICE: In order to parse attributes, need
UseGenericAttributesextension after all of other extensions which you want parse.
TocOptions
Specials
IsUlOnlyContainLi:bool: default trueAccording to webhint ,
ulandolmust only directly containli,scriptortemplateelements.Set false to mix
ulandlilike others do (generate less code).TitleAsConainerHeader:bool: default falsePut the tile in
ContainerTagnot inside theTocTagNOTICE: working only
ContainerTagis not null.
TOC Container
ContainerTag:string? : default nullIf this is not null, the toc will put in a element use
ContainerTag.ContainerId:string? : default nullId attribute for
ContainerTag.ContainerClass:string? : default nullClass attribute for
ContainerTag. e.g."class1 class2"
TOC Element
TocTag:string : default navTag name for toc element.
TocId:string? : default nullId attribute for
TocTag.TocClass:string? : default nullClass attribute for
TocTag. e.g."class1 class2"
TOC Title
NOTICE: I also parse toc title and use it's attributes from markdown document , but that is not a regular syntax, you should know that.
OverrideTitle:string? : default nullOverride toc title , ignore defined in markdown document.
TitleTag:string : default pTag name for toc title element.
TitleId:string? : default nullId attribute for
TitleTag.TitleClass:string? : default nullClass attribute for
TitleTag. e.g."class1 class2"
TOC Items
ulClass:string? : default pClass attribute for
ulelement.liClass:string? : default nullClass attribute for
lielement.aClass:string? : default nullClass attribute for
aelement.
Others
Markdown document:
[TOC]
##### t5
#### t4
### t3
## t2
# t1
## t2
### t3
#### t4
##### t5
IsUlOnlyContainLi=true :
●
○
■
■
■ t5
■ t4
■ t3
○ t2
● t1
○ t2
■ t3
■ t4
■ t5
IsUlOnlyContainLi=false :
■ t5
■ t4
■ t3
○ t2
● t1
○ t2
■ t3
■ t4
■ t5
Thanks
Thanks Atrejoe for signed version.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 2.1
- Markdig.Signed (>= 0.26.0)
-
.NETCoreApp 3.1
- Markdig.Signed (>= 0.26.0)
-
.NETFramework 4.5.2
- Markdig.Signed (>= 0.26.0)
-
.NETStandard 2.0
- Markdig.Signed (>= 0.26.0)
-
.NETStandard 2.1
- Markdig.Signed (>= 0.26.0)
-
net5.0
- Markdig.Signed (>= 0.26.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.3 | 6,786 | 1/5/2022 |
v0.1.3: Thanks Atrejoe for signed version