Templat...n::Wrap(3)

okay so bestie, welcome to Template::Plugin::Wrap(3) β€” manual name: User Contributed Perl Documentation β€” and it's literally giving perl-plugin-bestie energy 🫢. we're folding the header in near the top, and yes, every little detail is staying. no cap. πŸ’…


🌸 NAME 🌸

Template::Plugin::Wrap β€” it's the plugin interface to Text::Wrap, periodt. that's the whole name vibe πŸ’–


✨ SYNOPSIS ✨

here's the quick-start group chat: you USE it, then either call the wrap subroutine or use wrap as a FILTER. keep the code exactly as shown, including that initial_tab, subsequent_tab double-space moment and the initital_tab spelling in the filter line β€” iykyk 🫢

[% USE wrap %]

# call wrap subroutine
[% wrap(mytext, width, initial_tab,  subsequent_tab) %]

# or use wrap FILTER
[% mytext FILTER wrap(width, initital_tab, subsequent_tab) %]

πŸ’– DESCRIPTION πŸ’–

so this plugin is basically a little interface to the Text::Wrap module, which provides simple paragraph formatting. iconic behavior honestly ✨

it defines a wrap subroutine that you can call, passing the input text plus further optional parameters to specify the page width (default: 72), and tab characters for the first and subsequent lines β€” and those tab characters have no defaults. okay? noted. πŸŽ€

[% USE wrap %]

[% text = BLOCK %]
First, attach the transmutex multiplier to the cross-wired
quantum homogeniser.
[% END %]

[% wrap(text, 40, '* ', '  ') %]

Output:

* First, attach the transmutex
  multiplier to the cross-wired quantum
  homogeniser.

it also registers a wrap filter which accepts the same three optional arguments but takes the input text directly via the filter input. slay πŸ’…

Example 1:

[% FILTER bullet = wrap(40, '* ', '  ') -%]
First, attach the transmutex multiplier to the cross-wired quantum
homogeniser.
[%- END %]

Output:

* First, attach the transmutex
  multiplier to the cross-wired quantum
  homogeniser.

Example 2:

[% FILTER bullet -%]
Then remodulate the shield to match the harmonic frequency, taking
care to correct the phase difference.
[% END %]

Output:

* Then remodulate the shield to match
  the harmonic frequency, taking
  care to correct the phase difference.

πŸ¦‹ AUTHOR πŸ¦‹

Andy Wardley <abw@wardley.org> <http://wardley.org/> β€” that's the author, bestie 🫢

the Text::Wrap module was written by David Muir Sharnoff with help from Tim Pierce and many others. shoutout to the whole crew πŸ’œ


Copyright (C) 1996-2022 Andy Wardley. All Rights Reserved.

this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free software summer, no cap πŸ’–


🌈 SEE ALSO 🌈

  • Template::Plugin
  • Text::Wrap

go peek at those besties when you're done here πŸ‘‘


okay that's the whole page! source/version: perl v5.42.0, date: 2024-06-23, page: Template::Plugin::Wrap(3) β€” bye bestie, go wrap some paragraphs πŸ’œβœ¨

πŸ“¦ where this page comes from