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

Re: Creating Books and Manuals with Perl

by Matts (Deacon)
on Sep 10, 2002 at 12:56 UTC ( #196653=note: print w/ replies, xml ) Need Help??


in reply to Creating Books and Manuals with Perl

The only hesitation I'd have with POD is that it's not terribly extensible at the text level.

With POD it's easy enough to add new paragraph level directives using =for and =begin/=end, but there's no way built into POD to add new X<< ... >> directives. Partly because there's only so many single letter directives to go around, and partly because POD parsers just don't support this kind of extensibility.

So if you expect to be using footnotes or endnotes or index hints or any of those sorts of other extended things that need to go at the text level rather than at the paragraph level, I would go with XML. Don't worry about what syntax of XML you use, be it DocBook or XHTML or TEI or invent your own as you go along. It's always easy enough to transform between one syntax or another with XML using XSLT or other transformation tools like a SAX filter.

If you feel you can live without those features, then I'd say go with POD. It's really easy to author, and quite readable from an editing perspective, and when it comes down to rendering it to different formats, the tools are pretty much second to none.


Comment on Re: Creating Books and Manuals with Perl
Select or Download Code
Re: Re: Creating Books and Manuals with Perl
by Dog and Pony (Priest) on Sep 10, 2002 at 16:32 UTC
    With POD it's easy enough to add new paragraph level directives using =for and =begin/=end, but there's no way built into POD to add new X<< ... >> directives. Partly because there's only so many single letter directives to go around, and partly because POD parsers just don't support this kind of extensibility.
    Maybe I am just not getting what you mean, but POD is extensible in those ways and more, isn't it?

    For instance, Pod::Parser, unless I recall totally wrong, does not care one bit what commands or interior sequences you feed it. You get the comand name, or the letter of the sequence (and lots of other data, like delimiter used), and then it is up to you what to do with it. So whatever you want the commands to do, and whichever commands (as long as they follow normal POD standard) is totally up to you.

    Granted, then you can not directly use the core parsers, but let's face it. For the most part, you would need to modify or completely rewrite them anyways, since they are specialized to deal with perl docs, and lots of them do produce output that you need to modify anyways. Pod::HTML is a prime example.

    But yes, that would require some extra work, although I suspect most of the modules probably only take subclassing and overriding certain methods, possibly passing whatever you got on to the next level after your amendments.

    XML is just fine to use, of course, with one notable 'if': If you have some kind of editor that makes the tags for you, and hides them when typing. XML is humanreadable, yes, for certain values of readable... and writable raw? Ugh.

    I think some word processors do save their documents in XML, like AbiWord maybe? I don't recall. But that would be a great start to convert to other formats, of course.

    If I misunderstood you, I apologize. :)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://196653]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-08-22 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (156 votes), past polls