Class PresentationParser


public final class PresentationParser extends TextStateParser<PresentationContent>
Parses Alpha Tessera presentation files into PresentationContent.

A presentation file consists of optional global headers followed by a sequence of frames. Each frame is delimited by FRAME BEGIN and FRAME END markers and may contain optional metadata lines followed by source content.

File format example


 TITLE EN My Presentation
 SUBTITLE An Optional Subtitle
 AUTHORS John Doe, Jane Roe
 DATE 2025-01-15
 THEME default

 FRAME BEGIN MARKDOWN
 TITLE First Slide
 SUBTITLE Introduction
 LABEL intro
 ## Hello World
 This is the slide body.
 FRAME END

 FRAME BEGIN LATEX
 TITLE LaTeX Slide
 \section{Introduction}
 \begin{itemize}
   \item Point one
 \end{itemize}
 FRAME END
 

Global headers

Global headers must appear before the first FRAME BEGIN line. Each header occupies a single line and starts with a keyword:
  • TITLE <lang> <text> — presentation title; <lang> is a two-letter uppercase language code (e.g. EN, RU)
  • SUBTITLE <text> — presentation subtitle
  • AUTHORS <text> — comma-separated list of authors
  • DATE <text> — date string
  • THEME <text> — theme name
All global headers are optional. Empty lines between headers are ignored.

Frame syntax

Each frame starts with FRAME BEGIN [type] and ends with FRAME END. The optional type is a case-insensitive name matching one of the PresentationContent.FrameType enum constants (e.g. MARKDOWN, LATEX, METAPOST, GNUPLOT, PLANTUML, LISTING, EQUATION, GRAPHVIZ_DOT, etc.). If the type is omitted or unrecognised, MARKDOWN is used by default.

Within a frame, optional metadata lines may appear before any source content. Metadata lines are recognised by their keyword prefix:

  • TITLE <text> — frame title
  • SUBTITLE <text> — frame subtitle
  • LABEL <text> — cross-reference label
  • LISTING_LANG <text> — programming language for listing frames
The first line inside a frame that does not match any metadata keyword ends the metadata section. That line and all subsequent lines until FRAME END form the frame's source content. Empty lines before the first metadata or source line are skipped.

Frame-level metadata keys are the same strings as some global header keys (TITLE, SUBTITLE), but they are interpreted in their respective context and do not conflict.

Usage


 var content = PresentationParser.parse(lines);
 
See Also:
  • Constructor Details

    • PresentationParser

      public PresentationParser()
      Creates a new presentation parser with all header and state-boundary matchers configured.
  • Method Details