rdtool-0.6.39/0000755000004100000410000000000015156523700013150 5ustar www-datawww-datardtool-0.6.39/COPYING.txt0000644000004100000410000004325415156523700015031 0ustar www-datawww-data GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. rdtool-0.6.39/bin/0000755000004100000410000000000015156523700013720 5ustar www-datawww-datardtool-0.6.39/bin/rd20000755000004100000410000001656115156523700014346 0ustar www-datawww-data#!/usr/bin/env ruby # -*- coding: ASCII-8BIT -*- =begin = NAME rd2 - converter from RD to other mark-up language. = SYNOPSIS rd2 [-r ] [options] = DESCRIPTION rd2 inputs from ((||)) and outputs into (({STDOUT})). you can choose ((||)) to select output format. For example, use "rd/rd2html-lib.rb" to translate it into HTML, and "rd/rd2man-lib.rb" to tranlate it into roff with man macros. = OPTIONS please read output of % rd2 --help and % rd2 -r rd/rd2html-lib.rb --help = FILES * ~/.rd2rc - User configration file. = SEE ALSO ruby(1) =end require "kconv" require "optparse" require "rd/rdfmt" require "rd/visitor" require "rd/version" module Kconv NAME2CONST = { "iso-2022-jp" => Kconv::JIS, "euc-jp" => Kconv::EUC, "shift_jis" => Kconv::SJIS, } NAME_ALIAS = { 'jis' => 'iso-2022-jp', 'euc' => 'euc-jp', 'sjis' => 'shift_jis', 'shift-jis' => 'shift_jis', } if defined?(Kconv::UTF8) NAME2CONST['utf-8'] = Kconv::UTF8 NAME_ALIAS['utf8'] = 'utf-8' end end include RD SYSTEM_NAME = "RDtool -- rd2" SYSTEM_VERSION = "$Version: " + RD::VERSION + "$" #" RD2_VERSION = Version.new_from_version_string(SYSTEM_NAME, SYSTEM_VERSION) $Visitor_Class = nil $Visitor = nil $RD2_Sub_OptionParser = nil $RD2_OptionParser = nil $DEFAULT_FORMAT_LIB = "rd/rd2html-lib" $RC = {} $RC["filter"] = Hash.new(RD::INCLUDE_FILTER) class RD2Command PartArgument = Struct.new(:part, :filter) def initialize(argv: ARGV, argf: ARGF, stdout: $stdout, stderr: $stderr, program_name: $PROGRAM_NAME) @argv = argv @argf = argf @stdout = stdout @stderr = stderr @program_name = program_name @include_path = [] @with_part = [] @output_file = nil @output_index = false @out_code = nil @from_rdo = false end def run load_user_config require_implicit_format_lib begin option_parser.parse!(@argv) rescue OptionParser::ParseError => e @stderr.print("Error: #{e.inspect}\n") @stderr.print(option_parser.to_s) return 1 end load_default_format_library unless $Visitor_Class ensure_visitor_loaded $Visitor.input_filename = @argf.filename tree = build_tree configure_visitor write_output(tree, $Visitor.visit(tree)) write_index(tree) if @output_index 0 rescue Racc::ParseError => e @stderr.puts(e.message) 10 ensure cleanup_tmp_files end private def option_parser @option_parser ||= @argv.options do |q| $RD2_OptionParser = q q.banner = "Usage: #{File.basename(@program_name)} [options] rd-file > output\n" q.on_head("global options:") q.on("-rLIB", "--require=LIB", String, "choose format library.") do |lib| load_format_library(lib) end q.on("-oNAME", String, "indicate base name of output file") do |name| @output_file = name end q.on("--out-code=KCODE", Kconv::NAME2CONST.keys, Kconv::NAME_ALIAS, "character encoding of output.(jis|euc|sjis|utf8)") do |code| @out_code = code end q.on("--output-index", "output method index file (*.rmi)") do @output_index = true end q.on("-IPATH", "--include-path=PATH", String, "add PATH to list of include path") do |path| @include_path.unshift(path) end q.accept(PartArgument, /(\w+)(?:\s*:\s*(\w+))?/) do |_src, part, filter| PartArgument.new(part, filter || part) end q.on("--with-part=PART", PartArgument, "include PART with Filter") do |entry| @with_part << entry unless @include_path.include?(RD::RDTree.tmp_dir) @include_path << RD::RDTree.tmp_dir end end q.on("--from-rdo", "load from *.rdo instead of *.rd") do @from_rdo = true end q.on("--version", "print versions.") do @stderr.puts(RD2_VERSION) @stderr.puts(Tree::version) @stderr.puts(Visitor::version) @stderr.puts($Visitor_Class.version) if $Visitor_Class raise SystemExit.new(0) end q.on_tail("--help", "print this message") do @stderr.print(q.to_s) raise SystemExit.new(0) end end end def load_user_config user_config = File.expand_path("~/.rd2rc") if File.readable?(user_config) load user_config else load "rd/dot.rd2rc" end rescue LoadError, StandardError load "rd/dot.rd2rc" end def require_implicit_format_lib base = File.basename(@program_name, ".*").downcase return unless /rd2.+/ =~ base load_format_library("rd/#{$&}-lib.rb") end def load_format_library(lib) require lib ensure_visitor_loaded end def load_default_format_library load_format_library($DEFAULT_FORMAT_LIB) end def ensure_visitor_loaded return unless $Visitor_Class return if $Visitor $Visitor = $Visitor_Class.new load_sub_option_parser end def load_sub_option_parser return unless $RD2_Sub_OptionParser require $RD2_Sub_OptionParser $RD2_Sub_OptionParser = nil end def build_tree if @from_rdo build_tree_from_rdo else build_tree_from_rd end end def build_tree_from_rdo rdos = [] @argv.each do |path| rdos << File.open(path) dirname = File.dirname(path) @include_path.push(dirname, File.join(dirname, "include")) end tree = RDTree.new_from_rdo(*rdos) tree.include_path = @include_path tree ensure rdos&.each(&:close) end def build_tree_from_rd dir = @argf.filename ? File.dirname(@argf.filename) : "." @include_path.push(dir, File.join(dir, "include")) src = read_input_lines if src.find { |line| /\S/ === line } && !src.find { |line| /^=begin\b/ === line } src.unshift("=begin\n").push("=end\n") end tree = RDTree.new(src, @include_path, nil) @with_part.each do |entry| tree.filter[entry.part] = $RC["filter"][entry.filter] end tree.parse tree end def read_input_lines @argf.readlines end def configure_visitor @with_part.each do |entry| $Visitor.include_suffix.push(entry.part) end $Visitor.filename = @output_file if @output_file return unless @out_code begin $Visitor.charcode = @out_code $Visitor.lang = "ja" rescue NameError end end def write_output(tree, out) out = Kconv.kconv(out, Kconv::NAME2CONST[@out_code], Kconv::AUTO) if @out_code if @output_file suffix = if $Visitor.respond_to?(:output_suffix) $Visitor.output_suffix else $Visitor.class::OUTPUT_SUFFIX end filename = @output_file + "." + suffix File.open(filename, "w") { |file| file.print(out) } @stderr.print("#{File.basename(@program_name)}: output to #{filename}...\n") else @stdout.print(out) end end def write_index(tree) unless @output_file raise %Q[Error: option "--output-index" must be used with option "-oNAME"] end require "rd/rd2rmi-lib" rmivisitor = RD2RMIVisitor.new rmivisitor.filename = @output_file filename = @output_file + ".rmi" File.open(filename, "w") { |file| file.print(rmivisitor.visit(tree)) } @stderr.print("#{File.basename(@program_name)}: output to #{filename}...\n") end def cleanup_tmp_files Dir.glob("#{RD::RDTree.tmp_dir}/rdtmp.#{$$}.*.*").each do |path| File.delete(path) end end end exit(RD2Command.new.run) rdtool-0.6.39/bin/rdswap.rb0000755000004100000410000001614515156523700015557 0ustar www-datawww-data#!/usr/bin/env ruby ####### # rdswap.rb (c) C.Hintze 30.08.1999 ####### require "optparse" RDDocumentBlock = Struct.new(:kind, :lines) class RDSwap def initialize(argv, stdout: $stdout, stderr: $stderr) @argv = argv.dup @stdout = stdout @stderr = stderr @verbose = false end def run parse_options! if @argv.size < 2 @stdout.print("Wrong # of paramter! Use `-h' for help.\n") return 1 end source_file = detect_source_file(@argv) docs, srcs = load_documents(@argv) source_blocks = srcs["rb"] source_docs = docs["rb"] raise "No source file content found." unless source_blocks && source_docs (docs.keys - ["rb"]).each do |lang| write_translation(source_file, lang, source_blocks, source_docs, docs[lang]) end 0 end private def parse_options! OptionParser.new do |opts| opts.on("-h", "--help") do @stdout.print(help_text) raise SystemExit.new(0) end opts.on("-v", "--verbose") do @verbose = true end end.parse!(@argv) end def help_text HELP_TEXT % { program_name: File.basename($PROGRAM_NAME) } end def detect_source_file(paths) source_files = paths.select { |path| path.end_with?(".rb") } case source_files.size when 0 @stderr.print "Warning: No `.rb' file given! Take first file as source.\n" paths.first when 1 source_files.first else @stdout.print "Sorry! Only one source file (`.rb') allowed!\n" raise SystemExit.new(1) end end def load_documents(paths) docs = {} srcs = {} paths.each do |path| lang = File.basename(path).split(".").last docs[lang], srcs[lang] = parse_file(path) end [docs, srcs] end def parse_file(path) rddocs = [] sources = [[]] current_doc = nil File.foreach(path) do |line| if current_doc if line.start_with?("=end") rddocs << current_doc sources << [] current_doc = nil else current_doc.lines << line end next end if (match = /\A=begin(?:\s+(.*))?\s*\z/.match(line)) current_doc = RDDocumentBlock.new(match[1], []) else sources[-1] << line end end [rddocs, sources] end def write_translation(source_file, lang, source_blocks, source_docs, translated_docs) max = [source_blocks.size, source_docs.size, translated_docs.size].max output_path = "#{source_file}.#{lang}" File.open(output_path, "w") do |fd| translated_index = 0 (0...max).each do |i| fd.print(source_blocks[i].join) if source_blocks[i] && !source_blocks[i].empty? source_doc = source_docs[i] translated_doc = translated_docs[translated_index] block = if source_doc && translated_doc && translated_doc.kind == source_doc.kind translated_index += 1 translated_doc else source_doc end next unless block fd.print "=begin #{block.kind}\n", block.lines.join, "=end\n" end end @stdout.print "File `#{output_path}' created.\n" if @verbose end end HELP_TEXT = <<~TEXT Purpose: This tool is written to support you to write multi-language documents using the Ruby-Document-Format (RD). The idea for such a tool was originated by Minero Aoki , how has thought about, how to make life easier for developers who have to write and maintain scripts in more than one language. You have to specify at least two filenames on the command line. One containing the Ruby script, the second containing a translated RD. If the script does *not* end with `.rb', it has to be the first filename mentioned on the command line! In opposition, all files containing translations *must not* ending with `.rb'! They should use a extension that describes the language. So that would give us the following picture: - sample.rb : Script contains the original documentation. - sample.jp : Documentation written in Japanese. - sample.de : Translation to German. The tool doesn't care about the language extensions. You can name them as you like! So the file containing the Japanese translation above, could also be names e.g. `sample.japan' or even `japantranslation.japan'. For every translation file, a new file will be created. The name is build from the script filename plus the language extension. So regarding the example above, following files would be created: - sample.rb.jp - sample.rb.de or, given the alternative translation filename as mentioned above... - sample.rb.japan How does it work? The contents of all files will be split into source and RD blocks. The source of the translation files, will be discarded! Every RD block may be of a certain type. The type will be taken from the contents directly following the `=begin' on the same line. If there is only a lonely `=begin' on a line by itself, the type of the block is `nil'. That means in : =begin bla bla =end : =begin whatever or not blub blub =end : the first block would be of type `nil' and the second one of type `whatever or not'. Block types are important for the translation. If a source will be generated from a script and a translation file, only these blocks are taken from the translation files, that comes in the right sequence *and* contains the same type as the block in the script! For example: # File sample.rb : =begin gnark Some comment =end : =begin block 2 =end : =begin block 3 =end : # File sample.de : =begin Block zwei =end : =begin Block drei =end : Here, the first block of `sample.rb' will *not* be translated, as there is no translation block with that type in sample.de! So the first block would be inserted as-it-is into the translated script. The blocks afterwards, however, are translated as the block type does match (it is `nil' there). Attention: In a translation file, a second block will only be used, if a first one was already used (matched). A third block will only be used, if a second one was used already! That means, if the first block of `sample.de' would be of type e.g. `Never match', then no block would ever be taken to replace anyone of `sample.rb'. Syntax: %{program_name} [-h|-v] ... Whereby: -h shows this help text. -v shows some more text during processing. Means a file, that contains RD and/or Ruby code. Examples: %{program_name} -v sample.rb sample.ja sample.de %{program_name} -v sample.ja sample.rb sample.de %{program_name} -v sample.ja sample.de sample.rb %{program_name} -v sample.?? Author: Clemens Hintze . TEXT begin exit(RDSwap.new(ARGV).run) rescue SystemExit => e raise e end rdtool-0.6.39/doc/0000755000004100000410000000000015156523700013715 5ustar www-datawww-datardtool-0.6.39/doc/rd-draft.ja.html0000644000004100000410000007415615156523700016714 0ustar www-datawww-data doc/rd-draft.rd.ja

