Pod::E...r::List(3pm)

πŸ“¦
version 0.102001 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ Pod::Elemental::Transformer::List ✨

okay bestie, welcome to Pod::Elemental::Transformer::List (perl doc page, 3pm section, living in User Contributed Perl Documentation) πŸ’– β€” the transformer that turns your :list regions into real =over/=back Pod so you don't have to type all that stuff yourself. literally saving your wrists, no cap. 🫢


🌸 NAME 🌸

Pod::Elemental::Transformer::List β€” transform :list regions into =over/=back to save typing πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.102001 ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

so here's the vibe: you transform your Pod::Elemental::Document like this:

  my $xform = Pod::Elemental::Transfomer::List->new;
  $xform->transform_node($pod_document);

and then boom πŸ’₯ you can produce traditional Pod5 lists by using :list regions like this:

  =for :list
  * Doe
  a (female) deer
  * Ray
  a drop of golden sun

the behavior of list regions is slighly complex (their typo, their energy, we respect it πŸ™ˆ) and it's described below, so keep reading bestie, don't skip ⬇️


πŸ’€ PERL VERSION πŸ’€

this library should run on perls released even a long time ago. like, it should work on any version of perl released in the last five years.

although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so like… it could change, and that's just the rules 🫠


πŸ’… ATTRIBUTES πŸ’…

⭐ format_name ⭐

this attribute, which defaults to "list", is the region format that will be processed by this transformer. it's giving "name tag at the party" fr fr πŸŽ€


πŸ”₯ LIST REGION PARSING πŸ”₯

okay so there are three kinds of lists: numbered, bulleted, and definition. every list must be only one kind of list. trying to mix list styles will result in an exception during transformation. do not mix them, bestie, it will Not Go Well 😭

lists can be written as a single paragraph beginning =for :list or a region marked off with =begin :list and =end :list. the content allowed in each of those two types is defined by the Pod specification but boils down to this: for regions will only be able to contain list markers and paragraphs of text, while begin and end regions can contain arbitrary Pod paragraphs and nested list regions. iykyk πŸ‘‘

all lists have a default indentlevel value of 4. adding :over<n> to a =begin :list definition will result in that list having an indentlevel of n instead. (this functionality is not available for lists defined with =for :list.) πŸ’…

ordinary paragraphs in list regions are scanned for lines beginning with list item markers (see below). if they're found, the list is broken into paragraphs and markers. here's a demonstrative example:

  =for :list
  * Doe
  a deer,
  a female deer
  * Ray
  a drop of golden sun
  or maybe it's a golden
  drop of sun

the above is equivalent to

  =begin :list

  * Doe
  a deer,
  a female deer
  * Ray
  a drop of golden sun
  or maybe it's a golden
  drop of sun

  =end :list

it will be transformed into:

  =over 4

  =item *

  Doe

  a deer,
  a female deer

  =item *

  Ray

  a drop of golden sun
  or maybe it's a golden
  drop of sun

which renders as:

  • Doe

a deer, a female deer

  • Ray

a drop of golden sun or maybe it's a golden drop of sun

pinkrendering ends here*</pink*

in other words: the "*" indicates a new bullet. the rest of the line is made into one paragraph, which will become the text of the bullet point when rendered. (yeah, Pod is weird. we said it. πŸ’€) to continue the text of the bullet point on more than one line, start subsequent lines with white space.

  =for :list
  * this bullet line
    continues on a second line

will be transformed into:

  =over 4

  =item *

  this bullet line continues on a second line

  =back

which renders as:

  • this bullet line continues on a second line

pinkrendering ends here*</pink*

all subsequent lines without markers or leading white space will be kept together as one paragraph. noted. πŸ“

asterisks mark off bullet list items. numbered lists are marked off with "1." (or any number followed by a dot). equals signs mark off definition lists. the markers must be followed by a space. must. be. followed. by. a. space. πŸ‘€

here's a numbered list:

  =for :list
  1. bell
  2. book
  3. candle

the choice of number doesn't matter. the generated Pod =item commands will start with 1 and increase by 1 each time. so like, you can write whatever numbers, it fixes them for you. iconic behavior honestly.

this is rendered as:

  1. bell
  2. book
  3. candle

pinkrendering ends here*</pink*

definition lists are unusual in that the text on the line after a item marker will be used as the bullet, rather than the next paragraph. so this input:

  =begin :list

  = benefits

  There are more benefits than can be listed here.

  =end :list

or this input:

  =for :list
  = benefits
  There are more benefits than can be listed here.

will become the following output Pod:

  =over 4

  =item benefits

  There are more benefits than can be listed here

  =back

which is rendered as:

benefits There are more benefits than can be listed here

pinkrendering ends here*</pink*

if you want to nest lists, you have to make the outer list a begin/end region, like this:

  =begin :list

  * first outer item

  * second outer item

  =begin :list

  1. first inner item

  2. second inner item

  =end :list

  * third outer item

  =end :list

the inner list, above, could have been written as a compact "for" region. 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Ricardo SIGNES <cpan@semiotic.systems> πŸ’–


🌈 CONTRIBUTORS 🌈

  • Alex Peters <lxp@cpan.org>
  • David Golden <dagolden@cpan.org>
  • Justin Cook <jcook@cray.com>
  • Karen Etheridge <ether@cpan.org>
  • Ricardo Signes <rjbs@semiotic.systems>
  • Tomas Doran <bobtfish@bobtfish.net>

this software is copyright (c) 2022 by Ricardo SIGNES.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πŸ’œ


and that's the whole page bestie!! this was perl v5.40.1, dated 2025-05-04, from the Pod::E...r::List(3pm) page πŸ¦‹ slay, go make some lists, you got this πŸŒΈβœ¨πŸ’…
πŸ“¦ where this page comes from