|
1 |
| -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.41 2002/03/22 19:20:08 petere Exp $ --> |
| 1 | +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v 1.42 2002/07/28 15:22:20 petere Exp $ --> |
2 | 2 |
|
3 | 3 | <appendix id="docguide">
|
4 | 4 | <title>Documentation</title>
|
@@ -1254,6 +1254,196 @@ End:
|
1254 | 1254 |
|
1255 | 1255 | </sect1>
|
1256 | 1256 |
|
| 1257 | + |
| 1258 | + <sect1 id="doc-style"> |
| 1259 | + <title>Style Guide</title> |
| 1260 | + |
| 1261 | + <sect2> |
| 1262 | + <title>Reference Pages</title> |
| 1263 | + |
| 1264 | + <para> |
| 1265 | + Reference pages should follow a standard layout. This allows |
| 1266 | + users to find the desired information more quickly, and it also |
| 1267 | + encourages writers to document all relevant aspects of a command. |
| 1268 | + Consistency is not only desired among |
| 1269 | + <productname>PostgreSQL</productname> reference pages, but also |
| 1270 | + with reference pages provided by the operating system and other |
| 1271 | + packages. Hence the following guidelines have been developed. |
| 1272 | + They are for the most part consistent with similar guidelines |
| 1273 | + established by various operating systems. |
| 1274 | + </para> |
| 1275 | + |
| 1276 | + <para> |
| 1277 | + Reference pages that describe executable commands should contain |
| 1278 | + the following sections, in this order. Sections that do not apply |
| 1279 | + may be omitted. Additional top-level sections should only be used |
| 1280 | + in special circumstances; often that information belongs in the |
| 1281 | + <quote>Usage</quote> section. |
| 1282 | + |
| 1283 | + <variablelist> |
| 1284 | + <varlistentry> |
| 1285 | + <term>Name</term> |
| 1286 | + <listitem> |
| 1287 | + <para> |
| 1288 | + This section is generated automatically. It contains the |
| 1289 | + command name and a half-sentence summary of its functionality. |
| 1290 | + </para> |
| 1291 | + </listitem> |
| 1292 | + </varlistentry> |
| 1293 | + |
| 1294 | + <varlistentry> |
| 1295 | + <term>Synopsis</term> |
| 1296 | + <listitem> |
| 1297 | + <para> |
| 1298 | + This section contains the syntax diagram of the command. The |
| 1299 | + synopsis should normally not list each command-line option; |
| 1300 | + that is done below. Instead, list the major components of the |
| 1301 | + command line, such as where input and output files go. |
| 1302 | + </para> |
| 1303 | + </listitem> |
| 1304 | + </varlistentry> |
| 1305 | + |
| 1306 | + <varlistentry> |
| 1307 | + <term>Description</term> |
| 1308 | + <listitem> |
| 1309 | + <para> |
| 1310 | + Several paragraphs explaining what the command does. |
| 1311 | + </para> |
| 1312 | + </listitem> |
| 1313 | + </varlistentry> |
| 1314 | + |
| 1315 | + <varlistentry> |
| 1316 | + <term>Options</term> |
| 1317 | + <listitem> |
| 1318 | + <para> |
| 1319 | + A list describing each command-line option. If there are a |
| 1320 | + lot of options, subsections may be used. |
| 1321 | + </para> |
| 1322 | + </listitem> |
| 1323 | + </varlistentry> |
| 1324 | + |
| 1325 | + <varlistentry> |
| 1326 | + <term>Exit Status</term> |
| 1327 | + <listitem> |
| 1328 | + <para> |
| 1329 | + If the program uses 0 for success and non-zero for failure, |
| 1330 | + then you don't need to document it. If there is a meaning |
| 1331 | + behind the different non-zero exit codes, list them here. |
| 1332 | + </para> |
| 1333 | + </listitem> |
| 1334 | + </varlistentry> |
| 1335 | + |
| 1336 | + <varlistentry> |
| 1337 | + <term>Usage</term> |
| 1338 | + <listitem> |
| 1339 | + <para> |
| 1340 | + Describe any sublanguage or run-time interface of the program. |
| 1341 | + If the program is not interactive, this section can usually be |
| 1342 | + omitted. Otherwise, this section is a catch-all for |
| 1343 | + describing run-time features. Use subsections if appropriate. |
| 1344 | + </para> |
| 1345 | + </listitem> |
| 1346 | + </varlistentry> |
| 1347 | + |
| 1348 | + <varlistentry> |
| 1349 | + <term>Environment</term> |
| 1350 | + <listitem> |
| 1351 | + <para> |
| 1352 | + List all environment variables that the program might use. |
| 1353 | + Try to be complete; even seemingly trivial variables like |
| 1354 | + <envar>SHELL</envar> might be of interest to the user. |
| 1355 | + </para> |
| 1356 | + </listitem> |
| 1357 | + </varlistentry> |
| 1358 | + |
| 1359 | + <varlistentry> |
| 1360 | + <term>Files</term> |
| 1361 | + <listitem> |
| 1362 | + <para> |
| 1363 | + List any files that the program might access implicitly. That |
| 1364 | + is, do not list input and output files that were specified on |
| 1365 | + the command line, but list configuration files, etc. |
| 1366 | + </para> |
| 1367 | + </listitem> |
| 1368 | + </varlistentry> |
| 1369 | + |
| 1370 | + <varlistentry> |
| 1371 | + <term>Diagnostics</term> |
| 1372 | + <listitem> |
| 1373 | + <para> |
| 1374 | + Explain any unusual output that the program might create. |
| 1375 | + Refrain from listing every possible error message. This is a |
| 1376 | + lot of work and has little use in practice. But if, say, the |
| 1377 | + error messages have a standard format that the user can parse, |
| 1378 | + this would be the place to explain it. |
| 1379 | + </para> |
| 1380 | + </listitem> |
| 1381 | + </varlistentry> |
| 1382 | + |
| 1383 | + <varlistentry> |
| 1384 | + <term>Notes</term> |
| 1385 | + <listitem> |
| 1386 | + <para> |
| 1387 | + Anything that doesn't fit elsewhere, but in particular bugs, |
| 1388 | + implementation flaws, security considerations, compatibility |
| 1389 | + issues. |
| 1390 | + </para> |
| 1391 | + </listitem> |
| 1392 | + </varlistentry> |
| 1393 | + |
| 1394 | + <varlistentry> |
| 1395 | + <term>Examples</term> |
| 1396 | + <listitem> |
| 1397 | + <para> |
| 1398 | + Examples |
| 1399 | + </para> |
| 1400 | + </listitem> |
| 1401 | + </varlistentry> |
| 1402 | + |
| 1403 | + <varlistentry> |
| 1404 | + <term>History</term> |
| 1405 | + <listitem> |
| 1406 | + <para> |
| 1407 | + If there were some major milestones in the history of the |
| 1408 | + program, they might be listed here. Usually, this section can |
| 1409 | + be omitted. |
| 1410 | + </para> |
| 1411 | + </listitem> |
| 1412 | + </varlistentry> |
| 1413 | + |
| 1414 | + <varlistentry> |
| 1415 | + <term>See Also</term> |
| 1416 | + <listitem> |
| 1417 | + <para> |
| 1418 | + Cross-references, listed in the following order: other |
| 1419 | + <productname>PostgreSQL</productname> command reference pages, |
| 1420 | + <productname>PostgreSQL</productname> SQL command reference |
| 1421 | + pages, citation of <productname>PostgreSQL</productname> |
| 1422 | + manuals, other reference pages (e.g., operating system, other |
| 1423 | + packages), other documentation. Items in the same group are |
| 1424 | + listed alphabetically. |
| 1425 | + </para> |
| 1426 | + </listitem> |
| 1427 | + </varlistentry> |
| 1428 | + |
| 1429 | + </variablelist> |
| 1430 | + </para> |
| 1431 | + |
| 1432 | + <para> |
| 1433 | + Reference pages describing SQL commands should contain the |
| 1434 | + following sections: Name, Synopsis, Description, Parameters, |
| 1435 | + Usage, Diagnostics, Notes, Examples, Compatibility, History, See |
| 1436 | + Also. The Parameters section is like the Options section, but |
| 1437 | + there is more freedom about which clauses of the command can be |
| 1438 | + listed. The Compatibility section should explain to what extent |
| 1439 | + this command conforms to the SQL standard(s), or to which other |
| 1440 | + database system it is compatible. The See Also section of SQL |
| 1441 | + commands should list SQL commands before cross-references to |
| 1442 | + programs. |
| 1443 | + </para> |
| 1444 | + </sect2> |
| 1445 | + |
| 1446 | + </sect1> |
1257 | 1447 | </appendix>
|
1258 | 1448 |
|
1259 | 1449 | <!-- Keep this comment at the end of the file
|
|
0 commit comments