RD working draft 日本語版

英語版はここにあります。

RDとは何か

RDとはRuby版のPODです。つまりRubyスクリプトファイルの中に埋め込む事を意図して 定義されたドキュメントフォーマットです。

RDは主にplain textをさまざまなフォーマットに変換するplain2というプログラム の影響を受けています。そのため、RDはplain textに似ており、シンプルですっきり した文法なので読みやすく書きやすいでしょう。

RubyインタプリタはRDをどのように扱うか

Rubyのインタプリタは単純に"=begin"で始まる行から"=end"で始まる 行までを無視します。ですから、スクリプトファイル中に埋め込む事ができるのは RDだけではありません。何でも=begin=endの間に書く事ができるの です。RDは選択肢の一つにすぎませんが、Ruby標準のドキュメントフォーマットと されています。*1

RDの基本的な概念と文法

Element, Block, Inline

これからの説明では"Element"という用語*2をテキストに文章構造を与えるための 構成要素という意味で用います。さらに、"Block"という用語を比較的 大きくグローバルな構造を表すElementに、"Inline"という用語を比較的小さ くローカルな、テキストに付加的な修飾を与えるElementに対して用います。

段落や見出し、リストなどがBlockです。RDではBlockを表すのに インデントや特殊文字を用います。Blockを入れ子にすることで複雑な 構造も表現できます。そして、Blockの表現は自然とplain textに見え ます。詳しくはBlockを見てください。

