Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Perl Docs for PalmOS Peanut Reader

by Guildenstern (Deacon)
on May 09, 2001 at 01:02 UTC ( #78959=perlmeditation: print w/replies, xml ) Need Help??

Before I say anything else, let me say that I am aware of several ports of Perl documentation to PalmOS document format. I happen to use the Peanut Press reader which horribly mangles TealDocs and does nothing impressive with normal docs. The nice folks at Peanut Press have put up a utility that will convert documents formatted with their Peanut Markup Language into files that the Peanut Reader can read.

This I saw as a perfect project for me: convert my HTML Perl docs to the Reader format, and they'll always be handy on my Visor. Little did I know what a pain in the butt this process would be. Here's an overview of the entire process, from HTML to Palm document.

  1. Tidy up HTML - using HTML Tidy (natch). This nice tool will attempt to output HTML as XML, which means that tags are balanced, closed, etc.
  2. Tidy up intermediate file - the intermediate files are run through a Perl script that removes links to locations outside of the current document, removes named anchors that are not linked to in the document, plus a slew of character transformations for the Peanut Markup (PML). i.e. <li> -> \a149
  3. The resulting XML is processed with an XSL stylesheet to perform final formatting and transformation of XML tags to PML entities.
  4. The PML files are converted to Palm docs.

One of the other things that makes this project such a pain is the heterogenity of the tools. HTML Tidy is written in C++, there is a Perl script, an XSL stylesheet is involved, and the actual document creation tool is Java!

Needless to say, I've learned quite a bit about XML and XSL, not to mention the fact that most of the HTML docs supplied with ActiveState's distro are _ugly_. (Misnamed links, anchors, etc. At least now I know why when I click on something it only works about half of the time.)

Anyway, I managed to write a wrapper script that automated the entire process, and out of 77 files, 75 of them made it all the way through into becoming Palm docs. The two (perlfaq4 and ferlfaq7) that did not make the conversion process failed due to a bug in the Java utility.

I have made the files available here: I guarantee that the final docs are in no way perfect. I am hoping that others might take the time to look through some of the docs and point out where I've made formatting errors, etc. I have contacted Peanut Press about releasing the spec of the utility so somebody could make a module for converting PML to Palm docs, so hopefully they'll be nice and do that.

Oh, please don't ask me for the code. The Perl is some of the ugliest stuff I've ever seen, considering I had to tie in outside tools. I'm working on cleaning the code to a point where I'll feel comfortable having someone else look at it.

Negaterd character class uber alles!

Replies are listed 'Best First'.
Re: Perl Docs for PalmOS Peanut Reader
by rchiav (Deacon) on May 09, 2001 at 01:20 UTC
    Nice job with this. I know your pain because I wrote something to build TealInfo docs for my Palm (specifically the builtin function list).

    If you can't find the peanut reader, it's now the PalmReader. Peanut Press was acquired by Palm and they've incorporated all the features of the peanut reader into the Palm reader.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://78959]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2020-10-30 20:21 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (284 votes). Check out past polls.