Mercurial > projects > dil
diff src/docgen/page/latexwriter.d @ 806:bcb74c9b895c
Moved out files in the trunk folder to the root.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 09 Mar 2008 00:12:19 +0100 |
parents | trunk/src/docgen/page/latexwriter.d@db7e27b5c180 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/docgen/page/latexwriter.d Sun Mar 09 00:12:19 2008 +0100 @@ -0,0 +1,39 @@ +/** + * Author: Jari-Matti Mäkelä + * License: GPL3 + */ +module docgen.page.latexwriter; + +import docgen.page.writer; +import tango.io.FileConduit : FileConduit; + +/** + * Writes a LaTeX document skeleton. + */ +class LaTeXWriter : AbstractPageWriter!("latex", 1) { + this(PageWriterFactory factory, OutputStream[] outputs) { + super(factory, outputs); + } + + void generateFirstPage() { + print.format( + getTemplate("firstpage"), + factory.options.templates.paperSize, + factory.options.templates.title, + factory.options.templates.versionString, + docgen_version, + timeNow(), + factory.options.listing.literateStyle ? "" : "%" + ); + } + + void addList(char[][] contents, bool ordered) { + foreach(item; contents) { + switch(item) { + case "(": print(ordered ? "\\begin{enumerate}" : "\\begin{itemize}"); continue; + case ")": print(ordered ? "\\end{enumerate}" : "\\end{itemize}"); continue; + default: print("\\item")(item)(\n); + } + } + } +}