Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="doc.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="doc.html" title='Documenting Python' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='last' href='about.html' title='About this document...' /> | |
10 | <link rel='help' href='about.html' title='About this document...' /> | |
11 | <link rel="next" href="library-markup.html" /> | |
12 | <link rel="prev" href="misc-text-markup.html" /> | |
13 | <link rel="parent" href="special-constructs.html" /> | |
14 | <link rel="next" href="library-markup.html" /> | |
15 | <meta name='aesop' content='information' /> | |
16 | <title>6.7 Module-specific Markup </title> | |
17 | </head> | |
18 | <body> | |
19 | <DIV CLASS="navigation"> | |
20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
22 | <tr> | |
23 | <td class='online-navigation'><a rel="prev" title="6.6 Miscellaneous Text Markup" | |
24 | href="misc-text-markup.html"><img src='../icons/previous.png' | |
25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
26 | <td class='online-navigation'><a rel="parent" title="6 Special Markup Constructs" | |
27 | href="special-constructs.html"><img src='../icons/up.png' | |
28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
29 | <td class='online-navigation'><a rel="next" title="6.8 Library-level Markup" | |
30 | href="library-markup.html"><img src='../icons/next.png' | |
31 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
32 | <td align="center" width="100%">Documenting Python</td> | |
33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
34 | href="contents.html"><img src='../icons/contents.png' | |
35 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
36 | <td class='online-navigation'><img src='../icons/blank.png' | |
37 | border='0' height='32' alt='' width='32' /></td> | |
38 | <td class='online-navigation'><img src='../icons/blank.png' | |
39 | border='0' height='32' alt='' width='32' /></td> | |
40 | </tr></table> | |
41 | <div class='online-navigation'> | |
42 | <b class="navlabel">Previous:</b> | |
43 | <a class="sectref" rel="prev" href="misc-text-markup.html">6.6 Miscellaneous Text Markup</A> | |
44 | <b class="navlabel">Up:</b> | |
45 | <a class="sectref" rel="parent" href="special-constructs.html">6 Special Markup Constructs</A> | |
46 | <b class="navlabel">Next:</b> | |
47 | <a class="sectref" rel="next" href="library-markup.html">6.8 Library-level Markup</A> | |
48 | </div> | |
49 | <hr /></div> | |
50 | </DIV> | |
51 | <!--End of Navigation Panel--> | |
52 | ||
53 | <H2><A NAME="SECTION000770000000000000000"></A><A NAME="module-markup"></A> | |
54 | <BR> | |
55 | 6.7 Module-specific Markup | |
56 | </H2> | |
57 | ||
58 | <P> | |
59 | The markup described in this section is used to provide information | |
60 | about a module being documented. Each module should be documented | |
61 | in its own <tt class='macro'>\section</tt>. A typical use of this markup | |
62 | appears at the top of that section and might look like this: | |
63 | ||
64 | <P> | |
65 | <div class="verbatim"><pre> | |
66 | \section{\module{spam} --- | |
67 | Access to the SPAM facility} | |
68 | ||
69 | \declaremodule{extension}{spam} | |
70 | \platform{Unix} | |
71 | \modulesynopsis{Access to the SPAM facility of \UNIX.} | |
72 | \moduleauthor{Jane Doe}{jane.doe@frobnitz.org} | |
73 | </pre></div> | |
74 | ||
75 | <P> | |
76 | Python packages<a id='l2h-4' xml:id='l2h-4'></a> -- collections of modules that can | |
77 | be described as a unit -- are documented using the same markup as | |
78 | modules. The name for a module in a package should be typed in | |
79 | ``fully qualified'' form (it should include the package name). | |
80 | For example, a module ``foo'' in package ``bar'' should be marked as | |
81 | <code>\module{bar.foo}</code>, and the beginning of the reference | |
82 | section would appear as: | |
83 | ||
84 | <P> | |
85 | <div class="verbatim"><pre> | |
86 | \section{\module{bar.foo} --- | |
87 | Module from the \module{bar} package} | |
88 | ||
89 | \declaremodule{extension}{bar.foo} | |
90 | \modulesynopsis{Nifty module from the \module{bar} package.} | |
91 | \moduleauthor{Jane Doe}{jane.doe@frobnitz.org} | |
92 | </pre></div> | |
93 | ||
94 | <P> | |
95 | Note that the name of a package is also marked using | |
96 | <tt class='macro'>\module</tt>. | |
97 | ||
98 | <P> | |
99 | ||
100 | <dl class='macrodesc'> | |
101 | <dt><b><tt class='macro'>\declaremodule</tt></b> | |
102 | <tt>[</tt><var>key</var><tt>]</tt><tt>{</tt><var>type</var><tt>}</tt><tt>{</tt><var>name</var><tt>}</tt></dt> | |
103 | <dd> | |
104 | Requires two parameters: module type ("<tt class="samp">standard</tt>", | |
105 | "<tt class="samp">builtin</tt>", "<tt class="samp">extension</tt>", or "<tt class="samp"></tt>"), and the module | |
106 | name. An optional parameter should be given as the basis for the | |
107 | module's ``key'' used for linking to or referencing the section. | |
108 | The ``key'' should only be given if the module's name contains any | |
109 | underscores, and should be the name with the underscores stripped. | |
110 | Note that the <var>type</var> parameter must be one of the values | |
111 | listed above or an error will be printed. For modules which are | |
112 | contained in packages, the fully-qualified name should be given as | |
113 | <var>name</var> parameter. This should be the first thing after the | |
114 | <tt class='macro'>\section</tt> used to introduce the module. | |
115 | </dd></dl> | |
116 | ||
117 | <P> | |
118 | ||
119 | <dl class='macrodesc'> | |
120 | <dt><b><tt class='macro'>\platform</tt></b> | |
121 | <tt>{</tt><var>specifier</var><tt>}</tt></dt> | |
122 | <dd> | |
123 | Specifies the portability of the module. <var>specifier</var> is a | |
124 | comma-separated list of keys that specify what platforms the | |
125 | module is available on. The keys are short identifiers; | |
126 | examples that are in use include "<tt class="samp">IRIX</tt>", "<tt class="samp">Mac</tt>", | |
127 | "<tt class="samp">Windows</tt>", and "<tt class="samp">Unix</tt>". It is important to use a key | |
128 | which has already been used when applicable. This is used to | |
129 | provide annotations in the Module Index and the HTML and GNU info | |
130 | output. | |
131 | </dd></dl> | |
132 | ||
133 | <P> | |
134 | ||
135 | <dl class='macrodesc'> | |
136 | <dt><b><tt class='macro'>\modulesynopsis</tt></b> | |
137 | <tt>{</tt><var>text</var><tt>}</tt></dt> | |
138 | <dd> | |
139 | The <var>text</var> is a short, ``one line'' description of the | |
140 | module that can be used as part of the chapter introduction. | |
141 | This is must be placed after <tt class='macro'>\declaremodule</tt>. | |
142 | The synopsis is used in building the contents of the table | |
143 | inserted as the <tt class='macro'>\localmoduletable</tt>. No text is | |
144 | produced at the point of the markup. | |
145 | </dd></dl> | |
146 | ||
147 | <P> | |
148 | ||
149 | <dl class='macrodesc'> | |
150 | <dt><b><tt class='macro'>\moduleauthor</tt></b> | |
151 | <tt>{</tt><var>name</var><tt>}</tt><tt>{</tt><var>email</var><tt>}</tt></dt> | |
152 | <dd> | |
153 | This macro is used to encode information about who authored a | |
154 | module. This is currently not used to generate output, but can be | |
155 | used to help determine the origin of the module. | |
156 | </dd></dl> | |
157 | ||
158 | <P> | |
159 | ||
160 | <DIV CLASS="navigation"> | |
161 | <div class='online-navigation'> | |
162 | <p></p><hr /> | |
163 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
164 | <tr> | |
165 | <td class='online-navigation'><a rel="prev" title="6.6 Miscellaneous Text Markup" | |
166 | href="misc-text-markup.html"><img src='../icons/previous.png' | |
167 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
168 | <td class='online-navigation'><a rel="parent" title="6 Special Markup Constructs" | |
169 | href="special-constructs.html"><img src='../icons/up.png' | |
170 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
171 | <td class='online-navigation'><a rel="next" title="6.8 Library-level Markup" | |
172 | href="library-markup.html"><img src='../icons/next.png' | |
173 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
174 | <td align="center" width="100%">Documenting Python</td> | |
175 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
176 | href="contents.html"><img src='../icons/contents.png' | |
177 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
178 | <td class='online-navigation'><img src='../icons/blank.png' | |
179 | border='0' height='32' alt='' width='32' /></td> | |
180 | <td class='online-navigation'><img src='../icons/blank.png' | |
181 | border='0' height='32' alt='' width='32' /></td> | |
182 | </tr></table> | |
183 | <div class='online-navigation'> | |
184 | <b class="navlabel">Previous:</b> | |
185 | <a class="sectref" rel="prev" href="misc-text-markup.html">6.6 Miscellaneous Text Markup</A> | |
186 | <b class="navlabel">Up:</b> | |
187 | <a class="sectref" rel="parent" href="special-constructs.html">6 Special Markup Constructs</A> | |
188 | <b class="navlabel">Next:</b> | |
189 | <a class="sectref" rel="next" href="library-markup.html">6.8 Library-level Markup</A> | |
190 | </div> | |
191 | </div> | |
192 | <hr /> | |
193 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
194 | </DIV> | |
195 | <!--End of Navigation Panel--> | |
196 | <ADDRESS> | |
197 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
198 | </ADDRESS> | |
199 | </BODY> | |
200 | </HTML> |