強調やコードや参照などがInlineです。((? ... ?))のようなカッコと 特殊文字の組合せがInlineの表現に使われます。ほとんどのInlineが互いに 入れ子にできます。詳しくはInlineを見てください。

Block

基本文法

Blockは行指向の文法にしたがいます。つまり、同じ行にある文字はすべて同じ Blockに属しています。インデントはBlockの入れ子レベルとタイプを表して います。行の先頭の文字はBlockのタイプに関係します。

概念と用語
Baseline
Baselineはインデントの基準です。ある行のインデントととBaselineの相対的 な深さはその行の属するBlockのタイプに影響します。
Head Char
Head Charは空白文字を除いた行の先頭の文字です。
STRINGLINE
STRINGLINEは普通の文字で構成された行です。STRINGLINEは"*", "(num)", ":", "=", "+"といった文字を Head Charとしては含みません。しかし、インデントされた行なら"=" や"+"をHead Charとすることができます。
WHITELINE
WHITELINEは空白文字だけの行です。
Comment
/^#/にマッチする行はコメントとみなされます。
Baselineの決定と影響

トップレベルではBaselineは行の左端です。リスト内ではBaselineはListItem の最初のBlockによって決定します。例えば、

Example: "|" はBaselineを表しています。
  |この行はトップレベルのTextBlockの行だとします。
  |<- したがって、Baselineは左端です。
    *|List内では (1)
     |<- このようにBaselineは(1)の行で決定されます。
    *    |同じListでもListItem毎にBaselineが決定されます。
         |<- したがって、1番目のListItemとは違うここにBaselineがあります。

