|
|
||||||||||||||||||||||
|
Structured Text Formatting RulesFor the gendoc processor we (Daniel and Robin) have decided on the following format rules for Python doc strings so that they may be marked up in a reasonable manner. People developing other automated tools may think about adopting this standard as well. Feel free to discuss this in the doc-sig list. By and large we have decided to use the Structured Text approach offered by Jim Fulton. We have added to and modified it slightly for the needs of gendoc. In the text below I have borrowed heavily from Jim's description of Structured Text. A structured string consists of a sequence of paragraphs separated by one or more blank lines. Each paragraph has a level which is defined as the minimum indentation of the paragraph. A paragraph is a sub-paragraph of another paragraph if the other paragraph is the last preceding paragraph that has a lower level. In doc strings the level 0 indentation (left margin) is set to the starting column of the first non-blank line after the first line. This means the first tab(s) or 8 characters, for example, are stripped off the doc string in the process. Folks using python-mode won't have to worry; indentation will be correct. Special symbology is used to indicate special constructs:
An addition was made to support hypertext references. Hypertext references are marked with double quotes in the body of the doc string. At the end of the doc string will be a matching line starting with two dots '.. ' and a space followed by the same quoted text and then followed by the mapping (URL). This is patterned after the footnote notion in setext but is easier on the eyes. For example, "Pythonland" will be marked as a hyper-references to Python.org. If no matching trailing reference is found then nothing is done. |