SourceForge Logo

The Rbmake Commandline Tools

The tools consist of the following four programs: rbmake, rbburst, rbinfo, and rbdump.

What's New?

Here's a summary of some of the things that got added recently:

Rbmake Highlights

Here's a rundown of some of the highlights of the book-building tool:

Some Book-Making Examples

The following example command will download just the technology news from Yahoo's plain-text web site. Since the start page is somewhere completely different from the news-article pages, I use the -M option (with some wildcards) to restrict the followed links to just the desired tech-news pages. I also specify a large number of options (see the usage message for rbmake below for what they mean). Here's the command (note that this would really be all one line):

rbmake -jpebziofa yahoo
    -M 'http://dailynews.yahoo.com/htx/nm/200\d\d\d\d\d/tc/*'
    'http://dailynews.yahoo.com/htx/tc/nm/?u'

The resulting book is named yahoo.rb. It has the news all in one page, the punctuation is enhanced, the paragraphs are book-style, images are included, the erroneous page-breaks are removed, and I get prompted to set the author & title information.

Another way to handle this is to create an option file. You can dump the default options to a file like this:

rbmake -D >default.opt

You could also just add the -D option to the previous yahoo command and it would dump an option file that represents all those options. With an option file, it is easy to reuse settings and share them with others. For instance, I have two option files named usatoday.opt and yahoo.opt. You can use these directly from the web, like this:

rbmake -l http://rbmake.sourceforge.net/samples/usatoday.opt
rbmake -l http://rbmake.sourceforge.net/samples/yahoo.opt

A more interesting option file is named tij2.opt. It was used to create the Thinking in Java edition 2 ebook I submitted to the Rocket Library. If you were to download the TiJ HTML ebook from Bruce Eckel's web site and unzip it into a local directory, then you could use this command to create an ebook just like the one I created:

rbmake -l http://rbmake.sourceforge.net/samples/tij2.opt

Also, if you're a fan of Baen's Webscription ebooks (which are some great science fiction and fantasy, IMO), you can use my ws.opt file to transform the HTML version of one of their ebooks into an even better version than the one that they provide (for instance, it has a full-sized cover image, it has book-style paragraphs, enhanced punctuation, the chapters start at the top of a new page, and the "goto" menu has links to things like the maps and the table of contents). The ws.opt file also demonstrates how to pass arguments into the option-file. Here's how you use it:

rbmake -L 0671578545 -l ws.opt

The -L option (which must come before the option file) specifies that the "0671578545" parameter is to be provided to ws.opt as its $1 parameter (you could specify more -L options for more parameters). This script uses this name to indicate which book to convert. In this case, rbmake will create the book Ashes_of_Victory.rb.

The ws.opt file also shows you two different ways to populate the "Go to" menu: use the "Menu-Item" setting (which would also be accessible via the -g option), and via the insertion of META tags into the body of the web page (which is done by using some text-substitution rules).

Extracting Your Markup

You can now ask rbburst to merge-in the markup from your ebook by using the -m or -M option. The -M option expects the markup files to be in the same directory as the .rb file, and using the same name. For instance, typing "rbburst -M path/foo.rb" would look for the markup files "path/foo.ra", "path/foo.rh", and "path/foo.rn". Only use this option if you've copied your markup files out of the Librarian's directory structure.

The other markup-merging option, -m, needs to know where to find your Library books and what rocket-ID the files are stored under (since the markup is unique to each reader, you can have different markup files for each reader you own). The easiest way to do this is probably to set the RB_LIB_DIR and RB_ID environment variables.

The RB_LIB_DIR environment variable specifies the ".../Library/books" directory (where the "[none]" dir and your rocket-ID dir exist). MS Windows users can normally ignore this setting unless the RocketLibrarian was not installed in the default place on the C: drive (the default setting is "C:\Program Files\NuvoMedia\RocketLibrarian\Library\books"). In addition, rbburst has the -d option that can be used to override any other directory location.

The RB_ID environment variable specifies the rocket-ID of the reader where your markup files are stored (a rocket-ID looks like this: somebody1234). You can also specify the ID via the -r option, which is especially useful if you have multiple ReB readers.

To set an environment variable differs depending on your operating system. For DOS, you could put a "set RB_LIB_DIR=C:\Some\Path" into the autoexec.bat file. For Unix-like OSes (including Linux), put something like "setenv RB_LIB_DIR /some/path" or "export RB_LIB_DIR=/some/path" into the appropriate .profile or .login file (see your shell's manpage for the details).

Note that the -m option is not confused by a .rb file that was exported from the library using a different name. The software knows the right name to use when it looks up the files in your Library dir.

Here's an example. The following command sets a rocket-ID and uses the default library directory location:

rbburst -r somebody1234 -m SomeBook.rb

Tell Me More

To find out more, see the various tool manpages:
rbmake, rbburst, rbinfo, and rbdump

Or check out the library interface or the rbmake home page.


All this was created by Wayne Davison.