|この行はトップレベルのTextBlockの行だとします。 |<- したがって、Baselineは左端です。

  • |List内では (1) |<- このようにBaselineは(1)の行で決定されます。
  • |同じListでもListItem毎にBaselineが決定されます。 |<- したがって、1番目のListItemとは違うここにBaselineがあります。

Blockが別のBlockに入れ子になっている時には内部のBlockのBaselineは外側の BlockのBaselineよりも深くなります。

Baselineとインデントの相対的な位置関係がBlockのタイプに影響します。 Baselineと同じ深さにインデントされたSTRINGLINETextBlock に属す行となります。一方Baselineより深くインデントされたSTRINGLINEVerbatimの行です。

Blockのタイプ

Headline

Headlineは"="か"+"をHead Charとする行で構成されます。 Headlineは1行以上にはなりません。Headlineはトップレベルだけに置く事が できます。

Example:
|<- トップレベルのBaseline
= Headline 1.
=== Headline 1.1.1.
+ Headline 1.1.1.1.1.

Headline 1.

Headline 1.1.1.

Headline 1.1.1.1.1.

Headlineの先頭の特殊文字はHeadlineのレベルを表しています。次の図で 最初のマークは最も大きなレベルのもので、最後のマークがもっとも小さな レベルのものです。

Fig: Headline Marks
=
==
===
====
+
++

マークに続くテキストはHeadlineのタイトルです。これは同時に Referenceのラベルとして使われます。

HeadlineのタイトルにはReferenceとFootnoteを除くInlineを使う事が できます。

Include

Includeは"<<<"をHead Charとし、その後ろにインクルードする ファイルの名前が続く行からなります。RD形式のファイルと出力するフォーマッ トで書かれたファイルのどちらでもIncludeによってインクルードできます。

RD形式のファイルをインクルードする時にはインクルードされるファイルの名 前は"foo.rd"の様に".rd"もしくは".rb"というサフィックスでなくてはなりま せん。そして、"<<<"の後にはサフィックスを含めたファイルの完全な 名前を書きます。例えば、次の様にです。

<<< foo.rd

出力するフォーマットのファイルをインクルードするには、インクルードされる ファイルはその出力フォーマットに固有のサフィックスを持たないといけません。 例えば、HTMLのファイルをインクルードするには".html"というサフィックスを、 Texinfo形式のファイルをインクルードするには".texi"というサフィックスを つけます。そして、"<<<"の後ろにはサフィックスを除いたファイルの 名前を書きます。例えば、

<<< foo

と書くわけです。

この場合、RDフォーマッタはHTMLを出力する時には"foo.html"をインクルード し、Texinfo形式で出力する時には"foo.texi"をインクルードします。出力フォー マットのIncludeを用いる時には複数の(しかもなるべく多くの)形式のインク ルードファイルを用意すべきです。

TextBlock

