Introduction to RDoc
Upcoming SlideShare
Loading in...5
×
 

Introduction to RDoc

on

  • 2,596 views

RDoc at the May Rails Sydney meetup

RDoc at the May Rails Sydney meetup

Statistics

Views

Total Views
2,596
Views on SlideShare
2,565
Embed Views
31

Actions

Likes
1
Downloads
32
Comments
0

3 Embeds 31

http://toolmantim.com 23
http://falkayn.blogspot.com 5
http://www.slideee.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to RDoc Introduction to RDoc Presentation Transcript

    • pre-show interlude
    • RDoc
    • GEMS of OCEANIA what basics do we need for a newcomer to publish their first gem?
    • the Perils of Documentation
    • skills technical skills (see: this preso), writing skills (sorry, cant help)
    • time writing documentation and keeping it up-to-date takes time
    • change code and architecture changes, domain changes e.g. wikis and .docs get dusty & crufty
    • RDoc let us see how RDoc addresses these perils
    • skills theyre just Ruby comments, with a few formatting tags it autolinks, autogenerates, etc. Your mum could RDoc (maybe, ok prolly not)
    • for those writing skills...
    • time theyre just comments. You dont need to document the self-explanatory, but chances are youre already commenting tricky bits of code. Why not use that to create reference docs?
    • change its in your code, therefore the chance of it staying up-to-date is high
    • Demo I running RDoc on a simple file: rdoc somefile.rb
    • RDocTask
    • require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| files = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'test/*.rb'] rdoc.rdoc_files.add(files) rdoc.main = quot;READMEquot; # page to start on rdoc.title = quot;My App's Documentationquot; rdoc.rdoc_dir = 'doc' # rdoc output folder rdoc.options << '--line-numbers' << '--inline-source' end
    • Demo II creating a Rakefile with an RDocTask, then seeing what Rake tasks it creates, and finally running rake: rake -T; rake doc
    • Rails
    • $ rake -T doc rake doc:app # Build the app HTML Files rake doc:clobber_app # Remove rdoc products rake doc:clobber_plugins # Remove plugin documentation rake doc:clobber_rails # Remove rdoc products rake doc:plugins # Generate documation for all installed plugins rake doc:rails # Build the rails HTML Files rake doc:reapp # Force a rebuild of the RDOC files rake doc:rerails # Force a rebuild of the RDOC files
    • Demo III generating docs for your Rails app: rake doc:app; rake doc:api
    • Sexiness
    • Demo IV using Evan Weavers Allison RDoc template My suggestion: use that and customise the CSS.
    • interlude
    • Formatting
    • = Level One Heading == Level Two Heading etc. headings!
    • # Here’s a list: # # * Item 1 # * Item 2 lists!
    • # Add another: # # 1. Item 1 # 2. Item 2 lists again!
    • :nodoc: Prevent RDoc from documenting a class, method or module.
    • :nodoc:all Prevent RDoc from documenting a class or module and all of the bits within it.
    • :doc: Force RDoc to include a class, module or method in the documentation.
    • def fred # :yields: index, position ... yield line, address RDoc automatically tries to figure out what your method yields from the variable names. Using :yields: you can override this.
    • post-show interlude
    • Thanks! Tim Lucas toolmantim.com