Ruby Document format

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

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.

Source HTML result

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, 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

  1. This is the first item
  2. second
  • Nested unordered list.
  1. start=3
  2. third
  1. Nested ordered list
  2. 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 2005 J. Random Hacker <[email protected]>. 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

References

  1. ^ "documentation_guide - Documentation for Ruby 3.5". docs.ruby-lang.org. Retrieved 2025-09-28.
  • 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)


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.