<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Gluttonous: Documenting Rails</title>
    <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Documenting Rails</title>
      <description>&lt;p&gt;As many of you know, the documentation for Rails is lacking in several places. Several of us have taken it upon ourselves to clean things up where we can and we&amp;#8217;re trying to make a push for the community to help out.&lt;/p&gt;

&lt;h3&gt;Why write documentation?&lt;/h3&gt;

&lt;p&gt;There are several reasons why you might like to help with the documentation process even if you&amp;#8217;re not a writer.&lt;/p&gt;

&lt;h4&gt;Writing about Rails makes you learn&lt;/h4&gt;

&lt;p&gt;Just as they say teaching makes you better at your subject, writing about Rails will force you to learn about what you&amp;#8217;re documenting. Cleaning up documentation for the core codebase means that next time you&amp;#8217;d like to tweak options for associations, or write that web API you&amp;#8217;ve always wanted, or fix that bug that&amp;#8217;s been driving you insane for the last week &lt;strong&gt;you can&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;It means when you need to look something up, it&amp;#8217;s there&lt;/h4&gt;

&lt;p&gt;Writing documentation is good for you! When you forget the options for &lt;code&gt;url_for&lt;/code&gt; you&amp;#8217;d like there to be something to refresh your memory (this happens to me too). If everyone chips in a little, we all get a lot out of it. Additionally, when that new Rails developer on your team just doesn&amp;#8217;t remember how ActionMailer works it&amp;#8217;ll be easy to point them to the documentation when you know it exists and is readable.&lt;/p&gt;

&lt;h4&gt;It helps the community and just feels good&lt;/h4&gt;

&lt;p&gt;If you&amp;#8217;re reading my blog, it probably means you&amp;#8217;ve got some stake in Rails. For me, it&amp;#8217;s my day job. Rails is the reason I really enjoy my work. Writing about it and making it easier for others to have the same experience is really fulfilling for me. It&amp;#8217;s about giving back to the group that helped me when I was starting with Rails.&lt;/p&gt;

&lt;h3&gt;Ok, I&amp;#8217;m convinced. How can I help?&lt;/h3&gt;

&lt;p&gt;We&amp;#8217;d really love for everyone to help with the documentation, but we need to adhere to some style guidelines first to make sure that the new docs are up to par and won&amp;#8217;t need to be rewritten.&lt;/p&gt;

&lt;h4&gt;Write to teach&lt;/h4&gt;

&lt;p&gt;Rails documentation is not an academic paper. The point is to describe what a developer needs to know in order to use the section of the API that you&amp;#8217;re writing for. For example, in my rewrite of the ActionMailer documentation (&lt;a href="http://dev.rubyonrails.org/browser/trunk/actionmailer/lib/action_mailer/base.rb?rev=4332"&gt;here&lt;/a&gt;) I made sure to cover the basic usages of ActionMailer as headings so someone can easily find what they&amp;#8217;re looking for.&lt;/p&gt;

&lt;h4&gt;An example is worth 1000 non-example characters&lt;/h4&gt;

&lt;p&gt;Examples are key. Do say what the class is used for, but make it easy on people who don&amp;#8217;t want to know about every facet of the &lt;code&gt;render&lt;/code&gt; method. Give them an example &lt;em&gt;how&lt;/em&gt; to use the method as well and you&amp;#8217;ll have happy coders.&lt;/p&gt;

&lt;h4&gt;Don&amp;#8217;t repeat yourself!&lt;/h4&gt;

&lt;p&gt;If we&amp;#8217;re working with the &lt;code&gt;ActsAsList&lt;/code&gt; module and it has a method that looks like &lt;code&gt;insert_at(position = 1)&lt;/code&gt;, you probably don&amp;#8217;t need to say that the method inserts an item in the list at a position, defaulting to 1.&lt;/p&gt;

&lt;h3&gt;Writing docs with RDoc&lt;/h3&gt;

&lt;p&gt;Rails documentation is generated by RDoc so you&amp;#8217;ll want to become familiar with it. The Pragmatic Programmers have an excellent explanation of how to use RDoc in Programming Ruby 2nd Edition and the &lt;a href="http://rdoc.sourceforge.net/doc/index.html"&gt;RDoc Documentation&lt;/a&gt; has a section dedicated to an example and markup. The Rails documentation can also be used as a reference on how to write RDoc. Please familiarize yourself with the basics and follow the conventions you see in the Rails source.&lt;/p&gt;

