Professional Web Applications Themes

A good way to do a book? - Ruby

http://www.sourcebeat.com/index.jsp It would be great to get a "Ruby Live" book going. I like the idea of having a book in PDF format that gets updated continually. It would be an ever evolving book on the goodness of Ruby....

  1. #1

    Default A good way to do a book?

    http://www.sourcebeat.com/index.jsp

    It would be great to get a "Ruby Live" book going. I like the idea of
    having a book in PDF format that gets updated continually. It would be
    an ever evolving book on the goodness of Ruby.
    Bob Guest

  2. #2

    Default Re: A good way to do a book?


    "Bob" <org> schrieb im Newsbeitrag
    news:google.com... 

    .... or goddess. :-)

    Pun is fun!

    robert

    Robert Guest

  3. #3

    Default Re: A good way to do a book?

    Bob wrote: 

    As far as I read on that site, it's about $30 per book per year. If I
    participated in writing an open source book about Ruby, I'd rather do
    that for free (as in free beer ;-) [but I would accept being paid for it
    .... :-D ]. However there's the pickaxe book already, which is exellent
    (both both the English edition right in 2001, and the German edition
    when it was 'on sale' at the local book store - and I use the e-dition
    quite a lot)

    Happy Rubying

    Stephan
    Stephan Guest

  4. #4

    Default Re: A good way to do a book?

    Stephan wrote: 
    >
    >
    > As far as I read on that site, it's about $30 per book per year. If I
    > participated in writing an open source book about Ruby, I'd rather do
    > that for free (as in free beer ;-) [but I would accept being paid for it
    > ... :-D ]. However there's the pickaxe book already, which is exellent
    > (both both the English edition right in 2001, and the German edition
    > when it was 'on sale' at the local book store - and I use the e-dition
    > quite a lot)
    >
    > Happy Rubying
    >
    > Stephan[/ref]
    They are working out subscriptions. The initial $30 is for a first purchase.
    Robert Guest

  5. #5

    Default Re: A good way to do a book?

    Hi!

    * Bob: 

    I don't know of an affordable PDF editor. Minimalistic HTML plus CSS?

    Josef 'Jupp' SCHUGT
    --
    http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby-FAQ
    http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Germany 2004: To boldly spy where no GESTAPO / STASI has spied before


    Josef Guest

  6. #6

    Default Re: A good way to do a book?

    On Feb 16, 2004, at 4:38 PM, Josef 'Jupp' SCHUGT wrote: 

    That would make good sense to me.

    (FWIW, those who have MacOS X already have PDF 'print' capabilities
    from any application, so PDFs could be created from, say, HTML+CSS)



    Gavin Guest

  7. #7

    Default Re: A good way to do a book?

    On Mon, 2004-02-16 at 19:00, Gavin Kistner wrote: 
    >
    > That would make good sense to me.
    >
    > (FWIW, those who have MacOS X already have PDF 'print' capabilities
    > from any application, so PDFs could be created from, say, HTML+CSS)
    >[/ref]

    So does KDE directly from the print dialog.Or any un*x box with the
    ps2pdf command.

    Guillaume.




    Guillaume Guest

  8. #8

    Default Re: A good way to do a book?

    Josef 'Jupp' SCHUGT wrote:
     

    So use TeX, who can really afford, or want to buy, stuff like InDesign
    (bar piracy) anyways?

    --
    That's some catch, that Catch-22.
    Oh, it's the best there is.



    Shu-yu Guest

  9. #9

    Default Re: A good way to do a book?

    Shu-yu Guo wrote:
     
    >
    > So use TeX, who can really afford, or want to buy, stuff like InDesign
    > (bar piracy) anyways?[/ref]

    Or, if you prefer to work at a slightly higher level, LaTeX.

    Harry O.



    Harry Guest

  10. #10

    Default Re: A good way to do a book?

    > I don't know of an affordable PDF editor. Minimalistic HTML plus CSS?

    OpenOffice will export to PDF.


    Also, there was an attempt at a community-driven Ruby book at
    http://www.rubydoc.org/book.

    Good writing is time-consuming, and hard to do well. A Ruby book,
    unless its something along the lines of a cookbook or "Ruby Hacks,"
    should have a consistent author's voice and theme. If it purports to
    teach people Ruby, then what is offered in the early chapters should lay
    the foundation for more advanced and interesting topics later on.

    I've worked on a few Wrox books where 8-to-12 writers were all pitching
    in on different topics. While the books were constructed to have a
    central theme, they often came off as a collection of magazine articles.

    This can be useful, but I don't think we need to think in terms of a
    book in order to assemble a collection of tutorials.



    James






    James Guest

  11. #11

    Default Re: A good way to do a book?

    >> I don't know of an affordable PDF editor. Minimalistic HTML plus CSS? 

    IMHO the most sensible technology to use for a new collaborative Ruby book
    would be WikiMedia. See http://www.wikibooks.org.

    However, http://www.rubydoc.org/book/ is an existing collaborative Ruby
    book. Why start another when you can help that?

    These things just don't tend to happen, for the reasons James mentioned:
    difficult and time consuming.

    Gavin




    Gavin Guest

  12. #12

    Default Re: A good way to do a book?

    Hi!

    * Harry Ohlsen: 
    > >
    > >So use TeX, who can really afford, or want to buy, stuff like
    > >InDesign (bar piracy) anyways?[/ref]
    >
    > Or, if you prefer to work at a slightly higher level, LaTeX.[/ref]

    I don't think that the actual format is very important. What is
    needed?

    Headlines of several levels
    Paragraphs
    italics, bold, typewriter
    Preformatted text
    Itemization
    Enumeration
    Description lists
    Tables
    Graphics

    This can be done in HTML 3.2+, LaTeX, RTF and even in Ruby.

    Yes, Ruby. The german edition of the comp.lang.ruby FAQ is a Ruby
    script that generates HTML and LaTeX.

    http://oss.erdfunkstelle.de/ruby/FAQ.rb

    It may sound a bit strange but it was a proof of concept and it
    works. All other representations are generated from the Ruby source.

    Josef 'Jupp' SCHUGT
    --
    http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby-FAQ
    http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Germany 2004: To boldly spy where no GESTAPO / STASI has spied before


    Josef Guest

  13. #13

    Default Re: A good way to do a book?

    "Josef 'Jupp' SCHUGT" <de> writes:
     
    >
    > I don't know of an affordable PDF editor. Minimalistic HTML plus CSS?[/ref]

    AFAIK, OpenOffice can export PDF.

    kind regards
    frank

    --
    Frank Schmitt
    quattro research GmbH
    e-mail: schmitt NO at SPAM quattro-research !! dot com
    Frank Guest

  14. #14

    Default Re: A good way to do a book?

    docbook is an option. Is *cough*xml*cough* but goes to pdf, html, or
    print equally easily

    -Brian

    On Feb 19, 2004, at 11:53 AM, Austin Ziegler wrote:
     
    >
    > OpenOffice.
    >
    > -austin
    > --
    > austin ziegler * ca * Toronto, ON, Canada
    > software designer * pragmatic programmer * 2004.02.19
    > * 11.52.41
    >
    >
    >
    >[/ref]




    Brian Guest

  15. #15

    Default Writing doents in Ruby (Was: A good way to do a book?)

    Hi!

    I think it is a good idea to illustrate how Ruby can be used as a
    markup language. I therefore wrote an example doent and a class
    that generates HTML out of it. It is a quick hack but should give an
    idea of how a more complex solution (including a couple of output
    formats) could look like. For more take a look at the source of the
    German comp.lang.ruby FAQ at http://oss.erdfunkstelle.de/ruby/

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Doent in Ruby

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    #!/usr/bin/env ruby

    require "layout"

    Fmt = HTML

    d = Fmt.new("Doentation of Ruby in Ruby", "Josef 'Jupp' Schugt")
    d.h1("Isn't that an absurd idea?")
    d.p(
    "At first sight it may seem absurd to use a " +
    Fmt.i("programming") +
    " language to write doents but it makes perfect sense. It requires
    surprisingly little effort to write doentations in Ruby."
    )
    d.p(
    "That simplicity results from Ruby's " + Fmt.i("object-oriented") +
    " features."
    )
    d.p("Some of the advantages of using Ruby:")
    d.ol([
    "People who doent Ruby can be assumed to be familiar with Ruby's
    syntax.",
    "The formatting capabilities can easily be restricted or expanded
    according to the needs.",
    "It is very simple to generated any output format you like by
    simply instantiating the appropriate class.",
    "Separation of structure and layout is very strict.",
    "Output generation is incredibly fast.",
    ])
    d.h1('What is needed?')
    d.p(
    "One needs very few means to typeset a book. As a rule of thumb one
    can say that the typographic quality of a book " +
    Fmt.i("decreases") + " with an " + Fmt.i("increasing") +
    " number of typographic means used (unless you " + Fmt.b("really") +
    " know what you are doing)."
    )
    d.p(
    "If you think you need more than what is mentioned in the following
    list you should consider reading a good book on typography."
    )
    d.ul([
    "Headlines of several levels",
    "Paragraphs",
    "italics, bold, and typewriter font",
    "Preformatted text",
    "Itemization",
    "Enumeration",
    "Description lists",
    "Tables",
    "Graphics",
    ])
    d.h1("Stuff not used above")
    d.p("The stuff that hasn't been used above is:")
    d.ul([
    "Typewriter font",
    "Preformatted text",
    "Description lists",
    "Tables",
    "Graphics",
    ])
    d.p("Let's demonstrate them now.")
    d.h2("Preformatted text and Typewriter font")
    d.p(
    "The code given below extends the classes " + Fmt.tt("TrueClass") +
    " and " + Fmt.tt("FalseClass") +
    " so that they can be converted to an integer."
    )
    d.pre(
    "
    class TrueClass
    def to_i
    1
    end
    end

    class FalseClass
    def to_i
    0
    end
    end
    ")
    d.h2("Description List")
    d.p(
    "The description list below has some of the Ruby-related acronyms"
    )
    d.dl([
    [ "DRY", "Don't repeat yourself" ],
    [ "IANYM", "I am not Yukihiro Matsumoto" ],
    [ "POLS", "Principle of least surprise" ],
    [ "YAGNI / YANGI / YANGNI", "You ain't gonna need it" ],
    [ "YWFWA", "Yes we freakin' well are" ],
    ])
    d.h2("Table")
    d.p(
    "The table shows the same as the description list above"
    )
    d.table([
    [ [ "Acronym", "th" ], ["Meaning", "th" ] ],
    [ [ "DRY", "th" ], "Don't repeat yourself" ],
    [ [ "IANYM", "th" ], "I am not Yukihiro Matsumoto" ],
    [ [ "POLS", "th" ], "Principle of least surprise" ],
    [ [ "YAGNI/YANGI/YANGNI", "th" ], "You ain't gonna need it" ],
    [ [ "YWFWA", "th" ], "Yes we freakin' well are" ],
    ])
    d.h2("Image")
    d.p(
    "Now it is time for the last element: A picture"
    )
    d.p(Fmt.img("./rubypower.gif"))
    d.h1("Conclusion")
    d.p(
    "I hope to have shown that it is really easy to write doentations
    in Ruby."
    )
    puts d

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Layout class for HTML

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    #!/usr/bin/env ruby

    class HTML
    def initialize(title, author)
    date = Time.now.strftime("%Y-%m-%d, %H:%M:%S %Z")
    doent = <<-EOF
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <html>
    <head>
    <title>#{title} by #{author}</title>
    <meta name="generator" content="Ruby HTML class"></meta>
    </head>
    <body>
    <hr>
    <h1>#{title}</h1>
    <h2>#{author}</h2>
    <h3>#{date}</h3>
    <hr>
    EOF
    end

    def to_s
    <<-EOF
    #{doent}
    <hr>
    <p>
    Generated by Ruby HTML class on #{date}
    </p>
    </body>
    </html>
    EOF
    end

    def h1(text) doent << "<h1>#{text}</h1>\n" end
    def h2(text) doent << "<h2>#{text}</h2>\n" end
    def h3(text) doent << "<h3>#{text}</h3>\n" end
    def h4(text) doent << "<h4>#{text}</h4>\n" end
    def h5(text) doent << "<h5>#{text}</h5>\n" end
    def h6(text) doent << "<h6>#{text}</h6>\n" end
    def p(text) doent << "<p>\n#{text}\n</p>\n" end
    def pre(text) doent << "<pre>#{text}</pre>\n" end

    def ul(list)
    doent << "<ul>\n<li>"
    doent << list.join("</li>\n<li>")
    doent << "</li>\n</ul>\n"
    end

    def ol(list)
    doent << "<ol>\n<li>"
    doent << list.join("</li>\n<li>")
    doent << "</li>\n</ol>\n"
    end

    def dl(list)
    doent << "<dl>\n"
    list.each { |entry|
    doent << "<dt><b>#{entry[0]}</b></dt>\n"
    doent << "<dd>#{entry[1]}</dd>\n"
    }
    doent << "</dl>\n"
    end

    def table(list)
    doent << "<table border>\n"
    list.each { |row|
    doent << "<tr>\n"
    row.each { |cell|
    if cell.class == String
    doent << "<td>#{cell}</td>\n"
    else
    doent << "<th align=\"left\">"
    doent << "<b>#{cell.first}</b>"
    doent << "</th>\n"
    end
    }
    doent << "</tr>\n"
    }
    doent << "</table>\n"
    end

    def HTML.i(text) "<i>#{text}</i>" end
    def HTML.b(text) "<b>#{text}</b>" end
    def HTML.tt(text) "<code>#{text}</code>\n" end
    def HTML.img(url) "<img src=\"#{url}\" alt=\"#{url}\">" end

    end

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    That's it for now.

    Josef 'Jupp' SCHUGT
    --
    http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby FAQ
    http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge


    Josef Guest

  16. #16

    Default Re: Writing doents in Ruby (Was: A good way to do a book?)

    Hi!

    * Zach Dennis: 

    Maybe you misunderstood something:

    a) The example doent is part of the message I sent and in English.

    b) The class that does the HTML representation does not generate a
    table of contents because that is a bit more involved.

    c) The reference to the Ruby source of the German FAQ[1] is present
    because it implements more - like a table of contents and a LaTeX
    representation. That would have gone beyond the scope of a message
    that is nothing but a suggestion of how something could be done.

    d) I would have suggested the text even if it were written in Klingon
    because the language uses does not have anything to do with the
    layout. At least if the language fits into the usual typographic
    scheme. The text could be in Turkish - it simply wouldn't matter.

    [1] http://oss.erdfunkstelle.de/ruby/FAQ.rb

    Josef 'Jupp' SCHUGT
    --
    http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby FAQ
    http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge


    Josef Guest

Similar Threads

  1. Need a good XML book
    By sean52577 in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: August 10th, 02:06 AM
  2. Anyone know of a good book for XP's IIS?
    By Nathan in forum Windows Server
    Replies: 3
    Last Post: July 11th, 02:04 PM
  3. Looking for a good book on FW
    By O-kin in forum Macromedia Fireworks
    Replies: 4
    Last Post: October 23rd, 06:08 PM
  4. Good Book about CVS?
    By RC in forum Linux / Unix Administration
    Replies: 3
    Last Post: July 2nd, 06:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139