Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions doc/rdoc/markup_reference.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require 'rdoc'

# This page is about RDoc's +rdoc+ input format,
# which here we'll call "RDoc markup" or simply "markup."
#
# == About This \Class
#
# \Class \RDoc::MarkupReference exists only to provide a suitable home
# for a reference document for \RDoc markup.
#
Expand All @@ -21,43 +26,50 @@
# >>>
# Some stuff
#
# == \RDoc Sources
# == Markup Sources
#
# The sources of \RDoc documentation vary according to the type of file:
# The sources of markup documentation vary according to the type of file:
#
# - <tt>.rb</tt> (Ruby code file):
#
# - Markup may be found in Ruby comments:
# A comment that immediately precedes the definition
# of a Ruby class, module, method, alias, constant, or attribute
# becomes the documentation for that defined object.
# - An \RDoc directive may be found in:
# - A markup directive may be found in:
#
# - A trailing comment (on the same line as code);
# see <tt>:nodoc:</tt>, <tt>:doc:</tt>, and <tt>:notnew:</tt>.
# - A single-line comment;
# see other {Directives}[rdoc-ref:RDoc::MarkupReference@Directives].
#
# - Documentation may be derived from the Ruby code itself;
# see {Documentation Derived from Ruby Code}[rdoc-ref:RDoc::MarkupReference@Documentation+Derived+from+Ruby+Code].
# see {Derived Documentation}[rdoc-ref:RDoc::MarkupReference@Derived+Documentation].
#
# - <tt>.c</tt> (C code file): markup is parsed from C comments.
# A comment that immediately precedes
# a function that implements a Ruby method,
# or otherwise immediately precedes the definition of a Ruby object,
# becomes the documentation for that object.
# - <tt>.rdoc</tt> (\RDoc markup text file) or <tt>.md</tt> (\RDoc markdown text file):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we're losing the information here that we generate docs from markdown files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that this is the markup reference. I don't know whether a markup file can declare itself as markdown. But will restore if you like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Might be good to include it in a separate bullet point and make it clear that the rest of this guide doesn't apply since it's markdown. This section seems to list all of the sources that RDoc generates documentation from.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info added.

# - <tt>.rdoc</tt> (markup file):
# markup is parsed from the entire file.
# The text is not associated with any code object,
# but may (depending on how the documentation is built)
# become a separate page.
#
# An <i>RDoc document</i>:
# Note that all of the above applies to \RDoc <tt>markup</tt>-formatted documentation:
#
# - A C- or \Ruby-coded file may contain <tt>markdown</tt>-formatted documentation,
# though that format must be declared (because the default is +markup+).
# - A markdown (<tt>.md</tt>) file contains only <tt>markdown</tt>-formatted documentation.
#
# == Markup Document
#
# The term <i>markup document</i> refers to one of:
#
# - A (possibly multi-line) comment in a Ruby or C file
# that generates \RDoc documentation (as above).
# - The entire markup (<tt>.rdoc</tt>) file or markdown (<tt>.md</tt>) file
# (which is usually multi-line).
# that generates documentation (as above).
# - An entire markup file (i.e., a file with extension <tt>.rdoc</tt>).
#
# === Blocks
#
Expand Down Expand Up @@ -1140,14 +1152,15 @@
# - A double escape character \\ that is rendered
# as a single backslash.
#
# == Documentation Derived from Ruby Code
# == Derived Documentation
#
# [Class]
#
# By default, \RDoc documents:
#
# - \Class name.
# - Parent class.
# - Included modules.
# - Singleton methods.
# - Instance methods.
# - Aliases.
Expand All @@ -1159,6 +1172,7 @@
# By default, \RDoc documents:
#
# - \Module name.
# - Included modules.
# - \Singleton methods.
# - Instance methods.
# - Aliases.
Expand Down
Loading