diff options
| author | Mike Wey | 2011-09-11 21:25:45 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-09-11 21:25:45 +0200 |
| commit | 914411d8ab004e1c67b9307a3d94cb3fc132d763 (patch) | |
| tree | 0da6b9d1080f1c297a8931dc9cf754d2d444c07c | |
| parent | 42fe831756124e1cc386cd9f4fda55a902c8fc47 (diff) | |
Improve the generated documentation.
| -rw-r--r-- | GNUmakefile | 4 | ||||
| -rw-r--r-- | dmagick/Image.d | 49 | ||||
| -rw-r--r-- | docs/dmagick.ddoc | 92 | ||||
| -rw-r--r-- | docs/style.css | 210 |
4 files changed, 325 insertions, 30 deletions
diff --git a/GNUmakefile b/GNUmakefile index 01e6910..f61d3cb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -93,7 +93,7 @@ docs: $(DOCS_DMAGICK) ####################################################################### docs/%.html : dmagick/%.d - $(DC) $(DCFLAGS) $< $(DDOCFLAGS) + $(DC) $(DCFLAGS) docs/dmagick.ddoc $< $(DDOCFLAGS) ####################################################################### @@ -108,4 +108,4 @@ uninstall: rm -f $(DESTDIR)$(prefix)/lib/$(LIBNAME_DMAGICK) clean: - -rm -rf $(LIBNAME_DMAGICK) $(OBJECTS_DMAGICK) unittest.o unittest docs + -rm -rf $(LIBNAME_DMAGICK) $(OBJECTS_DMAGICK) $(DOCS_DMAGICK) docs/c unittest.o unittest diff --git a/dmagick/Image.d b/dmagick/Image.d index e212d83..effc7e7 100644 --- a/dmagick/Image.d +++ b/dmagick/Image.d @@ -2,15 +2,6 @@ * Copyright: Mike Wey 2011 * License: zlib (See accompanying LICENSE file) * Authors: Mike Wey - * - * Macros: - * TABLE=<table>$0</table> - * - * TH=<th>$1</th>$(TH $+) - * HEADERS=<tr>$(TH $1, $+)</tr> - * - * TD=<td>$1</td>$(TD $+) - * ROW=<tr>$(TD $1, $+)</tr> */ module dmagick.Image; @@ -146,16 +137,16 @@ class Image * Constructs an image from an array of pixels. * * Params: - * width = The number of columns in the image. - * height = The number of rows in the image. - * map = A string describing the expected ordering - * of the pixel array. It can be any combination - * or order of R = red, G = green, B = blue, A = alpha - * , C = cyan, Y = yellow, M = magenta, K = black, - * or I = intensity (for grayscale). - * storage = The pixel Staroage type (CharPixel, - * ShortPixel, IntegerPixel, FloatPixel, or DoublePixel). - * pixels = The pixel data. + * columns = The number of columns in the image. + * rows = The number of rows in the image. + * map = A string describing the expected ordering + * of the pixel array. It can be any combination + * or order of R = red, G = green, B = blue, A = alpha + * , C = cyan, Y = yellow, M = magenta, K = black, + * or I = intensity (for grayscale). + * storage = The pixel Staroage type (CharPixel, + * ShortPixel, IntegerPixel, FloatPixel, or DoublePixel). + * pixels = The pixel data. */ this(size_t columns, size_t rows, string map, StorageType storage, void[] pixels) { @@ -170,14 +161,16 @@ class Image /** * Constructs a description of the image as a string. * The string contains some or all of the following fields: - * $(B filename) The current filename. $(BR) - * $(B [scene]) The scene number, if the image is part of a secuence. $(BR) - * $(B format) The image format. $(BR) - * $(B width x height) $(BR) - * $(B page width x height + xOffset + yOffset) $(BR) - * $(B classType) DirectClass or PseudoClass $(BR) - * $(B N-bit) bit depth. $(BR) - * $(B blob size) if present. + * $(LIST + * $(B filename) The current filename., + * $(B [scene]) The scene number if the image is part of a secuence., + * $(B format) The image format., + * $(B width x height), + * $(B page width x height + xOffset + yOffset), + * $(B classType) DirectClass or PseudoClass, + * $(B N-bit) bit depth., + * $(B blob size) if present. + * ) */ string toString() { @@ -3803,7 +3796,7 @@ class Image * will periodically call the monitor with arguments indicating the * progress of the method. * - * The delegate receves the folowing params: $(BR) + * The delegate receves the folowing $(B parameters): $(BR) * $(TABLE * $(ROW string $(I methodName), The name of the monitored method.) * $(ROW long $(I offset ), A number between 0 and extent that diff --git a/docs/dmagick.ddoc b/docs/dmagick.ddoc new file mode 100644 index 0000000..3df4723 --- /dev/null +++ b/docs/dmagick.ddoc @@ -0,0 +1,92 @@ +DDOC = +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <META http-equiv="content-type" content="text/html; charset=utf-8"> + <title>$(TITLE)</title> + <link rel="stylesheet" type="text/css" href="style.css"> + </head> + <body> + <div id="header"><!-- LOGO --></div> + <div id="navigation">$(NAVIGATION)</div> + + <div id="content"> + <span id="lastupdate">Last update $(DATETIME)</span> + + <h1>$(TITLE)</h1> + + $(BODY) + </div> + + <div id="copyright"> + Page generated by + $(LINK2 http://www.digitalmars.com/d/2.0/ddoc.html, Ddoc). + Copyright © $(COPYRIGHT) + </div> + </body> +</html> + +NAVIGATION = +<h2>dmagick</h2><br> + +$(LIST + $(LINK2 Color.html, dmagick.Color), + $(LINK2 ColorCMYK.html, dmagick.ColorCMYK), + $(LINK2 ColorGray.html, dmagick.ColorGray), + $(LINK2 ColorHSL.html, dmagick.ColorHSL), + $(LINK2 ColorRGB.html, dmagick.ColorRGB), + $(LINK2 ColorYUV.html, dmagick.ColorYUV), + $(LINK2 DrawingContext.html, dmagick.DrawingContext), + $(LINK2 Exception.html, dmagick.Exception), + $(LINK2 Geometry.html, dmagick.Geometry), + $(LINK2 Image.html, dmagick.Image), + $(LINK2 ImageView.html, dmagick.ImageView), + $(LINK2 Options.html, dmagick.Options), + $(LINK2 Utils.html, dmagick.Utils) +) + +DDOC_SUMMARY = $(P $0) +DDOC_DESCRIPTION = $(P $0) +DDOC_AUTHORS = $(P $(B Authors:)$(BR)$0) +DDOC_BUGS = $(P $(RED BUGS:)$(BR)$0) +DDOC_COPYRIGHT = $(P $(B Copyright:)$(BR)$0) +DDOC_DATE = $(P $(B Date:)$(BR)$0) +DDOC_DEPRECATED = $(P $(RED Deprecated:)$(BR)$0) +DDOC_EXAMPLES = $(P $(B Examples:)$(BR)$0) +DDOC_HISTORY = $(P $(B History:)$(BR)$0) +DDOC_LICENSE = $(P $(B License:)$(BR)$0) +DDOC_RETURNS = $(P $(B Returns:)$(BR)$0) +DDOC_SEE_ALSO = $(P $(B See Also:)$(BR)$0) +DDOC_STANDARDS = $(P $(B Standards:)$(BR)$0) +DDOC_THROWS = $(P $(B Throws:)$(BR)$0) +DDOC_VERSION = $(P $(B Version:)$(BR)$0) +DDOC_SECTION_H = $(P $(B $0)) +DDOC_SECTION = $(P $0) +DDOC_PARAMS = $(P $(B Parameters:)<table class=parms>$0</table>) + +RED = <span class="red">$0</span> +GREEN = <span class="green">$0</span> +BLUE = <span class="blue">$0</span> +YELLOW = <span class="yellow">$0</span> +BLACK = <span class="black">$0</span> +WHITE = <span class="white">$0</span> + +D_COMMENT = <span class="d_comment">$0</span> +D_STRING = <span class="d_string">$0</span> +D_KEYWORD = <span class="d_keyword">$0</span> +D_PSYMBOL = <span class="d_psymbol">$0</span> +D_PARAM = <span class="d_param">$0</span> + +D = <span class="d_inlinecode">$0</span> + +DDOC_PSYMBOL = <a name="$0"></a><span class="ddoc_psymbol">$0</span> +DDOC_DECL = <dt class="d_decl">$0</dt> + +TABLE = <table>$0</table> +TH = <th>$1</th>$(TH $+) +HEADERS = <tr>$(TH $1, $+)</tr> +TD = <td>$1</td>$(TD $+) +ROW = <tr>$(TD $1, $+)</tr> + +LIST = $(UL $(LI $1, $+)) +LI = <li>$1</li>$(LI $+) diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..21eecfc --- /dev/null +++ b/docs/style.css @@ -0,0 +1,210 @@ +body +{ + margin: 0; + padding: 0; + border: 0; + color: black; + background-color: #1f252b; + font-size: 100%; + font-family: Verdana, "Deja Vu", "Bitstream Vera Sans", sans-serif; +} + +div#header +{ + padding: 1em; +} + +div#navigation +{ + font-size: 0.875em; + float: left; + padding: 0 1.5em; +} + +div#navigation h2 +{ + font-family: Verdana, "Deja Vu", "Bitstream Vera Sans", sans-serif; + font-size: 1.35em; + color: #ccc; + margin: 0; +} + +div#navigation ul +{ + list-style-type: none; + margin: 0; + padding: 0; +} + +div#navigation li +{ + margin: 0 0 0 0.8em; + padding: 0; +} + +#navigation a +{ + display: block; + color: #ccc; + text-decoration: none; + padding: 0.1em 0; + border-bottom: 1px dotted #494949; +} + +#navigation a:hover +{ + color: #eee; +} + +#navigation a.active +{ + color: white; + border-color: white; +} + +div#content +{ + min-height: 440px; + max-width: 76em; + margin-left: 18em; + margin-right: 1.6em; + padding: 1.6em; + padding-top: 1.3em; + border: 0.6em solid #ccd5d5; + background-color: #f6f6f6; + font-size: 0.875em; + line-height: 1.4em; +} + +div#content li +{ + padding-bottom: .7ex; +} + +div#copyright +{ + clear: both; + margin-top: 2em; + padding: 1em 2em; + background-color: #303333; + color: #ccc; + font-size: 0.75em; + text-align: center; +} + +div#copyright a +{ + color: #ccc; +} + +#lastupdate +{ + float: right; + margin: -1.5em; + margin-bottom: 0; + text-align: right; + font-size: 0.8em; + font-style: italic; + color: #666; +} + +h1, h2, h3, h4, h5, h6 +{ + font-family: Georgia, "Times New Roman", Times, serif; + font-weight: normal; + color: #633; + line-height: normal; + text-align: left; +} + +h1 +{ + margin-top: 0; + font-size: 2.5em; +} + +h2 +{ + font-size: 1.7em; +} + +h3 +{ + font-size: 1.35em; +} + +h4 +{ + font-size: 1.15em; + font-style: italic; + margin-bottom: 0; +} + +pre +{ + background: white; + padding: 1ex; + margin: 1em 0 1em 3em; + font-family: monospace; + font-size: 1.2em; + line-height: normal; + border: 1px solid #ccc; + width: auto; + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + +dd +{ + padding: 1ex; + margin-left: 3em; + margin-bottom: 1em; +} + +hr +{ + margin: 2em 0; +} + +a +{ + color: #006; +} + +a:visited +{ + color: #606; +} + +.d_inlinecode +{ + font-family: monospace; + font-weight: bold; +} + +.d_decl { + font-weight: bold; + background-color: #E4E9EF; + border-bottom: solid 2px #336600; + padding: 2px 0px 2px 2px; +} + +/* Elements of D source code text */ +.d_comment { color: green; } +.d_string { color: red; } +.d_keyword { color: blue; } +.d_psymbol { text-decoration: underline; } +.d_param { font-style: italic; } + +/* Focal symbol that is being documented */ +.ddoc_psymbol { color: #336600; } + +.red { color: red; } +.green { color: green; } +.blue { color: blue; } +.yellow { color: yellow; } +.black { color: black; } +.white { color: white; } |