&lt;p&gt;The two things I use most often in documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;tt&amp;gt;something&amp;lt;tt&amp;gt;&lt;/code&gt; or &lt;code&gt;+something+&lt;/code&gt; are used to make text typewriter style and should be used for method names&lt;/li&gt;
&lt;li&gt;An indented block will display as code. For example:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;# Examples:
#
#  class MyMailer &amp;lt; ActionMailer::Base
#     # Set up properties
#     # Properties can also be specified via accessor methods
#     # (i.e. self.subject = &amp;quot;foo&amp;quot;) and instance variables (@subject = &amp;quot;foo&amp;quot;).
#     def signup_notification(recipient)
#       recipients recipient.email&lt;em&gt;address&lt;/em&gt;with_name
#       subject    &amp;quot;New account information&amp;quot;
#       body       &amp;quot;account&amp;quot; =&amp;gt; recipient
#       from       &amp;quot;system@example.com&amp;quot;
#     end
#  end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Generating the RDoc to check your changes&lt;/h4&gt;

&lt;p&gt;Generating the RDoc for the project you&amp;#8217;re working in (ActiveRecord,ActionPack,ActionMailer etc) can be done with the command &lt;code&gt;rake rdoc&lt;/code&gt; in the project directory. I have added an option to the ActionPack Rakefile so that you can generate RDoc for select files using &lt;code&gt;rake rdoc DOC_FILES=FILE1,FILE2&lt;/code&gt; this should probably be added to ActiveRecord, but ActionMailer has so few files as it is that it probably doesn&amp;#8217;t need it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please remember to look at the files RDoc will generate before turning in a patch!&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;And finally, the quick version of the submission process&amp;#8230;&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Grab the source by following the directions at &lt;a href="http://dev.rubyonrails.org"&gt;dev.rubyonrails.org&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Choose what documentation you want to write or improve.&lt;/li&gt;
&lt;li&gt;Make sure someone else isn&amp;#8217;t already working on it by checking at the &lt;a href="http://dev.rubyonrails.org/report/20"&gt;documentation report&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a ticket at the &lt;a href="http://dev.rubyonrails.org"&gt;Rails Trac page&lt;/a&gt; describing the section that needs cleanup and why. &lt;strong&gt;Make sure to add the &amp;#8216;docs&amp;#8217; keyword to the ticket.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Make your change and generate the RDoc to proofread&lt;/li&gt;
&lt;li&gt;Create a diff with &lt;code&gt;svn diff &amp;gt; my_diff_file.diff&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Attach your diff file to the ticket you created in step 3, and change the ticket title so that [PATCH] is at the front.&lt;/li&gt;
&lt;li&gt;Watch your ticket (if you gave your email, you&amp;#8217;ll be notified upon changes) and make changes if they&amp;#8217;re needed. If things go well then you&amp;#8217;ll have your documentation in the core!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Go, do it!&lt;/h3&gt;

&lt;p&gt;That&amp;#8217;s all I&amp;#8217;ve got. Lets make sure the Rails documentation is getting progressively better. It&amp;#8217;s just The Right Thing.&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 14:52:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d85bde95-bff6-40e8-852b-136b6bda731c</guid>
      <author>kev</author>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails</link>
      <category>Rails</category>
    </item>
    <item>
      <title>"Documenting Rails" by Conor</title>
      <description>&lt;p&gt;Hullo,&lt;/p&gt;


	&lt;p&gt;You should check out my documentation project for Rails (well actually for any RDoc). I&amp;#8217;ve been working on and off on it for a bit now. User annotations and searching:&lt;/p&gt;


	&lt;p&gt;&lt;a&gt;http://rails.outertrack.com&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I think this might help a lot with documentation like this. Have Rails users annotate the documentation and then roll some of the comments into the official documentation. I believe this is how the PHP project does it.&lt;/p&gt;


	&lt;p&gt;Drop me an email at conor . hunt AT gmail . com if you are interested.&lt;/p&gt;</description>
      <pubDate>Mon, 15 May 2006 10:37:55 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:7fd17a86-c8a5-42a2-92ae-f4fb741e8bce</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-844</link>
    </item>
    <item>
      <title>"Documenting Rails" by Paul Stamatiou</title>
      <description>&lt;p&gt;Awesome site Kevin.  I&amp;#8217;ve just picked up the Agile Web Dev w/ Rails book and am planning on learning a bit over the summer.  I&amp;#8217;ve added your feed to my feedlounge account.&lt;/p&gt;</description>
      <pubDate>Fri, 12 May 2006 12:32:40 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:113e0c6d-fc2b-4616-9dff-769a89fa28b6</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-843</link>
    </item>
    <item>
      <title>"Documenting Rails" by Kevin Clark</title>
      <description>&lt;p&gt;anon: 1,2 and 8 aren&amp;#8217;t really full steps and 1 only needs to happen once. How would you suggest we automate the rest?&lt;/p&gt;


	&lt;p&gt;Frederick: I understand (and don&amp;#8217;t fully disagree) but as it has been given to me (who is as reliant on the core as you are), docs like the ActsAsList example won&amp;#8217;t be checked in.&lt;/p&gt;</description>
      <pubDate>Thu, 11 May 2006 16:12:02 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:25de6ab8-6d91-4152-99e9-b5d7dc44076b</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-842</link>
    </item>
    <item>
      <title>"Documenting Rails" by anon</title>
      <description>&lt;p&gt;8 steps is too many for each submission.  get a better way of submitting with some automation and you would have a better chance of getting submissions.  automate more.&lt;/p&gt;</description>
      <pubDate>Thu, 11 May 2006 08:57:32 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:de44e7e6-36cc-43c3-ba6c-4d6ed7e142ca</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-841</link>
    </item>
    <item>
      <title>"Documenting Rails" by Frederick Ros</title>
      <description>&lt;p&gt;Well regarding the ActsAsList example (and you know why ;), I&amp;#8217;ve to say that a lot of peole I work with consider the doc as being incompletes because when looking at the HTML page there&amp;#8217;s nothing written down bellow the insert_at method &amp;#8230;&lt;/p&gt;</description>
      <pubDate>Thu, 11 May 2006 07:27:18 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:43553765-6130-4a78-bf43-086c9072f181</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-839</link>
    </item>
    <item>
      <title>"Documenting Rails" by observer</title>
      <description>&lt;p&gt;Well, Django has a documentation system which has a tutorial which is kept in step with the changing codebase.&lt;/p&gt;


	&lt;p&gt;I think Rails core documentation team should look into something like that. One other thing that I liked about them is that the &amp;#8220;Django book&amp;#8221; would be open-source..&lt;/p&gt;


	&lt;p&gt;something the rails community should consider. Students and Rails afficionados in poorer financial situation would appreciate it. Not everyone is making 100/hr doing rails programming ya know.&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 20:33:38 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e1d4d103-2c02-4115-a793-79b084b784b2</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-838</link>
    </item>
    <item>
      <title>"Documenting Rails" by Kian</title>
      <description>&lt;p&gt;This is a great idea. I saw Josh Susser last night at the SF Ruby Meetup and he really inspired us to go for the doc.&lt;/p&gt;


	&lt;p&gt;Do you have any ideas about what sections of the API documentation really could use the most help?&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 19:54:53 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d5387ee7-203e-4f5e-a499-a97b780bf854</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-837</link>
    </item>
    <item>
      <title>"Documenting Rails" by Eric A.</title>
      <description>&lt;p&gt;Kevin, awesome write up.  It has inspired me to do some documentation.  I think it would be handy to make a list of the areas that need the most work.  Im gonna get into this more tonight and tomorrow since I dont have class tomorrow, and this would be a good way to get into contributing code as well.&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 18:22:32 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5c53111c-d454-45c7-a373-8079db1ee662</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-836</link>
    </item>
    <item>
      <title>"Documenting Rails" by Kevin Clark</title>
      <description>&lt;p&gt;dudus: Awesome. You don&amp;#8217;t need to be an expert, just willing to put in the time to get it right.&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 17:14:28 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:441861b4-9eee-446c-ac0e-dd4f166ab402</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-835</link>
    </item>
    <item>
      <title>"Documenting Rails" by .dudus</title>
      <description>&lt;p&gt;This looks great. Not a rails expert but I may try to help&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 17:07:59 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:65cf98a5-4865-4e2c-be33-6b6267f61b93</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-834</link>
    </item>
    <item>
      <title>"Documenting Rails" by Piotr Usewicz</title>
      <description>&lt;p&gt;Great! Make it as good as PHP docs are!&lt;/p&gt;</description>
      <pubDate>Wed, 10 May 2006 16:45:40 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:f31e6665-2b2e-45c2-804b-e5c611cbd3c2</guid>
      <link>http://glu.ttono.us/articles/2006/05/10/documenting-rails#comment-833</link>
    </item>
  </channel>
</rss>

