Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Documentation is freaking awesome

Kyle Neath
February 08, 2011

Documentation is freaking awesome

I have a confession: I love documentation — and I don't just mean code comments. I mean documentation of every form. I want to introduce you to the breadth of documentation styles and forms. I want to show you how to produce beautiful generated documentation. I want to explain what makes an awesome README. How to build an amazing marketing website for your library. I want to gush about why I think writing TomDoc is going to make you write better code.

Ruby is such an expressive language that your code can end up looking like anything you can imagine. Documentation is paramount in helping others understand why and how they should be using your code.

Kyle Neath

February 08, 2011
Tweet

More Decks by Kyle Neath

Other Decks in Programming

Transcript

  1. It’s not if the library exists... It’s whether I can

    figure out how to use the @!&*# thing
  2. ######################################################################### # # Tags # ######################################################################### # Extract all tags

    into the tagmap and replace with placeholders. # # data - The raw String data. # # Returns the placeholder'd String data. def extract_tags(data) data.gsub(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do if $1 == "'" && $3 != "'" "[[#{$2}]]#{$3}" elsif $2.include?('][') $& else id = Digest::SHA1.hexdigest($2) @tagmap[id] = $2 "#{$1}#{id}#{$3}" end end end # Process all tags from the tagmap and replace the placeholders with the # final markup. CODE COMMENTS
  3. # Reverses the contents of a String or IO object.

    # # @param [String, #read] contents the contents to reverse # @return [String] the contents reversed lexically def reverse(contents) ... end
  4. # Extract all code blocks into the codemap and replace

    # with placeholders. # # data - The raw String data. # # Returns the placeholder'd String data. def extract_code(data) ... end
  5. “Top ten reasons why I wont use your open source

    project” Wynn Netherland pengwynn
  6. Knowing how someone feels about code is valuable # XXX:

    I hate myself and want to die. # --rtomayko 2010-05-27
  7. .br \fBronn\fR < \fIfile\fR . .SH "DESCRIPTION" \fBRonn\fR converts textfiles

    to standard roff\- formatted UNIX manpages or HTML\. ronn\-format(7) is based on markdown(7) but includes additional rules and syntax geared toward authoring manuals\. . man pages are written in roff
  8. .br \fBronn\fR < \fIfile\fR . .SH "DESCRIPTION" \fBRonn\fR converts textfiles

    to standard roff\- formatted UNIX manpages or HTML\. ronn\-format(7) is based on markdown(7) but includes additional rules and syntax geared toward authoring manuals\. . man pages are written in roff but roff is dumb
  9. ## DESCRIPTION **Ronn** converts textfiles to standard roff- formatted UNIX

    manpages or HTML. ronn-format(7) is based on markdown(7) but includes additional rules and syntax geared toward authoring manuals. use ronn instead Get HTML generation for free