-
Notifications
You must be signed in to change notification settings - Fork 445
[DOC] Re-format section Directives #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
peterzhu2118
merged 5 commits into
ruby:master
from
BurdetteLamar:markup_reference_directives
Aug 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
55bda20
[DOC] Re-format section Directives
BurdetteLamar d59d008
Update doc/rdoc/markup_reference.rb
BurdetteLamar f319d65
Update doc/rdoc/markup_reference.rb
BurdetteLamar 09ddef3
Update doc/rdoc/markup_reference.rb
BurdetteLamar db78913
Update doc/rdoc/markup_reference.rb
BurdetteLamar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -439,79 +439,77 @@ | |
# | ||
# ===== Directives for Allowing or Suppressing Documentation | ||
# | ||
# - <tt># :stopdoc:</tt>: | ||
# ====== <tt>:stopdoc:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should ignore markup | ||
# until next <tt>:startdoc:</tt> directive or end-of-file. | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should ignore markup | ||
# until next <tt>:startdoc:</tt> directive or end-of-file. | ||
# | ||
# - <tt># :startdoc:</tt>: | ||
# ====== <tt>:startdoc:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should resume parsing markup. | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should resume parsing markup. | ||
# | ||
# - <tt># :enddoc:</tt>: | ||
# ====== <tt>:enddoc:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should ignore markup to end-of-file | ||
# regardless of other directives. | ||
# - Appears on a line by itself. | ||
# - Specifies that \RDoc should ignore markup to end-of-file | ||
# regardless of other directives. | ||
# | ||
# - <tt># :nodoc:</tt>: | ||
# ====== <tt>:nodoc:</tt> | ||
# | ||
# - Appended to a line of code | ||
# that defines a class, module, method, alias, constant, or attribute. | ||
# - Appended to a line of code | ||
# that defines a class, module, method, alias, constant, or attribute. | ||
# - Specifies that the defined object should not be documented. | ||
# | ||
# - Specifies that the defined object should not be documented. | ||
# For a method definition in C code, it the directive must be in the comment line | ||
# immediately preceding the definition: | ||
# | ||
# - For a method definition in C code, it the directive must be in the comment line | ||
# immediately preceding the definition: | ||
# /* :nodoc: */ | ||
# static VALUE | ||
# some_method(VALUE self) | ||
# { | ||
# return self; | ||
# } | ||
# | ||
# /* :nodoc: */ | ||
# static VALUE | ||
# some_method(VALUE self) | ||
# { | ||
# return self; | ||
# } | ||
# Note that this directive has <em>no effect at all</em> | ||
# when placed at the method declaration: | ||
# | ||
# Note that this directive has <em>no effect at all</em> | ||
# when placed at the method declaration: | ||
# /* :nodoc: */ | ||
# rb_define_method(cMyClass, "do_something", something_func, 0); | ||
# | ||
# /* :nodoc: */ | ||
# rb_define_method(cMyClass, "do_something", something_func, 0); | ||
# The above comment is just a comment and has nothing to do with \RDoc. | ||
# Therefore, +do_something+ method will be reported as "undocumented" | ||
# unless that method or function is documented elsewhere. | ||
# | ||
# The above comment is just a comment and has nothing to do with \RDoc. | ||
# Therefore, +do_something+ method will be reported as "undocumented" | ||
# unless that method or function is documented elsewhere. | ||
# For a constant definition in C code, this directive <em>can not work</em> | ||
# because there is no "implementation" place for a constant. | ||
# | ||
# - For a constant definition in C code, this directive <em>can not work</em> | ||
# because there is no "implementation" place for a constant. | ||
# With argument +all+: | ||
# specifies that the class or module should not be documented. | ||
# By default, however, a nested class or module _will_ be documented. | ||
# | ||
# - <tt># :nodoc: all</tt>: | ||
# ====== <tt>:doc:</tt> | ||
# | ||
# - Appended to a line of code | ||
# that defines a class or module. | ||
# - Specifies that the class or module should not be documented. | ||
# By default, however, a nested class or module _will_ be documented. | ||
# - Appended to a line of code | ||
# that defines a class, module, method, alias, constant, or attribute. | ||
# - Specifies the defined object should be documented, even if it otherwise | ||
# would not be documented. | ||
# | ||
# - <tt># :doc:</tt>: | ||
# ====== <tt>:notnew:</tt> | ||
# | ||
# - Appended to a line of code | ||
# that defines a class, module, method, alias, constant, or attribute. | ||
# - Specifies the defined object should be documented, even if it otherwise | ||
# would not be documented. | ||
# - Appended to a line of code | ||
# that defines instance method +initialize+. | ||
# - Specifies that singleton method +new+ should not be documented. | ||
# By default, Ruby fakes a corresponding singleton method +new+, | ||
# which \RDoc includes in the documentation. | ||
# Note that instance method +initialize+ is private, and so by default | ||
# is not documented. | ||
# | ||
# - <tt># :notnew:</tt> (aliased as <tt>:not_new:</tt> and <tt>:not-new:</tt>): | ||
# | ||
# - Appended to a line of code | ||
# that defines instance method +initialize+. | ||
# - Specifies that singleton method +new+ should not be documented. | ||
# By default, Ruby fakes a corresponding singleton method +new+, | ||
# which \RDoc includes in the documentation. | ||
# Note that instance method +initialize+ is private, and so by default | ||
# is not documented. | ||
# Aliased as <tt>:not_new:</tt> and <tt>:not-new:</tt>). | ||
BurdetteLamar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# | ||
# For Ruby code, but not for other \RDoc sources, | ||
# there is a shorthand for <tt>:stopdoc:</tt> and <tt>:startdoc:</tt>: | ||
# there is a shorthand for <tt>:stopdoc:</tt> and <tt>:startdoc:</tt> | ||
BurdetteLamar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# | ||
# # Documented. | ||
# #-- | ||
|
@@ -528,45 +526,52 @@ | |
# | ||
# ===== Directive for Specifying \RDoc Source Format | ||
# | ||
# - <tt># :markup: _type_</tt>: | ||
# ====== <tt>:markup:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies the format for the \RDoc input; | ||
# parameter +type+ is one of: +rdoc+ (the default), +markdown+, +rd+, +tomdoc+. | ||
# See {Markup Formats}[rdoc-ref:RDoc::Markup@Markup+Formats]. | ||
# - Appears on a line by itself. | ||
# - Takes argument +format+. | ||
|
||
# - Specifies the format for the \RDoc input; | ||
# argument +format+ is one of: +rdoc+ (the default), +markdown+, +rd+, +tomdoc+. | ||
# See {Markup Formats}[rdoc-ref:RDoc::Markup@Markup+Formats]. | ||
# | ||
# ===== Directives for Method Documentation | ||
# | ||
# - <tt># :call-seq:</tt>: | ||
# ====== <tt>:call-seq:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies the calling sequence to be reported in the HTML, | ||
# overriding the actual calling sequence in the code. | ||
# See method #call_seq_directive. | ||
# | ||
# Note that \RDoc can build the calling sequence for a Ruby-coded method, | ||
# but not for other languages. | ||
# You may want to override that by explicitly giving a <tt>:call-seq:</tt> | ||
# directive if you want to include: | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies the calling sequence to be reported in the HTML, | ||
# overriding the actual calling sequence in the code. | ||
# See method #call_seq_directive. | ||
# - A return type, which is not automatically inferred. | ||
# - Multiple calling sequences. | ||
# | ||
# Note that \RDoc can build the calling sequence for a Ruby-coded method, | ||
# but not for other languages. | ||
# You may want to override that by explicitly giving a <tt>:call-seq:</tt> | ||
# directive if you want to include: | ||
# For C code, the directive may appear in a stand-alone comment. | ||
# | ||
# - A return type, which is not automatically inferred. | ||
# - Multiple calling sequences. | ||
# ====== <tt>:args:</tt> | ||
# | ||
# For C code, the directive may appear in a stand-alone comment. | ||
# - Appears on a line by itself. | ||
# - Takes argument +arg_names+. | ||
# - Specifies the arguments to be reported in the HTML, | ||
# overriding the actual arguments in the code. | ||
# See method #args_directive. | ||
# | ||
# - <tt># :args: _arg_names_</tt> (aliased as <tt>:arg:</tt>): | ||
# Aliased as <tt>:arg:</tt>. | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies the arguments to be reported in the HTML, | ||
# overriding the actual arguments in the code. | ||
# See method #args_directive. | ||
# ====== <tt>:yields:</tt> | ||
# | ||
# - <tt># :yields: _arg_names_</tt> (aliased as <tt>:yield:</tt>): | ||
# - Appears on a line by itself. | ||
# - Takes argument +arg_names+. | ||
# - Specifies the yield arguments to be reported in the HTML, | ||
# overriding the actual yield in the code. | ||
# See method #yields_directive. | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies the yield arguments to be reported in the HTML, | ||
# overriding the actual yield in the code. | ||
# See method #yields_directive. | ||
# Aliased as <tt>:yield:</tt>). | ||
BurdetteLamar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# | ||
# ===== Directives for Organizing Documentation | ||
# | ||
|
@@ -578,64 +583,68 @@ | |
# | ||
# You can use directives to modify those behaviors. | ||
# | ||
# - <tt># :section: _section_title_</tt>: | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that following methods are to be grouped into the section | ||
# with the given <em>section_title</em>, | ||
# or into the default section if no title is given. | ||
# The directive remains in effect until another such directive is given, | ||
# but may be temporarily overridden by directive <tt>:category:</tt>. | ||
# See below. | ||
# | ||
# The comment block containing this directive: | ||
# | ||
# - Must be separated by a blank line from the documentation for the next item. | ||
# - May have one or more lines preceding the directive. | ||
# These will be removed, along with any trailing lines that match them. | ||
# Such lines may be visually helpful. | ||
# - Lines of text that are not so removed become the descriptive text | ||
# for the section. | ||
# | ||
# Example: | ||
# | ||
# # ---------------------------------------- | ||
# # :section: My Section | ||
# # This is the section that I wrote. | ||
# # See it glisten in the noon-day sun. | ||
# # ---------------------------------------- | ||
# | ||
# ## | ||
# # Comment for some_method | ||
# def some_method | ||
# # ... | ||
# end | ||
# ====== <tt>:section:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Takes argument +section_title+. | ||
# - Specifies that following methods are to be grouped into the section | ||
# with the given <em>section_title</em>, | ||
# or into the default section if no title is given. | ||
# The directive remains in effect until another such directive is given, | ||
# but may be temporarily overridden by directive <tt>:category:</tt>. | ||
# See below. | ||
# | ||
# The comment block containing this directive: | ||
# | ||
# You can use directive <tt>:category:</tt> to temporarily | ||
# override the current section. | ||
# - Must be separated by a blank line from the documentation for the next item. | ||
# - May have one or more lines preceding the directive. | ||
# These will be removed, along with any trailing lines that match them. | ||
# Such lines may be visually helpful. | ||
# - Lines of text that are not so removed become the descriptive text | ||
# for the section. | ||
# | ||
# - <tt># :category: _section_title_</tt>: | ||
# Example: | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that just one following method is to be included | ||
# in the given section, or in the default section if no title is given. | ||
# Subsequent methods are to be grouped into the current section. | ||
# # ---------------------------------------- | ||
# # :section: My Section | ||
# # This is the section that I wrote. | ||
# # See it glisten in the noon-day sun. | ||
# # ---------------------------------------- | ||
# | ||
# ## | ||
# # Comment for some_method | ||
# def some_method | ||
# # ... | ||
# end | ||
# | ||
# You can use directive <tt>:category:</tt> to temporarily | ||
# override the current section. | ||
# | ||
# ====== <tt>:category:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Takes argument +section_title+. | ||
# - Specifies that just one following method is to be included | ||
# in the given section, or in the default section if no title is given. | ||
# Subsequent methods are to be grouped into the current section. | ||
# | ||
# ===== Directive for Including a File | ||
# | ||
# - <tt># :include: _filepath_</tt>: | ||
# ====== <tt>:include:</tt> | ||
# | ||
# - Appears on a line by itself. | ||
# - Takes argument +filepath+. | ||
# - Specifies that the contents of the given file | ||
# are to be included at this point. | ||
# | ||
# - Appears on a line by itself. | ||
# - Specifies that the contents of the given file | ||
# are to be included at this point. | ||
# The file content is shifted to have the same indentation as the colon | ||
# at the start of the directive. | ||
# The file content is shifted to have the same indentation as the colon | ||
# at the start of the directive. | ||
# | ||
# The file is searched for in the directory containing the current file, | ||
# and then in each of the directories given with the <tt>--include</tt> | ||
# command-line option. | ||
# The file is searched for in the directory containing the current file, | ||
# and then in each of the directories given with the <tt>--include</tt> | ||
# command-line option. | ||
# | ||
# For C code, the directive may appear in a stand-alone comment | ||
# For C code, the directive may appear in a stand-alone comment | ||
# | ||
# ==== Text Markup | ||
# | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide an example of how to use this? In the new documentation, it's not clear to me how this should be used.