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 VelocityEngine instances configured with StringResourceLoader so that templates can be supplied programmatically at runtime.
Base
Common base class for all templates. Wraps a VelocityContext and provides render and renderToStringList methods.
PublicationTemplate
Generates LaTeX source for a full publication (book, paper, thesis, etc.) using the publication.vm template.
PresentationTemplate
Generates LaTeX Beamer source for a presentation using the presentation.vm template.
MetapostTemplate
Generates MetaPost source for a figure using the metapost.vm template.
GNUPlotTemplate
Generates GNUPlot source for a chart using the gnuplot.vm template.

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: