Package atessera.templ
package atessera.templ
Provides template-based source code generation using Apache Velocity.
This package transforms structured document descriptions (from
atessera.json) into source files for external tools such as
LaTeX, MetaPost, and GNUPlot. Each template class corresponds to a
specific Velocity template (a .vm file) and exposes a fluent API
for populating the template context.
Key classes
EngineFactory- Creates and caches
VelocityEngineinstances configured withStringResourceLoaderso that templates can be supplied programmatically at runtime. Base- Common base class for all templates. Wraps a
VelocityContextand providesrenderandrenderToStringListmethods. PublicationTemplate- Generates LaTeX source for a full publication (book, paper, thesis,
etc.) using the
publication.vmtemplate. PresentationTemplate- Generates LaTeX Beamer source for a presentation using the
presentation.vmtemplate. MetapostTemplate- Generates MetaPost source for a figure using the
metapost.vmtemplate. GNUPlotTemplate- Generates GNUPlot source for a chart using the
gnuplot.vmtemplate.
Typical usage
// Prepare templates (normally loaded once)
Map<String, List<String>> templates = Map.of(
"publication.vm", List.of("... template content ...")
);
EngineFactory factory = new EngineFactory(templates);
// Generate a publication
PublicationTemplate publ = new PublicationTemplate(factory);
publ.setHeader(content);
publ.setSections(sections);
List<String> latexSource = publ.renderToStringList();
- See Also:
-
atessera.compatessera.jsonVelocityEngine
-
ClassDescriptionFactory for creating and caching Apache Velocity engines configured with in-memory template storage.Velocity template for generating GNUPlot chart source.Velocity template for generating MetaPost figure source.Velocity template for generating LaTeX Beamer source of a presentation.Represents a single frame (slide) within a presentation.Enumerates the possible frame types.Velocity template for generating LaTeX source of a complete publication.Represents a section within a publication.Enumerates the possible section types.