- Timestamp:
- 09/18/10 21:25:26 (20 months ago)
- Location:
- trunk/docs
- Files:
-
- 2 modified
-
idldoc-reference.rst (modified) (1 diff)
-
idldoc-tutorial.rst (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/idldoc-reference.rst
r707 r710 582 582 The *rst* markup style is the default markup style for the *rst* format style. 583 583 584 The *rst* markup style attempts to make its format definition similar to what someone would do normally for readability in a text document. For example, paragraphs are created by simply skipping a line:: 585 586 ; Merges a string array into a single string separated by carriage 587 ; return/linefeeds. 588 ; 589 ; Defaults to use just linefeed on UNIX platforms and both carriage returns 590 ; and linefeeds on Windows platforms unless the UNIX or WINDOWS keywords are 591 ; set to force a particular separator. 592 593 There is other special syntax for some annotations that are common when documenting code. To place a block of code into the documentation, end a line with ``::``, skip a line, indent the block of code, and skip another line:: 594 595 ; Set the decomposed mode, if available in the current graphics device i.e. 596 ; equivalent to:: 597 ; 598 ; device, get_decomposed=oldDec 599 ; device, decomposed=dec 600 ; 601 ; The main advantage of this routine is that it can be used with any graphics 602 ; device; it will be ignored in devices which don't support it. 603 604 Another common annotation is to place a link in the documentation. For example, to link "http://michaelgalloy.com" to the phrase "my website", simply do:: 605 606 ; Check out `my website <http://michaelgalloy.com>`. 584 .. table:: rst markup style 585 586 ============== =========================================================== 587 Feature Description 588 ============== =========================================================== 589 paragraphs Paragraphs are created by simply skipping a line:: 590 591 ; Merges a string array into a single string separated by 592 ; carriage return/linefeeds. 593 ; 594 ; Defaults to use just linefeed on UNIX platforms and both 595 ; carriage returns and linefeeds on Windows platforms 596 ; unless the UNIX or WINDOWS keywords are set to force a 597 ; particular separator. 598 599 code To place a block of code into the documentation, end a line 600 with ``::``, skip a line, indent the block of code, and skip 601 another line:: 602 603 ; Set the decomposed mode, if available in the current 604 ; graphics device i.e. equivalent to:: 605 ; 606 ; device, get_decomposed=oldDec 607 ; device, decomposed=dec 608 ; 609 ; The main advantage of this routine is that it can be used 610 ; with any graphics device; it will be ignored in devices 611 ; which don't support it. 612 613 links Another common annotation is to place a link in the 614 documentation. For example, to link 615 "http://michaelgalloy.com" to the phrase "my website", simply 616 do:: 617 618 ; Check out `my website <http://michaelgalloy.com>`. 607 619 608 But often, links are to other items in the documentation. For example, the comments for a routine, might briefly mention some of its keywords and it would be convenient to link to the documentation for these keywords. In this case, just put the method names in backticks like:: 609 610 ; :Returns: 611 ; Returns a triple as a `bytarr(3)` or `bytarr(3, n)` by default if a single 612 ; color name or n color names are given. Returns a decomposed color index 613 ; as a long or lonarr(n) if `INDEX` keyword is set. 614 ; 615 ; Returns a string array for the names if `NAMES` keyword is set. 616 617 IDL will search for a name matching the quoted string and link to the closest one it finds. If the name is not found, as in ``bytarr(3)`` above, it will simply be displayed in a monospace space font as code. 618 619 Different level headers can be added to comments, particularly useful for `.idldoc` files. Just underline with ``-``, ``=``, or ``~``. For example, the following beginning to an `.idldoc` file, creates a level 1 header "TxDAP API Introduction", with a level 2 header "Basic Use" immediately after:: 620 621 TxDAP API Introduction 622 ====================== 623 624 Basic Use 625 --------- 626 627 The order of use of the underlining determines the level of the header: the first underlined header is assumed to be level 1. The second, unless it is the same as the first, is assumed to be level 2, etc. From then on, titles underlined with "=" are level 1 headers and those underlined with "-" are level 2 headers. 628 629 *Directives* provide a more general markup syntax. Currently, there are three directives defined: 630 631 #. image directive 632 #. embed directive 633 #. title directive 634 635 The "image" directive allows images to be placed into comments. To use, put the following on the end of a line:: 636 637 .. image:: filename 620 But often, links are to other items in the documentation. For 621 example, the comments for a routine, might briefly mention 622 some of its keywords and it would be convenient to link to 623 the documentation for these keywords. In this case, just put 624 the method names in backticks like:: 625 626 ; :Returns: 627 ; Returns a triple as a `bytarr(3)` or `bytarr(3, n)` by 628 ; default if a single color name or n color names are 629 ; given. Returns a decomposed color index as a long or 630 ; lonarr(n) if `INDEX` keyword is set. 631 ; 632 ; Returns a string array for the names if `NAMES` 633 ; keyword is set. 634 635 IDL will search for a name matching the quoted string and 636 link to the closest one it finds. If the name is not found, 637 as in ``bytarr(3)`` above, it will simply be displayed in a 638 monospace space font as code. 639 640 headings Different level headers can be added to comments, 641 particularly useful for `.idldoc` files. Just underline with 642 ``-``, ``=``, or ``~``. For example, the following beginning 643 to an `.idldoc` file, creates a level 1 header "TxDAP API 644 Introduction", with a level 2 header "Basic Use" immediately 645 after:: 646 647 TxDAP API Introduction 648 ====================== 649 650 Basic Use 651 --------- 652 653 The order of use of the underlining determines the level of 654 the header: the first underlined header is assumed to be 655 level 1. The second, unless it is the same as the first, is 656 assumed to be level 2, etc. From then on, titles underlined 657 with "=" are level 1 headers and those underlined with "-" 658 are level 2 headers. 659 660 images The "image" directive allows images to be placed into 661 comments. To use, put the following on the end of a line:: 662 663 .. image:: filename 638 664 639 where `filename` is any image file format read by `READ_IMAGE`. The `filename` specified will be copied into the output directory. 640 641 The "embed" directive allows `.svg` files to be embedded in the documentation. To use, put the following on the end of a line:: 642 643 .. embed:: filename 644 645 The "title" directive is available to provide a title for `.idldoc` files:: 646 647 .. title:: cpt-city color tables 665 where `filename` is any image file format read by 666 `READ_IMAGE`. The `filename` specified will be copied into 667 the output directory. 668 669 embed objects The "embed" directive allows `.svg` files to be embedded in 670 the documentation. To use, put the following on the end of a 671 line:: 672 673 .. embed:: filename 674 page title The "title" directive is available to provide a title for 675 `.idldoc` files:: 676 677 .. title:: cpt-city color tables 648 678 649 This title is used for the `.idldoc` file in the table of contents of available documentation. 679 This title is used for the `.idldoc` file in the table of 680 contents of available documentation. 681 ============== =========================================================== 650 682 651 683 -
trunk/docs/idldoc-tutorial.rst
r707 r710 74 74 The format style defines the format for comments within specially marked comment headers. Comment blocks which start with `;+` and end with `;-` are considered by IDLdoc:: 75 75 76 ;+77 ; This is a comment block.78 ;-76 ;+ 77 ; This is a comment block. 78 ;- 79 79 80 80 These comments start with a general description of the file or routine they are documenting, but the format styles define a format for adding comments about particular aspects such as individual parameters/keywords of a routine or author of a file. … … 108 108 The overview file, specified with the `OVERVIEW` keyword to IDLdoc, contains comments describing the entire directory hierarchy. It is displayed near the front of the documentation, e.g., in the HTML documentation it is shown on the first page of the output. 109 109 110 TODO: overview file tags: `Author`, `Copyright`, `History`, `Version`, `Dirs` 110 For the most part, the file is just a comment block describing the directory hierarchy, but after that it can contain `Author`, `Copyright`, `History`, `Version`, and `Dirs` tags. For example, the overview file my library starts off with:: 111 112 Personal IDL library of Michael Galloy. This is code that doesn't have 113 enough "meat" on it to be it's own package. 114 115 :Author: 116 Michael Galloy 117 118 :Dirs: 119 ./ 120 Main utility routines 121 analysis/ 122 Various algorithms (sorting, sampling, etc.) and math helper routines 123 animation/ 124 Classes to produce animations using object graphics. 125 collection/ 126 Objects implementing various types of collections. 127 111 128 112 129 … … 114 131 ~~~~~~~~~~~~~~~ 115 132 116 There are no special tags in `.idldoc` files; the entire file is just one big comment block. The one special syntax for `.idldoc` files is the `title` directive described in the markup section.117 118 NOTE: "`.idldoc` files" refers to files with an `.idldoc` extension, like `cptcity-catalog.idldoc`. Files the name`.idldoc` are directory overview files, described below.133 Special documentation files, with extension `.idldoc`, can be placed into the output. There are no special tags in `.idldoc` files; the entire file is just one big comment block. The one special syntax for `.idldoc` files is the `title` directive described in the markup section. Headings can be used in any comment block, but are particularly useful in `.idldoc`, overview, and directory overview files. 134 135 NOTE: "`.idldoc` files" refers to files with an `.idldoc` extension, like `cptcity-catalog.idldoc`. Files named `.idldoc` are directory overview files, described below. 119 136 120 137 … … 136 153 137 154 :Copyright: 138 BSD-licensed155 BSD licensed 139 156 140 157 The comments from the above directory overview file, along with a listing of the files in the directory, appear somewhere near the beginning of the documentation for the directory. In the HTML output, the link from the main overview page or the link in the lower-left navigation window when the directory has been selected in the upper-right navigation window lead to the directory overview page. … … 144 161 -------------- 145 162 163 The comment markup style defines how text can be annotated. Once the format style has defined a place for putting comments for a particular item, the markup style describes the syntax of those comments. 164 146 165 Several markup styles are available to annotate comment text with typesetting instructions. The "verbatim" and "preformatted" markup styles are the simplest, the comments are copied straight to the documentation with the "preformatted" style displaying the comments as monospaced, plain text also. The more modern "rst" markup style defines a simple syntax for annotating the comment text with links, images, or code samples. While the "verbatim" and "preformatted" markup styles can be useful for legacy code comments, the "rst" markup style is easier to read and is recommended for all new comments. 147 166 148 TODO: The comment markup style defines how text can be annotated. Once the format style has defined a place for "put comments here" for a particular item, the markup style describes the syntax of those comments. 149 150 TODO: links and inline code, rules for named links? 151 152 TODO: preformatted code blocks 153 154 TODO: image directive:: 155 156 .. image:: filename.png 157 158 File formats? 159 160 TODO: embed directive:: 167 The *rst* markup style attempts to make its format definition similar to what someone would do normally for readability in a text document. For example, paragraphs are created by simply skipping a line:: 168 169 ; Merges a string array into a single string separated by carriage 170 ; return/linefeeds. 171 ; 172 ; Defaults to use just linefeed on UNIX platforms and both carriage returns 173 ; and linefeeds on Windows platforms unless the UNIX or WINDOWS keywords are 174 ; set to force a particular separator. 175 176 There is other special syntax for some annotations that are common when documenting code. To place a block of code into the documentation, end a line with ``::``, skip a line, indent the block of code, and skip another line:: 177 178 ; Set the decomposed mode, if available in the current graphics device i.e. 179 ; equivalent to:: 180 ; 181 ; device, get_decomposed=oldDec 182 ; device, decomposed=dec 183 ; 184 ; The main advantage of this routine is that it can be used with any graphics 185 ; device; it will be ignored in devices which don't support it. 186 187 Another common annotation is to place a link in the documentation. For example, to link "http://michaelgalloy.com" to the phrase "my website", simply do:: 188 189 ; Check out `my website <http://michaelgalloy.com>`. 190 191 But often, links are to other items in the documentation. For example, the comments for a routine, might briefly mention some of its keywords and it would be convenient to link to the documentation for these keywords. In this case, just put the method names in backticks like:: 192 193 ; :Returns: 194 ; Returns a triple as a `bytarr(3)` or `bytarr(3, n)` by default if a single 195 ; color name or n color names are given. Returns a decomposed color index 196 ; as a long or lonarr(n) if `INDEX` keyword is set. 197 ; 198 ; Returns a string array for the names if `NAMES` keyword is set. 199 200 IDL will search for a name matching the quoted string and link to the closest one it finds. If the name is not found, as in ``bytarr(3)`` above, it will simply be displayed in a monospace space font as code. 201 202 Different level headers can be added to comments, particularly useful for `.idldoc` files. Just underline with ``-``, ``=``, or ``~``. For example, the following beginning to an `.idldoc` file, creates a level 1 header "TxDAP API Introduction", with a level 2 header "Basic Use" immediately after:: 203 204 TxDAP API Introduction 205 ====================== 206 207 Basic Use 208 --------- 209 210 The order of use of the underlining determines the level of the header: the first underlined header is assumed to be level 1. The second, unless it is the same as the first, is assumed to be level 2, etc. From then on, titles underlined with "=" are level 1 headers and those underlined with "-" are level 2 headers. 211 212 *Directives* provide a more general markup syntax. Currently, there are three directives defined: 213 214 #. image directive 215 #. embed directive 216 #. title directive 217 218 The "image" directive allows images to be placed into comments. To use, put the following on the end of a line:: 219 220 .. image:: filename 221 222 where `filename` is any image file format read by `READ_IMAGE`. The `filename` specified will be copied into the output directory. 223 224 The "embed" directive allows `.svg` files to be embedded in the documentation. To use, put the following on the end of a line:: 161 225 162 226 .. embed:: filename 163 164 File formats? 165 166 TODO: title of an `.idldoc` file, title directive:: 167 168 .. title:: This is the title of the file 169 170 Appears in navigation links on the left/title of the page 171 172 TODO: headers, =, -, or ~ anywhere, but most useful in `.idldoc` files 227 228 The "title" directive is available to provide a title for `.idldoc` files:: 229 230 .. title:: cpt-city color tables 231 232 This title is used for the `.idldoc` file in the table of contents of available documentation. 173 233 174 234 … … 176 236 -------------- 177 237 178 TODO: user vs. developer documentation, `USER` keyword, private/hidden tags (and attributes) 179 180 TODO: The `FOOTER` keyword can specify a file to include at the bottom of each page of output. 181 182 TODO: When producing HTML documentation, there are often two cases that need to be handled: 238 The keywords used when IDLdoc is run provide some options in the type of output produced. 239 240 The `USER` keyword specifies whether "user" or "developer" documentation is produced. User documentation is appropriate for users of a library. Directories, files, routines, and keywords/parameters can be marked to not show up in user documentation by using the "Private" tag. For example, the `MG_H5_DUMP` routine has a few helper routines that are not intended for end users to call:: 241 242 ;+ 243 ; Return a string representing an IDL declaration of the given item 244 ; (attribute or dataset). 245 ; 246 ; :Private: 247 ; 248 ; :Returns: 249 ; string 250 ; 251 ; :Params: 252 ; typeId : in, required, type=long 253 ; type identifier 254 ; spaceId : in, required, type=long 255 ; dataspace identifier 256 ;- 257 function mg_h5_dump_typedecl, typeId, spaceId 258 259 260 Individual keywords or parameters use a attribute to mark it as private. For instance, the `MG_STREPLACE` has a private keyword `START` that is not intended for users of the library routine, but is used by internal calls to the routine. The keyword's documentation is:: 261 262 ; start : out, optional, type=integral, default=0, private 263 ; index into string of where to start looking for the pattern 264 265 Developer documentation is the default and will show items marked as private (though there is a "Hidden" tag for not showing an item in any documentation). 266 267 When producing HTML documentation, there are often two cases that need to be handled: 183 268 184 269 #. documentation served on a web site and intended to be served as a full collection … … 187 272 In the later case, it is often useful to set the `EMBED` and `NONAVBAR` keywords. The `EMBED` keyword embeds the, rather large, CSS file into each HTML page. This is inefficient for a full documentation set on a web site because in that situation, each page can just refer to a common `.css` file. The `NONAVBAR` keyword simply omits the navigation bar at the top of the page which is not needed when only one HTML page is given but useful to navigate a full documentation set. 188 273 189 T ODO: index_level=1190 191 TODO: source code options 192 193 TODO: If the `STATISTICS` keywords is set, IDLdoc will compute certain measures of the code's complexity like the number of lines in a routine or the cyclomatic complexity. `COMPLEXITY_CUTOFFS`, `ROUTINE_LINE_CUTOFFS` 274 The `FOOTER` keyword can specify a file to include at the bottom of each page of output. This file is included verbatim in the output, so it should be already be in the format of the output. 275 276 By default, IDLdoc will copy the source code and put a link to it in the output. Use the `NOSOURCE` keyword to indicate that source code should not be copied or linked to. If the source code should be linked to, but not copied use `SOURCE_LINK` to specify relative (``SOURCE_LINK=1``) or absolute (``SOURCE_LINK=2``) links. 277 278 If the `STATISTICS` keywords is set, IDLdoc will compute certain measures of the code's complexity like the number of lines in a routine and the cyclomatic complexity. Use the `COMPLEXITY_CUTOFFS` and `ROUTINE_LINE_CUTOFFS` to specify to 2-element arrays which specify the warning and flagged levels. The defaults are ``[10, 20]`` for `COMPLEXITY_CUTOFFS` and ``[75, 150]`` for `ROUTINE_LINE_CUTOFFS`. 194 279 195 280 … … 197 282 ---------- 198 283 199 T ODO: The `project site <http://idldoc.idldev.com>`_ for IDLdoc contains more information about IDLdoc including the ticket system where bugs can be reported and new features requested. The mailing list, downloads of all versions along with their release notes, etc.284 The `project site <http://idldoc.idldev.com>`_ for IDLdoc contains more information about IDLdoc including the FAQ, the mailing list, ticket system, and downloads of all versions along with their release notes.
