词条 | Plain Old Documentation |
释义 |
Plain Old Documentation (pod) is a lightweight markup language used to document the Perl programming language. DesignPod is designed to be a simple, clean language with just enough syntax to be useful. It purposefully does not include mechanisms for fonts, images, colors or tables. Some of its goals are:
An extended version of pod that supports tables and footnotes called PseudoPOD has been used by O'Reilly & Associates to produce several Perl books, most notably Programming Perl by Larry Wall, Tom Christiansen, and Jon Orwant. Mark Jason Dominus used a modified version called mod to write Higher-Order Perl. Pod makes it easy to write manual pages, which are well suited to user-oriented documents. In contrast, other documentation systems, such as Python's Docstring or Java's Javadoc, though they can be used for user documentation, are designed to facilitate generating developer-oriented documentation about the source code for a software project. UsePod is the language used for most documentation in the Perl world. This includes Perl itself, nearly all publicly released modules, many scripts, most design documents, many articles on Perl.com and other Perl-related web sites, and the Parrot virtual machine. Pod is rarely read in the raw, although it is designed to be readable without the assistance of a formatting tool. Instead, it is read with the {{anchor|perldoc}}perldoc tool, or converted into Unix man pages or Web-standard HTML pages. It is also possible to use pod in other contexts than Perl. For example, to add simple documentation to bash scripts, which can then be easily converted to man pages.[1] Such uses rely on language-specific hacks to hide the pod part(s), such as (in bash) prefixing the POD section with the line Pure pod files usually have the extension code, which typically uses the interpreter's parser is designed to ignore pod in Perl code.) In source code files, the documentation is generally placed after the You can easily convert pod to other formats for example some of the various Wiki formats: Wiki formats like: WikiWikiWeb, Kwiki, TWiki, UseModWiki, TiddlyWiki, Textile, MediaWiki, MoinMoin or Confluence using Pod::Simple::Wiki. ExampleThis document is syntactically correct pod, which attempts to follow the major conventions on section naming as well.[2] {{hide|Source code|}} Formatting detailsPod files are written in an ASCII-compatible encoding, such as Latin-1 or UTF-8. A pod parser always assumes that the file it is parsing doesn't start with pod; it ignores all lines until it sees a pod directive. pod directives must come at the beginning of a line, and all begin with an equal sign. The pod parser will then assume that all following lines are pod, until it encounters a line consisting of the "=cut" directive. Any content following that is ignored until the parser encounters another pod directive. Thus, pod can be intermixed with executable source code if the language's parser knows how to recognize and ignore pod. Pod content is divided into paragraphs by empty lines. Paragraphs that begin with whitespace characters—tabs or spaces—are considered to be "verbatim paragraphs", and are left completely unformatted; these are used for sample code, ASCII art, etc. Paragraphs that begin with an equal sign are "command paragraphs"; the sequence of alphanumeric characters immediately following the equal sign is treated as a pod directive, and the rest of the paragraph is formatted according to that directive. Some directives also affect the following paragraphs. If a paragraph starts with something besides an equal sign or whitespace, it's considered an "ordinary paragraph". Both ordinary paragraphs and the contents of command paragraphs are parsed for formatting codes. Formatting in pod is very plain; it's mainly limited to bold, italic, underlined, monospaced, and a few other formats. There is also a code for linking between pod documents or to another section within the same document. Formatting codes consist of either:
Commands in pod include four levels of headings, bulleted and numbered lists, and commands to mark sections as being in another language. The latter feature allows for special formatting to be given to parsers that support it. See also
References
1. ^Embedding POD documentation in a shell script (retrieved 10 Jan 2011) 2. ^{{cite web|url=http://p3rl.org/perlpodtut|title=perlpodtut|author=Juerd}} External links
3 : Free documentation generators|Lightweight markup languages|Perl |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。