Class MDFXUtil.Chapter

java.lang.Object
one.jpro.platform.mdfx.MDFXUtil.Chapter
Enclosing class:
MDFXUtil

public static class MDFXUtil.Chapter extends Object
Represents a top-level Chapter with an index, a heading, and optional subchapters.
  • Constructor Details

    • Chapter

      public Chapter(int index, String headingText)
  • Method Details

    • addSubchapter

      public void addSubchapter(String headingText)
      Call this when encountering a level-2 heading.
    • appendContentToCurrentSubchapterOrChapter

      public void appendContentToCurrentSubchapterOrChapter(String content)
      Append non-heading text to the current subchapter (if present) or to the chapter content otherwise.
    • getIndex

      public int getIndex()
      Returns the integer index for this chapter.
    • getFullMD

      public String getFullMD()
      Returns the full Markdown for this chapter, including the # heading line plus all content.
    • getContent

      public String getContent()
      Returns the content of this chapter (excluding the # heading line, but *including* subchapters). If you want to exclude the subchapters in the content, you can do so by adjusting the logic.
    • getHeadingText

      public String getHeadingText()
      Returns the plain text for the chapter’s heading (no # prefix).
    • getSubchapters

      public List<MDFXUtil.Subchapter> getSubchapters()