TextBlockは複数のSTRINGLINEから構成されます。それらの行はBaseline と同じインデントでないといけません。Baselineより深いSTRINGLINEVerbatimの行とみなされます。

TextBlockはInlineを内部に含む事ができます。

Example:
|
これはTextBlockです。
TextBlockの2行目の行です。
  この行はTextBlockでなくVerbatimです。
* そしてこの行はListの行です。(正確にはListItemの中のTextBlockの行でも
  あるのですが)

この例は次のようにフォーマットされます。

これはTextBlockです。 TextBlockの2行目の行です。

この行はTextBlockでなくVerbatimです。
  • そしてこの行はListの行です。(正確にはListItemの中のTextBlockの行でも あるのですが)
Verbatim

Rubyスクリプトを引用するのにVerbatimを用いる事ができます。Verbatimは Baselineより深いインデントを持つSTRINGLINEで構成されます。 Verbatimは"*"や"(1)"や":"といった特殊文字をHead Charとして持つ行も含む事ができますが、それらは最初の行には置く事 ができません。最初の行にあるときにはListと見なされます。Verbatim は最初の行より浅いインデントの行も含みません。VerbatimはWHITELINE を含める事ができます。

InlineはVerbatim内では使えません。

Example:
 これはVerbatimです。
   最初の行より深いインデントを持っても、同じVerbatimの行になります。
 * この行はListに見えますが、Verbatimです。
しかしこの行は最初の行よりも浅くインデントされているので、別のVerbatim
の行になります。

この例が次のようにフォーマットされます。

これはVerbatimです。
  最初の行より深いインデントを持っても、同じVerbatimの行になります。
* この行はListに見えますが、Verbatimです。
しかしこの行は最初の行よりも浅くインデントされているので、別のVerbatim
の行になります。
List

Listは特殊なBlockです。Listは複数のListItemから構成され、ListItem は複数のBlockから構成されます。したがって、ListはBlockを内部に含む事が できます。含む事のできるBlockにはList自身も含みます。*3

ListItemはWHITELINEを含む事ができますが、TextBlockは 持てません。そのため、WHITELINEを間にはさむ事によって複数のTextBlock をListItem内部に置く事ができます。

Listには"ItemList"、"EnumList"、"DescList", "MethodListの4種類があります。

ItemList

ItemListは単純な番号付されないListです。ItemListItemは"*"という Head Charの行で始まります。ItemListItemの最初のBlockは必ず TextBlockになります。

Example:
* 親Listの最初のItem
    * 子Listの最初のItem
    * 子Listの2番目のItem
  親ListのItemに含まれるTextBlock

下のようにフォーマットされます。

  • 親Listの最初のItem

    • 子Listの最初のItem
    • 子Listの2番目のItem

    親ListのItemに含まれるTextBlock

EnumList

EnumListは番号付されたListです。EnumListItemは"num"(num は整数)というHead Charの行ではじまります。他の点ではEnumListは ItemListと同じです。

Example:
(1) 親Listの最初のItem
      * 子ListとなるItemList
(2) 親Listの2番目のItem
(10) 番号は無視されます。

次のようにフォーマットされます。

  1. 親Listの最初のItem
    • 子ListとなるItemList
  2. 親Listの2番目のItem
  3. 番号は無視されます。
DescList

DescListは用語説明のためのListです。DescListItemは2つの部分からなります。 1つはTermパートでもう1つはDescriptionパートです。TermパートはReference のLabelとして使われます。

Termパートは":"というHead Charの行からなります。Termパートの 行はインデントできることを除くとTermパートはHeadlineと同様です。

DescriptionパートはTermパートの次の行からはじまります。Descriptionパート のBaselineはTermパートの(Head Charを除いた)テキスト部分と 同じかより深くないといけません。例えば次の例は間違っています。

Example:
:   |Term
  |Description.

Descriptionぱーとは複数のBlockを含む事ができます。Listを 最初のBlockとすることもできます。TermパートはInlineを含む事が できますが、ReferenceとFootnoteは例外です。

Example:
:Term
   Descriptionの最初の行
   2番目の行
:Term2
   * Listも含む事ができます
   * ...

次のようにフォーマットされます。

Term
Descriptionの最初の行 2番目の行
Term2
  • Listも含む事ができます
  • ...
MethodList

MethodListはメソッドの説明のための特殊なタイプのDescListです。 ほとんどの点でMethodListはDescListと同様ですが、Labelの規則 は違っています。RDフォーマッタはMethodListのTermパートがなんらかの Rubyのあるクラスのメソッドや定数やCの関数プロトタイプといったような プログラムのコードであると知っています。そのため、MethodListは メソッドの引数のように見える部分を除いた上でLabelとなります。詳細は LabelとReferenceを見てください。

MethodListItemはDescListと同様にTermパートとDescription パートを持ちます。Termパートは"---"というHead Char の行でなり、DescriptionパートはTextBlockVerbatimListを含む事ができます。しかし、逆にMethodListをList の中に置くべきではありません。RDは将来的にはこれを禁止するかも しれません。

