Interface IMarkdownDecorator

  • All Known Implementing Classes:
    MarkdownDefaultDecorator

    public interface IMarkdownDecorator
    Decorator interface.
    Author:
    René Jeschke <rene_jeschke@yahoo.de>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void appendHorizontalRuler​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a horizontal ruler is encountered.
      HCImg appendImage​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an image is opened.
      void closeBlockquote​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a blockquote is closed.
      void closeCodeBlock​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a code block is closed.
      void closeCodeSpan​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a code span is closed.
      void closeEmphasis​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an emphasis span is closed.
      void closeHeadline​(com.helger.html.markdown.MarkdownHCStack out, int level)
      Called when a headline is closed.
      void closeLink​(com.helger.html.markdown.MarkdownHCStack out)  
      void closeListItem​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a list item is closed.
      void closeOrderedList​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an ordered list is closed.
      void closeParagraph​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a paragraph is closed.
      void closeStrike​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a strike span is closed.
      void closeStrong​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a strong span is closed.
      void closeSuper​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a superscript span is closed.
      void closeUnorderedList​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an unordered list is closed.
      void openBlockquote​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a blockquote is opened.
      void openCodeBlock​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a code block is opened.
      HCCode openCodeSpan​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a code span is opened.
      void openEmphasis​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an emphasis span is opened.
      IHCElementWithChildren<?> openHeadline​(com.helger.html.markdown.MarkdownHCStack out, int level)
      Called when a headline is opened.
      HCA openLink​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a link is opened.
      HCLI openListItem​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a list item is opened.
      void openOrderedList​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an ordered list is opened.
      void openParagraph​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a paragraph is opened.
      void openStrike​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a strike span is opened.
      void openStrong​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a strong span is opened.
      void openSuper​(com.helger.html.markdown.MarkdownHCStack out)
      Called when a superscript span is opened.
      void openUnorderedList​(com.helger.html.markdown.MarkdownHCStack out)
      Called when an unordered list is opened.
    • Method Detail

      • openParagraph

        void openParagraph​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out)
        Called when a paragraph is opened.

        Default implementation is:

         out.append("<p>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeParagraph

        void closeParagraph​(@Nonnull
                            com.helger.html.markdown.MarkdownHCStack out)
        Called when a paragraph is closed.

        Default implementation is:

         out.append("</p>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openBlockquote

        void openBlockquote​(@Nonnull
                            com.helger.html.markdown.MarkdownHCStack out)
        Called when a blockquote is opened. Default implementation is:
         out.append("<blockquote>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeBlockquote

        void closeBlockquote​(@Nonnull
                             com.helger.html.markdown.MarkdownHCStack out)
        Called when a blockquote is closed.

        Default implementation is:

         out.append("</blockquote>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openCodeBlock

        void openCodeBlock​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out)
        Called when a code block is opened.

        Default implementation is:

         out.append("<pre><code>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeCodeBlock

        void closeCodeBlock​(@Nonnull
                            com.helger.html.markdown.MarkdownHCStack out)
        Called when a code block is closed.

        Default implementation is:

         out.append("</code></pre>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openCodeSpan

        HCCode openCodeSpan​(@Nonnull
                            com.helger.html.markdown.MarkdownHCStack out)
        Called when a code span is opened.

        Default implementation is:

         out.append("<code>");
         
        Parameters:
        out - The StringBuilder to write to.
        Returns:
        code element
      • closeCodeSpan

        void closeCodeSpan​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out)
        Called when a code span is closed.

        Default implementation is:

         out.append("</code>");
         
        Parameters:
        out - The StringBuilder to write to.
      • openHeadline

        @Nonnull
        IHCElementWithChildren<?> openHeadline​(@Nonnull
                                               com.helger.html.markdown.MarkdownHCStack out,
                                               int level)
        Called when a headline is opened.

        Note: Don't close the HTML tag!

        Default implementation is:

          out.append("<h");
         out.append(level);
         
        Parameters:
        out - The StringBuilder to write to.
        level - Headline level
        Returns:
        Headline element
      • closeHeadline

        void closeHeadline​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out,
                           int level)
        Called when a headline is closed.

        Default implementation is:

          out.append("</h");
         out.append(level);
         out.append(">\n");
         
        Parameters:
        out - The StringBuilder to write to.
        level - Headline level
      • openStrong

        void openStrong​(@Nonnull
                        com.helger.html.markdown.MarkdownHCStack out)
        Called when a strong span is opened.

        Default implementation is:

         out.append("<strong>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeStrong

        void closeStrong​(@Nonnull
                         com.helger.html.markdown.MarkdownHCStack out)
        Called when a strong span is closed.

        Default implementation is:

         out.append("</strong>");
         
        Parameters:
        out - The StringBuilder to write to.
      • openStrike

        void openStrike​(@Nonnull
                        com.helger.html.markdown.MarkdownHCStack out)
        Called when a strike span is opened.

        Default implementation is:

         out.append("<s>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeStrike

        void closeStrike​(@Nonnull
                         com.helger.html.markdown.MarkdownHCStack out)
        Called when a strike span is closed.

        Default implementation is:

         out.append("</s>");
         
        Parameters:
        out - The StringBuilder to write to.
      • openEmphasis

        void openEmphasis​(@Nonnull
                          com.helger.html.markdown.MarkdownHCStack out)
        Called when an emphasis span is opened.

        Default implementation is:

         out.append("<em>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeEmphasis

        void closeEmphasis​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out)
        Called when an emphasis span is closed.

        Default implementation is:

         out.append("</em>");
         
        Parameters:
        out - The StringBuilder to write to.
      • openSuper

        void openSuper​(@Nonnull
                       com.helger.html.markdown.MarkdownHCStack out)
        Called when a superscript span is opened.

        Default implementation is:

         out.append("<sup>");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeSuper

        void closeSuper​(@Nonnull
                        com.helger.html.markdown.MarkdownHCStack out)
        Called when a superscript span is closed.

        Default implementation is:

         out.append("</sup>");
         
        Parameters:
        out - The StringBuilder to write to.
      • openOrderedList

        void openOrderedList​(@Nonnull
                             com.helger.html.markdown.MarkdownHCStack out)
        Called when an ordered list is opened.

        Default implementation is:

         out.append("<ol>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeOrderedList

        void closeOrderedList​(@Nonnull
                              com.helger.html.markdown.MarkdownHCStack out)
        Called when an ordered list is closed.

        Default implementation is:

         out.append("</ol>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openUnorderedList

        void openUnorderedList​(@Nonnull
                               com.helger.html.markdown.MarkdownHCStack out)
        Called when an unordered list is opened.

        Default implementation is:

         out.append("<ul>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • closeUnorderedList

        void closeUnorderedList​(@Nonnull
                                com.helger.html.markdown.MarkdownHCStack out)
        Called when an unordered list is closed.

        Default implementation is:

         out.append("</ul>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openListItem

        @Nonnull
        HCLI openListItem​(@Nonnull
                          com.helger.html.markdown.MarkdownHCStack out)
        Called when a list item is opened.

        Note: Don't close the HTML tag!

        Default implementation is:

         out.append("<li");
         
        Parameters:
        out - The StringBuilder to write to.
        Returns:
        List item element
      • closeListItem

        void closeListItem​(@Nonnull
                           com.helger.html.markdown.MarkdownHCStack out)
        Called when a list item is closed.

        Default implementation is:

         out.append("</li>\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • appendHorizontalRuler

        void appendHorizontalRuler​(@Nonnull
                                   com.helger.html.markdown.MarkdownHCStack out)
        Called when a horizontal ruler is encountered.

        Default implementation is:

         out.append("<hr />\n");
         
        Parameters:
        out - The StringBuilder to write to.
      • openLink

        @Nonnull
        HCA openLink​(@Nonnull
                     com.helger.html.markdown.MarkdownHCStack out)
        Called when a link is opened.

        Note: Don't close the HTML tag!

        Default implementation is:

         out.append("<a");
         
        Parameters:
        out - The stack to write to.
        Returns:
        Link element
      • closeLink

        void closeLink​(@Nonnull
                       com.helger.html.markdown.MarkdownHCStack out)
      • appendImage

        @Nonnull
        HCImg appendImage​(@Nonnull
                          com.helger.html.markdown.MarkdownHCStack out)
        Called when an image is opened.

        Note: Don't close the HTML tag!

        Default implementation is:

         out.append("<img");
         
        Parameters:
        out - The StringBuilder to write to.
        Returns:
        Image element