view trunk/src/docgen/document/latexwriter.d @ 451:3f44c38bf870

Page templates, more flexible writer interfaces, small fixes.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Wed, 24 Oct 2007 17:25:52 +0300
parents
children f658ec4a15dd
line wrap: on
line source

/**
 * Author: Jari-Matti Mäkelä
 * License: GPL3
 */
module docgen.document.latexwriter;

import docgen.document.writer;
import tango.io.FileConduit : FileConduit;
import tango.io.Print: Print;
import tango.text.convert.Layout : Layout;

/**
 * Writes a LaTeX document skeleton.
 */
class LaTeXWriter : AbstractDocumentWriter!(1, "latex") {
  this(DocumentWriterFactory factory, OutputStream[] outputs) {
    super(factory, outputs);
  }

  void generateDocument() {
    auto print = new Print!(char)(new Layout!(char), outputs[0]);
    
    print.format(
      templates["firstpage"],
      factory.options.templates.paperSize,
      factory.options.templates.title,
      factory.options.templates.versionString,
      docgen_version,
      timeNow(),
      factory.options.listings.literateStyle ? "" : "%"
    );
  }
}