• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Literate Maruku
 

Literate Maruku

on

  • 4,802 views

Introductory talk on Literate Maruku, the first gem released by the Ruby User Group Berlin - rug-b.

Introductory talk on Literate Maruku, the first gem released by the Ruby User Group Berlin - rug-b.

Statistics

Views

Total Views
4,802
Views on SlideShare
4,756
Embed Views
46

Actions

Likes
0
Downloads
13
Comments
0

3 Embeds 46

http://www.nach-vorne.de 22
http://blog.s21g.com 21
http://www.slideshare.net 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

    Literate Maruku Literate Maruku Presentation Transcript

    • Literate Maruku www.rug-b.com/wiki/show/schmidt 2007-10-04
    • Literate Programming Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. --- Donald E. Knuth (1984)
    • Implemented in • WEB, CWEB, noweb • (Pascal, C, any) Code embedded in LaTeX • RubyWeb • Extended RDoc syntax • Literate Ruby (Ruby Quiz #102)
    • but my problem was ...
    • Primary use case • Write documentation for a library • Usage examples • Tutorials • How-Tos
    • Primary use case • Write documentation for a library • Usage examples Be sure that • Tutorials they work ! • How-Tos Make them tests !!!
    • Some lines in test_helper.rb • For more information see Executable code in usage examples (rubyurl.com/0fO) # The String class provides a * method # which allows easy duplication. example do output_of(quot;blaquot; * 2) == quot;blablaquot; output_of(quot;blaquot; * 3) == quot;blablablaquot; end
    • Want that on a website?
    • RDoc ???
    • RDoc ??? Annotates methods and classes, not blocks
    • Literate Maruku
    • Libraries and Names • Maruku is as Markdown library for Ruby • Markdown was originally done for Perl • BlueCloth is the most popular implementation • Maruku is better !!!
    • Markdown Markdown Heading ================ A paragraph is separated by nn. * a bullet list > a quote a code block
    • Maruku brings Meta data Markdown Heading ================ A paragraph is separated by nn. {: class=introduction} This will be replaced with a table of contents... {: toc}
    • Literate Maruku brings fun ### String#* The String class provides a `*` method which allows easy duplication. example do output_of(quot;blaquot; * 2) == quot;blablaquot; output_of(quot;blaquot; * 3) == quot;blablablaquot; end {: execute} string.mkd
    • Literate Maruku brings fun ### String#* $ literate_maruku string.mkd The String class provides a `*` method # executes the file which allows easy duplication. # like “ruby string.rb“ does example do $ literate_maruku --output-dir=. string.mkd output_of(quot;blaquot; * 2) == quot;blablaquot; # executes the file output_of(quot;blaquot; * 3) == quot;blablablaquot; # and end generates string.html {: execute} string.mkd
    • But ... No stack traces !
    • Where can I get it? $ gem install literate_maruku rug-b.rubyforge.org/literate_maruku
    • Example usage in ContextR
    • ???