Ruby Document format
{{Short description|Markup language}}
{{no footnotes|date=October 2009}}
{{unref |date=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 instead of RD.
Use
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
This document is syntactically correct RD,
which attempts to follow the major conventions on section naming as well.
{| class="wikitable"
! width="50%" | Source !! width="50%" | HTML result
|-
| style="background-color: white;" |
{{pre|
{{=}}begin
{{=}} NAME
RD sample - A sample RD document
{{=}} SYNOPSIS
{{codett|2=ruby|here.is_a?(Piece::Of::Code)}}
{{codett|2=ruby|print <<"END"}}
This indented block will not be scanned for formatting
codes or directives, and spacing will be preserved.
END
{{=}} DESCRIPTION
Here's some normal text. It includes text that is
((*emphasized*)), ((%keyboard%)), (({code}))-formatted,
(({{!}}variable part{{!}})), ((:indexed:)), and (('as-is'))((-footnote-)).
{{=}}{{=}} An Example List
- This is a bulleted list.
- Here's another item.
* Nested list item.
{{=}}{{=}} An ordered List
(1) This is the first item
(2) second
* Nested unordered list.
(3) third
(1) Nested ordered list
(2) its second item
{{=}}end
{{=}}begin html
{{codett|2=html|1=}}
{{codett|2=html|
}}
Here's some embedded HTML. In this block I can
{{codett|2=html|1=include images, apply }}
{{codett|2=html|styles, or do anything else I can do with}}
HTML. RD processors that aren't outputting HTML will
completely ignore it.
{{codett|2=html|
}}{{=}}end
{{=}}begin
{{=}} COPYRIGHT
Copyright 2005 J. Random Hacker
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.
{{=}}end
}}
| style="background-color: white;" |
NAME
RD sample - A sample RD document
SYNOPSIS
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
Here's some normal text. It includes text that is
emphasized, {{mono|keyboard}}, code
-formatted, variable part, indexed, and as-is*1.
An Example List
- This is a bulleted list.
- Here's another item.
- Nested list item.
An ordered List
- This is the first item
- second
:* Nested unordered list.
{{Ordered list |start{{=}}3|third}}
:#Nested ordered list
:#its second item
Here's some embedded HTML. In this block I can
include images, apply
styles, or do anything else I can do with
HTML. RD processors that aren't outputting HTML
will completely ignore it.
COPYRIGHT
Copyright 2005 J. Random Hacker
|}
See also
References
{{reflist}}
External links
- [http://raa.ruby-lang.org/project/rdtool?name=RDtool RDtool] - Framework to translate RD document into other formats.
- [https://github.com/uwabami/rdtool/blob/master/doc/rd-draft.rd rd-draft.rd] - full description of RD markup languard (in RD format)
- [http://rubyforge.org/docman/view.php/5708/3908/rd-draft.html rd-draft.html] - full description of RD markup language (converted to HTML)
{{Ruby programming language}}
Category:Lightweight markup languages
{{compu-lang-stub}}