Klasse FlexmarkProcessor

java.lang.Object
org.jdrupes.mdoclet.processors.FlexmarkProcessor
Alle implementierten Schnittstellen:
OptionChecker, MarkdownProcessor

public class FlexmarkProcessor extends Object implements MarkdownProcessor
This class provides an adapter for the flexmark-java Markdown processor.

The adapter supports the following flags:

--parser-profile
Sets one of the profiles defined in com.vladsch.flexmark.parser.ParserEmulationProfile. The name of the profle is the lower case name of the enum value. At the time of this writing supported names are:
  • commonmark (default)
  • fixed_indent
  • kramdown
  • markdown
  • github_doc
  • multi_markdown
  • pegdown
--clear-extensions
Clears the list of extensions. The following extensions are predefined:
--extension <name>
Adds the flexmark extension with the given name to the list of extensions. If the name contains a dot, it is assumed to be a fully qualified class name. Else, it is expanded using the naming pattern used by flexmark.

The parser also supports disabling the automatic highlight feature.


  1. If you use this extension, you’ll most likely want to supply a modified style sheet because the standard stylesheet assumes all definition lists to be parameter defintion lists and formats them accordingly.

    Here are the changes made for this documentation:

    /* [MOD] */
    /* .contentContainer .description dl dd, */ .contentContainer .details dl dt, ...
        font-size:12px;
        font-weight:bold;
        margin:10px 0 0 0;
        color:#4E4E4E;
    }
    /* [MOD] Added */
    dl dt {
        margin:10px 0 0 0;
    }
    
    /* [MOD] */
    /* .contentContainer .description dl dd, */ .contentContainer .details dl dd, ...
        margin:5px 0 10px 0px;
        font-size:14px;
        font-family:'DejaVu Sans Mono',monospace;
    }
    
  • Konstruktordetails

  • Methodendetails

    • isSupportedOption

      public int isSupportedOption(String option)
      Angegeben von:
      isSupportedOption in Schnittstelle OptionChecker
    • start

      public void start(String[] options)
      Beschreibung aus Schnittstelle kopiert: MarkdownProcessor
      Starts the processor with the given options.

      All processors should support the special option _disable-auto-highlight_. The doclet maps its option -disable-auto-highlight to this special processor option because disabling the auto highlight feature is usually implemented by configuring the processors HTML renderer in some way.

      Angegeben von:
      start in Schnittstelle MarkdownProcessor
      Parameter:
      options - an array of options
    • toHtml

      public String toHtml(String markdown)
      Beschreibung aus Schnittstelle kopiert: MarkdownProcessor
      Converts the given markdown text to HTML.
      Angegeben von:
      toHtml in Schnittstelle MarkdownProcessor
      Parameter:
      markdown - the markdown text
      Gibt zurück:
      the HTML
    • toHtmlFragment

      public String toHtmlFragment(String markdown)
      Beschreibung aus Schnittstelle kopiert: MarkdownProcessor
      Converts the given markdown snippet to HTML.

      If the text does not start with an HTML tag, the markdown processor will most likely surround it with an additional block tag such as a paragraph tag. This method should return a result where any additional tag is removed.

      Angegeben von:
      toHtmlFragment in Schnittstelle MarkdownProcessor
      Parameter:
      markdown - the markdown text
      Gibt zurück:
      the HTML