Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

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

As a one-liner I would prefer something like this: perl -nle 'print "\t"x($1-1),$2 if /^=head(\d)\s+(.*)/' /somepath/perlop.pod Or as a short program:
#!/usr/bin/perl -l # Call the program as follows: # perl perlop # perl Parse::RecDescent my $podfile = `perldoc -l @ARGV[0]`; exit if $?; open POD, $podfile or die "$podfile: $!.\n"; while (<POD>) { print " " x ($1-1), $2 if /^=head(\d)\s+(.*)/; }
What do you think: should all lengthy Perl documentation have a table of contents?

Unfortunately, it is too late to add a table of contents as a requirement for Perl documentation. However, it shouldn't be difficult to extend the above methodology to read a pod file, generate a table of contents, add it to a copy of the original pod as a section after NAME and redirect it to pod2text.


In reply to Re: Who's afraid of the manual? by jmcnamara
in thread Who's afraid of the manual? by Juerd

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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2021-10-17 04:43 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (71 votes). Check out past polls.