-
Notifications
You must be signed in to change notification settings - Fork 5
Markdown2Pdf.Options.TableOfContentsOptions
Namespace: Markdown2Pdf.Options
Assembly: Markdown2Pdf.dll
Options to create a Table of Contents for the PDF, generated from all headers.
The TOC will be inserted into all [TOC], [[TOC]] or <!-- toc --> comments within the markdown document.
Example Markdown document with a TOC:
# My Document
[TOC]
...options.TableOfContents = new TableOfContentsOptions {
ListStyle = ListStyle.Decimal,
// Include all heading levels from 2 to 4.
MinDepthLevel = 2,
MaxDepthLevel = 4
};<!-- omit from toc -->:
## This header won't be displayed in the TOC <!-- omit from toc -->public class TableOfContentsOptionsobject ← TableOfContentsOptions
object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object, object), object.ToString()
The TOC gets generated within a <nav class="table-of-contents">. This can be used to apply extra custom styles.
Determines if the TOC links should have the default link color (instead of looking like normal text). Default: false.
public bool HasColoredLinks { get; set; }Decides which characters to use before the TOC items.
public ListStyle ListStyle { get; set; }The maximum level of heading depth to include in the TOC
(e.g. 3 will include headings less than or equal to <h3>).
Range: 1 to 6.
Default: 6.
public int MaxDepthLevel { get; set; }The minimum level of heading depth to include in the TOC
(e.g. 1 will only include headings greater than or equal to <h1>).
Range: 1 to 6.
Default: 1.
public int MinDepthLevel { get; set; }If set, the TOC will be generated with page numbers. Default: null.
public PageNumberOptions? PageNumberOptions { get; set; }This causes the PDF to be generated twice to calculate the page numbers.