Question

Would anyone know of a way to dynamically increment an integer for item titles? This is mainly to avoid having to change every step number in the event that a new step would need to be added/removed somewhere in the middle of a ton of steps. Below is a small three-step procedure to give you a rough idea of the template structure:

=step_wash 1. Wash

<p>Add washing steps here</p>

=cut

# Throw some perl code here to wash stuff

=step_dry 2. Dry

<p>Add drying steps here</p>

=cut

# Throw some perl code here to dry things

=step_fold 3. Fold

<p>Add folding steps here</p>

=cut

# Fold all of the things Perl!

Disregarding the item names and structure of this, the goal is to try and eliminate the use of statically numbering the title of each item. I am wondering if there is a possible way to generate an integer that increments; pretty much like replacing 1, 2, 3, etc with something like { print $i++ } instead.. but in POD.

Was it helpful?

Solution

POD is pretty Plain and doesn't do that sort of thing.

An extension of POD called PseudoPod in theory does (see https://metacpan.org/pod/distribution/Pod-PseudoPod/lib/Pod/PseudoPod/Tutorial.pod#Lists) but when I tried it it gave an error.

OTHER TIPS

There is nothing built into POD that allows doing automatic numbering.

I see that you are using custom POD regions which encompass HTML markup, your POD also doesn't look like normal documentation. If you are trying to do Literate Programming, there should exist systems that don't require you to write POD. If this is just normal documentation, you should probably remove the HTML, as docs are often viewed via perldoc – on the command line.

Sometimes it isn't neccessary to use numbering at all. Bullet points are pretty as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top