Description What problem does this solve? • Installation Instructions How do I get this thing working? • Links to More Docs Ok I want more info, now what? • How to Contribute This is cool, how can I join? • Credits, Alternatives Where did this idea come from? http://warpspire.com/talks/documentation/ http://xkcd.com/293/
Description What problem does this solve? • Installation Instructions How do I get this thing working? • Links to More Docs Ok I want more info, now what? • How to Contribute This is cool, how can I join? • Credits, Alternatives Where did this idea come from? http://warpspire.com/talks/documentation/ http://xkcd.com/293/
goes a long way to documenting your code • Use Good descriptive naming • Most methods are short http://geekandpoke.typepad.com/geekandpoke/2013/02/self-documenting-code.html
"The short answer is that we don't document our projects [...] most Rails programmers would know their way around our applications straight away. It's the same conventions and pattern throughout...." • That’s not to say that there are no code comments in our code bases. Just very little. And usually only to describe something that looks like it shouldn’t be the way that it is. Something counterintuitive. http://37signals.com/svn/posts/838-ask-37signals-how-do-you-document-code? 34#all_comments
• Uses the comments in source to create Its Simple: Run (In the root dir of you app) rake doc:app Main page at: doc/app/index.html *Change the README_FOR_APP
wiki pages markup • Also supports Markdown, Rd, TomDoc, and even your own style! • Markup Guides Cheat Sheet http://jan.varwig.org/wp-content/uploads/2006/09/Rdoc%20Cheat%20Sheet.pdf RDoc Example for documenting classes and methods http://blog.firsthand.ca/2010/09/ruby-rdoc-example.html Rdoc::Markup Documentation http://rdoc.rubyforge.org/RDoc/Markup.html
Write in present tense... #Returns a cat that is in attack mode instead of #Returned a cat that is in attack mode • Document any edge cases (What happens if the cat is already in that mode?) • Basic contents: - Description - Parameters and Options - Examples of Usage http://guides.rubyonrails.org/api_documentation_guidelines.html
RDoc but has some extra features - supports a variety of markup formats - has tools to view documentation as you write it - adds tags to make comments shorter and add metadata @return [Cat] the feline in attack mode @author Devilish God