Feature Requests: Browse | Submit New | Admin

[#21369] More Descriptive Markup for RDoc

Date:
2008-07-29 00:47
Priority:
3
Submitted By:
Designing Patterns (designingpatts)
Assigned To:
Nobody (None)
Category:
RDoc::Markup
State:
Open
Summary:
More Descriptive Markup for RDoc

Detailed description
I have some spare time and a strong interest in documentation.  I’d like to enhance rdoc in a few ways, as I think
it is a wonderful tool.  Here is the first of my proposals:

I think that rdoc has one serious shortcoming relative to the other documentation generation tools that I have used
(javadoc and rdoc): rdoc does not have any descriptive markup for source code.  That is, it has no way to describe parameters
(@param in doxygen/javadoc), return values (@return in doxygen/javadoc), or possible exceptions (@throw in doxygen,
@throws in javadoc).  If one wants functionality like this, one must use the existing markup for formatting purposes.
For instance, for this method definition:

def load(reader, containing_object_name = "")

I have an emacs macro that adds the following above the definition:
# 
# ====Description:
# 
# 
# ====Parameters:
# [reader]
#      ?
# [containing_object_name = ""]
#      ?
# 
# ====Returns:
# 
#

I can fill this in, and, given the template that I use, the results look pretty good (see
http://configtoolkit.rubyforge.org/classes/ConfigToolkit/BaseConfig.html#M000017).

This is, however, a poor solution for several reasons:
1.)	The formatting of parameters and return values is baked into the source code.  Since I can’t really describe parameters
or return values, I’m describing their formatting.  Changing the formatting requires changing the source code.
2.)	Whether or not the parameters and return values appear reasonably in the output is accidentally dependent on the
template used.  If rdoc’s markup could describe parameters and return values directly, however, the template creators
specifically could support these constructs.
3.)	This practice is not at all standard in the Ruby community.

I lean towards using the javadoc/doxygen markup as they’re quite standard:
\param
\return
\throw 

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-07-01 12:04
Sender: Roger Pack

yard, too
=r
Date: 2008-07-30 00:21
Sender: Designing Patterns

Another possibility for the markup is to use ROBODOC
(http://en.wikipedia.org/wiki/ROBODoc)/NaturalDocs
(http://en.wikipedia.org/wiki/Natural_Docs) markup:

Parameters:

Returns:

I actually like this style of markup better, since I think it
more readable, but the javadoc/doxygen style has the advantage
of being more industry-standard...

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item