Interface HtmlNodeConverterContext
-
- All Superinterfaces:
com.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>
- All Known Implementing Classes:
HtmlNodeConverterSubContext
public interface HtmlNodeConverterContext extends com.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>
The context for node rendering, including configuration and functionality for the node renderer to use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidappendOuterHtml(@NotNull org.jsoup.nodes.Node node)voiddelegateRender()@NotNull StringescapeSpecialChars(@NotNull String text)voidexcludeAttributes(String... excludes)@Nullable org.jsoup.nodes.NodegetCurrentNode()@NotNull org.jsoup.nodes.DocumentgetDocument()@NotNull HashSet<com.vladsch.flexmark.ast.Reference>getExternalReferences()com.vladsch.flexmark.util.ast.DocumentgetForDocument()HtmlConverterPhasegetFormattingPhase()@NotNull HtmlConverterOptionsgetHtmlConverterOptions()HtmlMarkdownWritergetMarkdown()@NotNull com.vladsch.flexmark.util.data.DataHoldergetOptions()Get the current rendering contextDataHolder.@Nullable com.vladsch.flexmark.ast.ReferencegetOrCreateReference(@NotNull String url, @NotNull String text, @Nullable String title)@NotNull HashMap<String,com.vladsch.flexmark.ast.Reference>getReferenceUrlToReferenceMap()@Nullable HtmlConverterStategetState()@NotNull Stack<HtmlConverterState>getStateStack()@NotNull HtmlNodeConverterContextgetSubContext()Creates a child rendering context that can be used to collect rendered html text.@NotNull HtmlNodeConverterContextgetSubContext(@Nullable com.vladsch.flexmark.util.data.DataHolder options)Creates a child rendering context that can be used to collect rendered html text.@NotNull HtmlNodeConverterContextgetSubContext(@Nullable com.vladsch.flexmark.util.data.DataHolder options, @NotNull com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder<?,?> builder)Creates a child rendering context that can be used to collect rendered html text.voidinlineCode(@NotNull Runnable inlineRunnable)booleanisInlineCode()booleanisTrace()@Nullable org.jsoup.nodes.Nodenext()@Nullable org.jsoup.nodes.Nodenext(int skip)intoutputAttributes(@NotNull com.vladsch.flexmark.util.sequence.LineAppendable out, @NotNull String initialSep)com.vladsch.flexmark.util.ast.NodeparseMarkdown(@NotNull String markdown)@Nullable org.jsoup.nodes.Nodepeek()@Nullable org.jsoup.nodes.Nodepeek(int skip)voidpopState(@Nullable com.vladsch.flexmark.util.sequence.LineAppendable out)@NotNull StringprepareText(@NotNull String text)@NotNull StringprepareText(@NotNull String text, boolean inCode)voidprocessAttributes(@NotNull org.jsoup.nodes.Node node)voidprocessConditional(@NotNull ExtensionConversion extensionConversion, @NotNull org.jsoup.nodes.Node node, @NotNull Runnable processNode)@NotNull StringprocessTextNodes(@NotNull org.jsoup.nodes.Node node)voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute)voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @NotNull CharSequence wrapText)voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable CharSequence textPrefix, @Nullable CharSequence textSuffix)voidprocessUnwrapped(@NotNull org.jsoup.nodes.Node element)voidprocessWrapped(@NotNull org.jsoup.nodes.Node node, @Nullable Boolean isBlock, boolean escapeMarkdown)voidpushState(@NotNull org.jsoup.nodes.Node parent)voidrender(@NotNull org.jsoup.nodes.Node node)Render the specified node and its children using the configured renderers.voidrenderChildren(@NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, @Nullable Runnable prePopAction)Render the children of the node, used by custom renderersvoidrenderDefault(@NotNull org.jsoup.nodes.Node node)@NotNull com.vladsch.flexmark.html.renderer.ResolvedLinkresolveLink(@NotNull com.vladsch.flexmark.html.renderer.LinkType linkType, @NotNull CharSequence url, @Nullable com.vladsch.flexmark.util.html.Attributes attributes, @Nullable Boolean urlEncode)@NotNull com.vladsch.flexmark.html.renderer.ResolvedLinkresolveLink(@NotNull com.vladsch.flexmark.html.renderer.LinkType linkType, @NotNull CharSequence url, @Nullable Boolean urlEncode)voidsetInlineCode(boolean inlineCode)voidsetTrace(boolean trace)voidskip()voidskip(int skip)voidtransferIdToParent()voidtransferToParentExcept(String... excludes)voidtransferToParentOnly(String... includes)voidwrapTextNodes(@NotNull org.jsoup.nodes.Node node, @NotNull CharSequence wrapText, boolean needSpaceAround)
-
-
-
Method Detail
-
getMarkdown
HtmlMarkdownWriter getMarkdown()
- Returns:
- the
LineAppendablewriter to use
-
delegateRender
void delegateRender()
-
getSubContext
@NotNull @NotNull HtmlNodeConverterContext getSubContext()
Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.- Specified by:
getSubContextin interfacecom.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>- Returns:
- a new rendering context with a given appendable for its output
-
getSubContext
@NotNull @NotNull HtmlNodeConverterContext getSubContext(@Nullable @Nullable com.vladsch.flexmark.util.data.DataHolder options)
Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.- Specified by:
getSubContextin interfacecom.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>- Parameters:
options- options to use for the context (only options which do not affect the context construction will be used)- Returns:
- a new rendering context with a given appendable for its output
-
getSubContext
@NotNull @NotNull HtmlNodeConverterContext getSubContext(@Nullable @Nullable com.vladsch.flexmark.util.data.DataHolder options, @NotNull @NotNull com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder<?,?> builder)
Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.- Specified by:
getSubContextin interfacecom.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>- Parameters:
options- options to use for the context (only options which do not affect the context construction will be used)builder- sequence builder to user for appended text for tracking original base offsets- Returns:
- a new rendering context with a given appendable for its output
-
render
void render(@NotNull @NotNull org.jsoup.nodes.Node node)Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.- Parameters:
node- the node to render
-
renderChildren
void renderChildren(@NotNull @NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, @Nullable @Nullable Runnable prePopAction)Render the children of the node, used by custom renderers- Parameters:
parent- node the children of which are to be renderedoutputAttributes- true if attributes should be outputprePopAction- runnable to run before popping state
-
getFormattingPhase
HtmlConverterPhase getFormattingPhase()
- Returns:
- current rendering phase
-
getOptions
@NotNull @NotNull com.vladsch.flexmark.util.data.DataHolder getOptions()
Get the current rendering contextDataHolder. These are the options passed or set on theFlexmarkHtmlConverter.builder()or passed toFlexmarkHtmlConverter.builder(DataHolder). To get the document options you should usegetDocument()as the data holder.- Specified by:
getOptionsin interfacecom.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>- Returns:
- the current renderer options
DataHolder
-
getHtmlConverterOptions
@NotNull @NotNull HtmlConverterOptions getHtmlConverterOptions()
- Returns:
- the
HtmlConverterOptionsfor the context.
-
getDocument
@NotNull @NotNull org.jsoup.nodes.Document getDocument()
- Returns:
- the
Documentnode of the current context
-
getForDocument
@Nullable com.vladsch.flexmark.util.ast.Document getForDocument()
- Returns:
- the
Documentnode of the current context
-
getState
@Nullable @Nullable HtmlConverterState getState()
-
getReferenceUrlToReferenceMap
@NotNull @NotNull HashMap<String,com.vladsch.flexmark.ast.Reference> getReferenceUrlToReferenceMap()
-
getExternalReferences
@NotNull @NotNull HashSet<com.vladsch.flexmark.ast.Reference> getExternalReferences()
-
isTrace
boolean isTrace()
-
getStateStack
@NotNull @NotNull Stack<HtmlConverterState> getStateStack()
-
setTrace
void setTrace(boolean trace)
-
parseMarkdown
@NotNull com.vladsch.flexmark.util.ast.Node parseMarkdown(@NotNull @NotNull String markdown)
-
getOrCreateReference
@Nullable @Nullable com.vladsch.flexmark.ast.Reference getOrCreateReference(@NotNull @NotNull String url, @NotNull @NotNull String text, @Nullable @Nullable String title)
-
resolveLink
@NotNull @NotNull com.vladsch.flexmark.html.renderer.ResolvedLink resolveLink(@NotNull @NotNull com.vladsch.flexmark.html.renderer.LinkType linkType, @NotNull @NotNull CharSequence url, @Nullable @Nullable Boolean urlEncode)
-
resolveLink
@NotNull @NotNull com.vladsch.flexmark.html.renderer.ResolvedLink resolveLink(@NotNull @NotNull com.vladsch.flexmark.html.renderer.LinkType linkType, @NotNull @NotNull CharSequence url, @Nullable @Nullable com.vladsch.flexmark.util.html.Attributes attributes, @Nullable @Nullable Boolean urlEncode)
-
getCurrentNode
@Nullable @Nullable org.jsoup.nodes.Node getCurrentNode()
- Specified by:
getCurrentNodein interfacecom.vladsch.flexmark.util.format.NodeContext<org.jsoup.nodes.Node,HtmlNodeConverterContext>- Returns:
- the current node being rendered
-
pushState
void pushState(@NotNull @NotNull org.jsoup.nodes.Node parent)
-
popState
void popState(@Nullable @Nullable com.vladsch.flexmark.util.sequence.LineAppendable out)
-
excludeAttributes
void excludeAttributes(String... excludes)
-
processAttributes
void processAttributes(@NotNull @NotNull org.jsoup.nodes.Node node)
-
outputAttributes
int outputAttributes(@NotNull @NotNull com.vladsch.flexmark.util.sequence.LineAppendable out, @NotNull @NotNull String initialSep)
-
transferIdToParent
void transferIdToParent()
-
transferToParentExcept
void transferToParentExcept(String... excludes)
-
transferToParentOnly
void transferToParentOnly(String... includes)
-
peek
@Nullable @Nullable org.jsoup.nodes.Node peek()
-
peek
@Nullable @Nullable org.jsoup.nodes.Node peek(int skip)
-
next
@Nullable @Nullable org.jsoup.nodes.Node next()
-
skip
void skip()
-
next
@Nullable @Nullable org.jsoup.nodes.Node next(int skip)
-
skip
void skip(int skip)
-
processUnwrapped
void processUnwrapped(@NotNull @NotNull org.jsoup.nodes.Node element)
-
processWrapped
void processWrapped(@NotNull @NotNull org.jsoup.nodes.Node node, @Nullable @Nullable Boolean isBlock, boolean escapeMarkdown)
-
processTextNodes
void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute)
-
processTextNodes
void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @NotNull @NotNull CharSequence wrapText)
-
processTextNodes
void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable @Nullable CharSequence textPrefix, @Nullable @Nullable CharSequence textSuffix)
-
wrapTextNodes
void wrapTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull CharSequence wrapText, boolean needSpaceAround)
-
processTextNodes
@NotNull @NotNull String processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node)
-
appendOuterHtml
void appendOuterHtml(@NotNull @NotNull org.jsoup.nodes.Node node)
-
isInlineCode
boolean isInlineCode()
-
setInlineCode
void setInlineCode(boolean inlineCode)
-
inlineCode
void inlineCode(@NotNull @NotNull Runnable inlineRunnable)
-
processConditional
void processConditional(@NotNull @NotNull ExtensionConversion extensionConversion, @NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull Runnable processNode)
-
renderDefault
void renderDefault(@NotNull @NotNull org.jsoup.nodes.Node node)
-
-