summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
commitb7528b5edb1f9148ea00ebb6151720e5943b3f0b (patch)
tree4caf55c53adb188170240f54b924892fbc5f9814 /lib/rdoc/markup.rb
parent97ac172d58d695305c39d555155318edb99f1ea7 (diff)
* lib/rdoc.rb: Import RDoc 3.7 release candidate
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup.rb')
-rw-r--r--lib/rdoc/markup.rb68
1 files changed, 54 insertions, 14 deletions
diff --git a/lib/rdoc/markup.rb b/lib/rdoc/markup.rb
index 73de2d06f8..bc28522615 100644
--- a/lib/rdoc/markup.rb
+++ b/lib/rdoc/markup.rb
@@ -48,13 +48,13 @@ require 'rdoc'
# end
# end
#
-# m = RDoc::Markup.new
-# m.add_word_pair("{", "}", :STRIKE)
-# m.add_html("no", :STRIKE)
+# markup = RDoc::Markup.new
+# markup.add_word_pair("{", "}", :STRIKE)
+# markup.add_html("no", :STRIKE)
#
-# m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
+# markup.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
#
-# wh = WikiHtml.new
+# wh = WikiHtml.new markup
# wh.add_tag(:STRIKE, "<strike>", "</strike>")
#
# puts "<body>#{wh.convert ARGF.read}</body>"
@@ -498,15 +498,53 @@ require 'rdoc'
# [+:main:+ _name_]
# Equivalent to the <tt>--main</tt> command line parameter.
#
+# [<tt>:category: section</tt>]
+# Adds this item to the named +section+ overriding the current section. Use
+# this to group methods by section in RDoc output while maintaining a
+# sensible ordering (like alphabetical).
+#
+# # :category: Utility Methods
+# #
+# # CGI escapes +text+
+#
+# def convert_string text
+# CGI.escapeHTML text
+# end
+#
+# An empty category will place the item in the default category:
+#
+# # :category:
+# #
+# # This method is in the default category
+#
+# def some_method
+# # ...
+# end
+#
+# Unlike the :section: directive, :category: is not sticky. The category
+# only applies to the item immediately following the comment.
+#
+# Use the :section: directive to provide introductory text for a section of
+# documentation.
+#
# [<tt>:section: title</tt>]
-# Starts a new section in the output. The title following +:section:+ is
-# used as the section heading, and the remainder of the comment containing
-# the section is used as introductory text. Subsequent methods, aliases,
-# attributes, and classes will be documented in this section.
+# Provides section introductory text in RDoc output. The title following
+# +:section:+ is used as the section name and the remainder of the comment
+# containing the section is used as introductory text. A section's comment
+# block must be separated from following comment blocks. Use an empty title
+# to switch to the default section.
+#
+# The :section: directive is sticky, so subsequent methods, aliases,
+# attributes, and classes will be contained in this section until the
+# section is changed. The :category: directive will override the :section:
+# directive.
#
# A :section: comment block may have one or more lines before the :section:
# directive. These will be removed, and any identical lines at the end of
-# the block are also removed. This allows you to add visual cues such as:
+# the block are also removed. This allows you to add visual cues to the
+# section.
+#
+# Example:
#
# # ----------------------------------------
# # :section: My Section
@@ -514,10 +552,12 @@ require 'rdoc'
# # See it glisten in the noon-day sun.
# # ----------------------------------------
#
-# Sections may be referenced multiple times in a class or module allowing
-# methods, attributes and constants to be ordered one way for implementation
-# ordering but still grouped together in documentation. If a section has
-# multiple comments they will be concatenated with a dividing rule.
+# ##
+# # Comment for some_method
+#
+# def some_method
+# # ...
+# end
#
# [+:call-seq:+]
# Lines up to the next blank line in the comment are treated as the method's