Class HeadingAnchorExtension
- java.lang.Object
-
- org.commonmark.ext.heading.anchor.HeadingAnchorExtension
-
- All Implemented Interfaces:
org.commonmark.Extension,org.commonmark.renderer.html.HtmlRenderer.HtmlRendererExtension
public class HeadingAnchorExtension extends java.lang.Object implements org.commonmark.renderer.html.HtmlRenderer.HtmlRendererExtensionExtension for adding auto generated IDs to headings.Create it with
create()orbuilder()and then configure it on the renderer builder (HtmlRenderer.Builder.extensions(Iterable)).The heading text will be used to create the id. Multiple headings with the same text will result in appending a hyphen and number. For example:
will result in# Heading # Heading<h1 id="heading">Heading</h1> <h1 id="heading-1">Heading</h1>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHeadingAnchorExtension.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HeadingAnchorExtension.Builderbuilder()static org.commonmark.Extensioncreate()voidextend(org.commonmark.renderer.html.HtmlRenderer.Builder rendererBuilder)
-
-
-
Method Detail
-
create
public static org.commonmark.Extension create()
- Returns:
- the extension built with default settings
-
builder
public static HeadingAnchorExtension.Builder builder()
- Returns:
- a builder to configure the extension settings
-
extend
public void extend(org.commonmark.renderer.html.HtmlRenderer.Builder rendererBuilder)
- Specified by:
extendin interfaceorg.commonmark.renderer.html.HtmlRenderer.HtmlRendererExtension
-
-