Mercurial > projects > dil
diff trunk/src/docgen/misc/options.d @ 717:cb8edb09108a
Updated docgen (mostly) to new tango.
Reflective options.
Updated translations.
author | Jari-Matti M?kel? <jmjm@iki.fi> |
---|---|
date | Fri, 01 Feb 2008 15:05:56 +0200 |
parents | 381044a3feac |
children |
line wrap: on
line diff
--- a/trunk/src/docgen/misc/options.d Thu Jan 31 21:31:47 2008 +0100 +++ b/trunk/src/docgen/misc/options.d Fri Feb 01 15:05:56 2008 +0200 @@ -4,13 +4,15 @@ */ module docgen.misc.options; +import docgen.misc.meta; + +/** creates reflective enums, syntax: enum name + list of elements */ +template optionEnum(char[] name, T...) { + const optionEnum = createEnum!("_" ~ name, name, "__" ~ name, "___" ~ name, T); +} + /** Supported document output formats. */ -enum DocFormat { - LaTeX, - XML, - HTML, - PlainText -} +mixin(optionEnum!("DocFormat", "LaTeX", "XML", "HTML", "PlainText")); /** * Supported comment formats. @@ -18,28 +20,16 @@ * http://www.stack.nl/~dimitri/doxygen/docblocks.html * http://www.digitalmars.com/d/ddoc.html */ -enum CommentFormat { - Ddoc, - Doxygen -} +mixin(optionEnum!("CommentFormat", "Ddoc", "Doxygen")); /** Supported image formats. */ -enum ImageFormat { - PNG, - SVG, - GIF, - PDF -} +mixin(optionEnum!("ImageFormat", "PNG", "SVG", "GIF", "PDF")); /** Image format extensions. */ const imageFormatExts = [ "png", "svg", "gif", "pdf" ]; /** Supported graph writers. */ -enum GraphFormat { - Dot, - ModuleNames, - ModulePaths -} +mixin(optionEnum!("GraphFormat", "Dot", "ModuleNames", "ModulePaths")); struct GraphOptions { /// image format to use for graphs @@ -113,7 +103,7 @@ /// list of document formats to be generated DocFormat[] outputFormats; - + GraphOptions graph; ListingOptions listing; TemplateOptions templates;