Ruby Document format
This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. (October 2009) |
This article needs additional citations for verification. (April 2024) |
RD (Ruby Document) is a lightweight markup language for writing Ruby-related documents. It can be embedded in Ruby source code.
RD is a traditional format. In modern Ruby, developers tend to write documents in RDoc[1] instead of RD.
Use
[edit | edit source]Originally, most documentation in the Ruby world, including for Ruby itself, had been written in RD. Then in 2002, much of it was converted to RDoc format. Although, the Japanese version of the Ruby Reference Manual still remains in RD format.
RD is designed to be written by hand and easily read in its raw form. Most end-users however experience it after it has been converted into HTML or man pages.
RD can be embedded in Ruby code, and pure RD files usually have the extension .rd.
Sample RD document
[edit | edit source]This document is syntactically correct RD, which attempts to follow the major conventions on section naming as well.
| Source | HTML result |
|---|---|
=begin = NAME RD sample - A sample RD document = SYNOPSIS |
NAME[edit | edit source]RD sample - A sample RD document SYNOPSIS[edit | edit source]here.is_a?(Piece::Of::Code) print <<"END" This indented block will not be scanned for formatting codes or directives, and spacing will be preserved. END DESCRIPTION[edit | edit source]Here's some normal text. It includes text that is
emphasized, keyboard, An Example List[edit | edit source]
An ordered List[edit | edit source]
COPYRIGHT[edit | edit source]Copyright 2005 J. Random Hacker <jrh@cpan.org>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. |
See also
[edit | edit source]References
[edit | edit source]- ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
External links
[edit | edit source]- RDtool - Framework to translate RD document into other formats.
- rd-draft.rd - full description of RD markup languard (in RD format)
- rd-draft.html - full description of RD markup language (converted to HTML)