Example:
--- Array#each {|i| ... } # => Labelは"Array#each"
      各項目に対してブロックを評価する。
--- Array#index(val) # => Labelは"Array#index"
      ((|val|))と同じ値である最初の項目を返す。同じ項目が無いときには
      (({nil}))を返す。

この例が次のようにフォーマットされます。

Array#each {|i| ... }
各項目に対してブロックを評価する。
Array#index(val)
valと同じ値である最初の項目を返す。同じ項目が無いときには nilを返す。

フォーマッタのいくつかはMethodListのTermパートに書かれているのはRuby のメソッドや定数などであると仮定しています。そういったフォーマッタでは MethodListのTermパートをインテリジェントに扱う事ができますが、そのため には特定の慣習にしたがってRDを書く必要があります。

標準的なRubyクラスリファレンスのための慣習として次のようなものが提案さ れています。

インスタンスメソッド

クラスClassのインスタンスメソッドmethod

Class#method(its params  ...) { parameter block }
クラスメソッド(クラスの特異メソッド)

クラスClassのクラスメソッドmethod

Class.method(its params ...) { parameter block }
クラス定数

クラスClassの定数Const

Class::Const
関数メソッド

関数func

function#func(its params ...) { parameter block }

Rubyはいくつかの特殊な文字(e.g. [], []=, +, -, <<, ...)はメソッドの名前 (識別子)として使います。この時、Rubyインタプリタはこれらのメソッドの パースを普通のメソッドとは違ったやりかた(演算子メソッド)で行います。 しかし、この慣習ではこれらの演算子メソッドも同じように書きます。

Example:
  --- Array#[](key)
        ((|key|))に対応する値を返す。
  --- Array#[]=(key, value)
        ((|key|))の場所に((|value|))を格納する。
  --- Array#+(other)
        2つの(({Array}))を結合してそれを返します。

Inline

InlineはTextBlockHeadlineDescListのTermパートの 中で使う事ができます。カッコを使ったマークアップがInlineに使われます。 Inline同士は互いに入れ子にできます。

次のInlineの一覧では左側に書式を、右側にフォーマット後の様子を表示 しています。

((*Em*)) => Em
強調
(({while gets...})) => while gets...
プログラムのコード
((|var|)) => var
メタ変数*4
((%ruby -v%)) => ruby -v
キーボード
((:Term:))

=> Term

インデクスやキーワードとなる用語の指定

((<Identity or URL>))

=> Indentity or URL

参照。詳しくはLabelとReferenceを見てください。

((-Footnote-))

=> *5

脚注

(('verb')) => verb
Inlineのvarbatim(フォーマット抑制)

LabelとReference

ReferenceにはLabelが必要です。RDではHeadlineのタイトルとDescListMethodListのTermパートだけがLabelとなります。したがって、各々の Headlineには違うタイトルをつけてあげなくてはなりません。この問題の きちんとした解決策はまだ見付かっていません。

どのようにLabelがつけられるか

HeadlineのタイトルとDescListMethodListのTermパートが Labelとして使われます。しかし、Inlineが含まれるために、それらが そのままLabelとして使われる、というほど単純ではありません。

第一に、MethodListはLabel付けにおいてはやや特殊です。MethodList のTermパートはInlineを含みませんが、その代わりRDではMethodList のTermパートはメソッドリファレンスやそれに類似の物とみなされますので、次の ようなルールでラベルが付けられます。

  1. "("や"{"の前にあるテキストだけがラベルと見なされる。*6

次の例を見れば、どのようにルールが適用されているかわかるでしょう。 "# =>"より右にあるのがMethodListのTermパートから抽出された Labelです。

Example:
  --- Array.new([size[, val]]) # => Array.new
  --- Array#[]=(key, val) # => Array#[]=
  --- Array#each { ... } # => Array#each
  --- void rb_define_method(VALUE class, ...) # => void rb_define_method

次に、HeadlineのタイトルやDescListのTermパートの場合には、この ような特別なルールはありませんが、Inlineを含む事があるので、Inline に用いるカッコを取り除くためのルールがあります。

  1. どんなInline修飾もLabelには影響しません。したがって、

    = ((*Headline*))
    と
      = Headline
    は共に"Headline"とLabelが決まります。
  2. しかし、Labelを抽出する際にはInlineの開始カッコの後ろと終端カッコ の前にある空白文字は取り除かれます。したがって、

    = ((* Headline  *))

    = ((*Headline*))

    も"Headline"とLabelがつけられます。

Reference

LabelのつけられたElementはReferenceによって参照できます。Referenceは ((<...>))というカッコで修飾されるInlineです。

最も簡単なReferenceの使用法は、単にLabelをそのカッコの中に書けばよいのです。

((<Label>))

これは"Label"というLabelに対する参照となります。また、フォーマッタによる 出力では"Label"というテキストが表示にも使われます。例: Label*7

URLによって示されたリソースを参照するには次のように書きます。

