Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi.

While I havent read your post in detail (will later,) it struck a chord with me because I have been doing some interesting work with POD lately.

The basic scenario was that we have a variety of applications with fairly complicated command line and configuration components. The problem is these tools are hard to hand over to production teams due to their cryptic nature. The solution we started looking at was self documenting config files. So over a weekend with no cash I threw together the following:

  • Config::Pod::Writer -- A module for dumping out arbitrary data structures encoded as pod, with documentation if it is available.
  • Config::Pod::Reader -- A module for reading pod files generated by the writer
  • Config:Pod::ParamRead -- A module for parsing the command line in the way required for the write reader.
  • TODO Config::Pod -- A wrapper for all of the above to make it an easy to use tool both for the programmer and customer.
Ultimately all of these will be wrapped in a module Config::Pod which will supply all configuration and command line parsing and validation. Since the config file _is_ pos then pod2html (in module form or cmd line form) can be used to generate pretty HTML versions of the config files, as well POD::usage can be used to display the rules.

When I get it all completed I plan to release it here then if its thought to be usefull to CPAN.

BTW more related to your post, have a look at the =for directive and the =begin =end directives. Using these and a POD::Parser subclass you could accomplish most of what you are interested in.

UPDATE

A clarification. ehdonhon /msgd me with a comment suggesting that I wasnt clear enough. What i meant by the above was in regard to ehdonhons idea of embedded values in pod. Specifically
then your code will be modified to include the present revision number of your code, like this: $Revision: 1.3. I wonder how easily such a system could be embedded into pod?
My point with for directive is this (and Ive basically done something similer in my code)

=for config VERSION =cut our $VERSION=0.1; =for config END_VERSION
The for directive tells the preprocessor that the following chunk of code should serve a double purpose, code _and_ documentation. The subtleties involved are left as an exercise for the preprocessor author.

Yves / DeMerphq
--
When to use Prototypes?


In reply to Re: Thoughts on pod. by demerphq
in thread Thoughts on pod. by ehdonhon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2021-10-27 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (93 votes). Check out past polls.

    Notices?