From: Jeremy McAnally Date: 2007-06-10T05:43:34+09:00 Subject: Re: Project idea: Ruby Press I started something like that that was basically a Ruby DSL to Docbook using Builder + convenience methods. I called it Rockbook... I think I still have the code around somewhere. --Jeremy On 6/8/07, Victor Zverok Shepelev wrote: > It seems to be cool idea if somebody with strong experience of printing and > press would code his experience in Ruby, to have pretty DSL for making > "book-like" and "newspaper-like" printing. > > I have in mind something like > > my_book = book "My Book" do > page_size 'A4' > units 'cm' > type :brochure > > section "Title Page" do > margin 0 > columns 1 > > section "Title" do > padding :top => 20 > font "Lucida", "36pt" > align :center > end > > section "Author" do > font "Times New Roman", "20pt" > align :right > end > end > > section "Plain Pages" do > margin [1, 1, 0.5, 0.5] > > font 'Georgia', '12pt' > > columns 2, :space => 0.5 > > header do > text_template self.number > text_align :right > end > #hm... lots of other cool stuff? > end > end > > my_book.render_pdf "mybook.pdf" { > "Title Page" => { > "Title" => "It's my book!", > "Author" => "It's me" > }, > > "Plain Pages" => File.read("mybook.txt") > } > > > It can all look strange (as well as my English)... > > The main idea is: > * DSL, which would be natural for press (headers and footers, columns, and > other things, if you know...) > * Under it, press-print experience coded accurately. > * Special efforts for correct images and tables printing... > > What do you think? Am I reinventing TeX? > > V. > > > -- http://www.jeremymcanally.com/ My free Ruby e-book: http://www.humblelittlerubybook.com/book/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/