((<URL:http://www.ruby-lang.org/en/raa.html>))

可能ならRDフォーマッタはURLを次のようにハイパーリンクします。例: <URL:http://www.ruby-lang.org/en/raa.html>.

Labelとは違うテキストを表示に使いたい時には次のように書きます。

((<Text for display|Label>))

"Text for display"が表示用のテキストとして使われ、"Label"がLabelとして 使われます。例: Text for display

表示用のテキストはInlineを含む事ができます。しかし、Footnoteと Reference自身を含む事はできません。

Reference内では"|"や"/"は特殊文字なのでこれらを使いたい時には、それを含む 部分ごとダブルクオートで囲ってやらないといけません。これはReference内のどの 部分でも同じです。

((<"Bar | inside display text"|Label>))

Bar | inside display text

表示用のテキストはURLへのReferenceにも使う事ができます。

((<Ruby Application Archive|URL:http://www.ruby-lang.org/en/raa.html>))

Ruby Application Archive

表示用のテキストが無い場合には代わりにLabelにInlineを使えます。

((<((*Label*))>))

Label


*1もし他のドキュメントフォーマットに興味があるなら、例えば rubyapi2 <URL:http://www.ueda.info.waseda.ac.jp/~igarashi/ruby/xml.html#rubyapi2> などを見るといいでしょう。これはRuby/Gtkのような大規模ライブラリのドキュメン ト向けに作られています。
*2訳注: RDの文法用語についてはあ えて日本語訳をあてませんでした。
*3HeadlineIncludeはList内部に持てません。
*4 Varについての詳しい説明はtexinfo.texiの該当部分にあります。
*5Footnote
*6 "(...)"の内部のテキストはメソッドの引数だと見なされ、 "{...}"の内部のテキストはメソッドのブロックと見なされるのです。
*7 "Label"というLabelのついたElementが無いのでおそらくReferenceの様には 見えないでしょう。

rdtool-0.6.39/doc/rd-draft.rd0000644000004100000410000004065015156523700015754 0ustar www-datawww-data= RD working draft Japanese version is (()). == What is RD? RD is Ruby's POD, embeddable documentation format in script file. RD is influenced mainly from plain2, a program to translate from plain text to some mark-up language. So, RD looks like plain text, and its simpleness and neatness make it easy to read and write. == How does the interpreter work for RD? Ruby's interpreter, (({ruby})), simply ignores text between a line beginning with "(({=begin}))" and one beginning with "(({=end}))". So, RD is not only embeddable. You can write anything between (({=begin})) and (({=end})). RD is one of them, but RD will be a standard one.((- If you are interested in others, see rubyapi2 (()) for example. -)) == Concepts and Syntax === Element, Block and Inline We will use the term "Element" for features of RD which add information of document structure to text. In addition, we use a term "(())" for Elements for large and global structures, and a term "(())" for ones for small and local decorations. Paragraph, headline or list is a kind of Block. RD uses indentation and special characters to describe Blocks. You can also write complicated structure to nested Blocks. And this style of Block looks naturally like plain text format. See (()) for details. Emphasis, code or reference is a kind of Inline. Parentheses and special characters, like (('((? ... ?))')), are used for Inline. Almost all Inline may be nested inside each other. See (()) for more details. === Block ==== Basic Syntax Block has line oriented syntax. i.e. each character on the same line belongs to the same Block. And the indentation of the line represents nesting level and type of Block. The first character of the line represents the type of Block. + Concepts and Terms :Baseline Baseline is standard depth of indent. Relative depth between indent of one line and Baseline affects its Block-type. :Head Char Head Char is the first character of line, except whitespace. :STRINGLINE STRINGLINE is line which consists of strings. STRINGLINE doesn't have "(({*}))", "(({(((|num|)))}))", "(({:}))", "(({=}))" nor "(({+}))" as Head Char. But if the line is indented, "(({=}))" and "(({+}))" can be Head Char. :WHITELINE WHITELINE is a line which consists of whitespace, "(({\s}))", "(({\t}))" and "(({\n}))". :Comment A line which is matched with (({/^#/})) is regarded as a comment. + How Baseline is defined and how it works At the top level, Baseline is at left end, i.e., indent is 0. In List, Baseline is defined by first Block of ListItem. For example, Example: "|" means Baseline |Regard this line as one of TextBlock's in top level. |<- So this Baseline is at the left-most position. *|it is in List. (1) |<- this Baseline is defined by the marked with a (1). * |Different Item of List can have different Baseline inside. |<- So this Baseline differs from one of this list's first item. |Regard this line as one of TextBlock's in top level. |<- So this Baseline is at the left-most position. *|it is in List. (1) |<- this Baseline is defined by the marked with a (1). * |Different Items in Lists can have different Baselines inside. |<- So this Baseline differs from the one of this list's first item. If one Block is nested in another Block, the Baseline of the inside Blocks is deeper than the Baseline of outside Blocks. The relative position between Baseline and indent affects the type of Block. If a (()) has same indent with Baseline, it belongs to (()), otherwise, i.e. it has deeper indent than Baseline, it belongs to (()). ==== Types of Block + Headline Headline consists of a line which (()) is "(({=}))" or "(({+}))". And Headline can't include more than one line. Headline can be on only top level. Example: |<- Regard this as top level Baseline. = Headline 1. === Headline 1.1.1. + Headline 1.1.1.1.1. = Headline 1. === Headline 1.1.1. + Headline 1.1.1.1.1. Headline Mark represents level of Headline. See following figure. first Mark is biggest one, and last Mark has two parts. Fig: Headline Marks = == === ==== + ++ Text which follows Mark is title of Headline. It is also used as Label of (()). Title of Headline can contain (())s except for (()) and Footnote. + Include Include is a line that line head "(({<<<}))" and included file name. You can input from other file text, both RD and target format, with Include. When you include RD file, included file name have to have ".rd" or ".rb" as suffix, like "foo.rd", and write full name (not full path) of file after "(({<<<}))". For example, <<< foo.rd When you include target format file, include file name have to have suffix of target format standard one, for example ".html" in the case of outputting HTML, ".texi" in the case of outputting Texinfo, and write base name of file after "(({<<<}))". For example, <<< foo RD formatter include "foo.html" to output HTML, and include "foo.texi" to output Texinfo. If you want to use Include for target format, you should prepare plural type of included file. + TextBlock TextBlock is composed of (())s, but the (())s must have same indent with (()). If its indent is deeper than (()), the (()) belongs to (()). TextBlock can include (()) inside. Example: | This is TextBlock. Second line of same TextBlock. This line is not TextBlock, but Verbatim. * And this line is List. (But this line is exactly TextBlock in ListItem.) And this example is formatted such like: This is TextBlock. Second line of same TextBlock. This line is not TextBlock, but Verbatim. * And this line is List. (But this line is exactly TextBlock in ListItem.) + Verbatim You can use Verbatim to cite Ruby script. Verbatim is composed of (())s, and they must be indented deeper than (()). Verbatim can also include a line whose (()) is "(({*}))", "(({(1)}))" and "(({:}))", But it can't be first line of Verbatim, it is regarded as (()). Verbatim can't include a line which is indented shallower than first line. Verbatim can include (()). You can't use (()) in Verbatim. Example: This is Verbatim. Even if a line is indented deeper than first line, it is also in same Verbatim. * A line seems like list is also included in Verbatim. But if the line is indented shallower, it is not in same Verbatim. It is in other Verbatim. And this example is formatted such like: This is Verbatim. Even if a line is indented deeper than first line, it is also in same Verbatim. * A line seems like list is also included in Verbatim. But if the line is indented shallower, it is not in same Verbatim. It is in other Verbatim. + List List is special (()). List is composed of ListItems, and ListItem is composed of Blocks. So List can include Blocks inside, even also List itself.((- But List can't include (()) nor (()). -)) ListItem can include (()), and (()) can't include WHITELINE, so when you want to write 2 TextBlock inside ListItem, put a WHITELINE between TextBlocks. There is 3 type of List, "(())", "(())", "(())" and "(()). ++ ItemList ItemList is simple and not numbered List. ItemListItem begins by a line whose (()) is "(({*}))", and first Block of ItemListItem must be (()). Example: * first item of parent list * first item of sub list * second item of sub list text block ( line of first item of parent list) And this example is formatted such like: * first item of parent list * first item of sub list * second item of sub list text block ( line of first item of parent list) ++ EnumList EnumList is numbered List. EnumListItem starts with a line whose (()) is "(({(((|num|)))}))"(((|num|)) is integer). EnumList is same as (()) on other points. Example: (1) first line of parent list * first line of sub list(ItemList) (2) second list of parent list (10) number is ignored... And this example is formatted such like: (1) first line of parent list * first line of sub list(ItemList) (2) second list of parent list (10) number is ignored... ++ DescList DescList is List for descriptions. DescListItem has 2 part. One is Term part, the other is Description part. Term of DescListItem is also used as Label for (()). Term part is composed of a line whose (()) is "(({:}))", and Term part is same as (()), except that a line of Term part can be indented. Description part is starts with next line of Term part. (()) of Description part must be same or deeper than term of Term part of its pair. For example, following style is illegal. Example: : |Term |Description. Description part can include (())s. (()) can be first Block of Description part. Term part can contain (())s except for (()) and (()). Example: :Term first line of Description second line of Description :Term2 * also include List * ... And this example is formatted such like: :Term first line of definition. second line of definition :Term2 * also include list * ... ++ MethodList MethodList is the special type of (()) for explanation methods of your classes. MethodList is similar with (()) in almost all part, but it is labeled differently. RD formatters know it is some kind of program code, e.g. method or constants of class in Ruby or function prototype in C..., which is on Term part of MethodList. So, MethodList is labeled without the part which seems to be parameters of methods. See ((