1Text::WikiFormat::BlockUss(e3r)Contributed Perl DocumentTaetxito:n:WikiFormat::Blocks(3)
2
3
4
6 None. Use Text::WikiFormat as the public interface, unless you want to
7 create your own block type.
8
10 This module merely creates subclasses of Text::WikiFormat::Block, which
11 is the interesting code. A block is a collection of related lines,
12 such as a code block (text to display verbatim in a monospaced font), a
13 header, an unordered list, an ordered list, and a paragraph (text to
14 display in a proportional font).
15
16 Every block extends "Text::WikiFormat::Block".
17
19 The following methods exist:
20
21 * "new( %args )"
22 Creates and returns a new block. The valid arguments are:
23
24 * "text"
25 The text of the line found in the block.
26
27 * "args"
28 The arguments captured by the block-identifying regular expres‐
29 sion.
30
31 * "level"
32 The level of indentation for the block (usually only useful for
33 list blocks).
34
35 * "tags"
36 The tags in effect for the current type of wiki formatting.
37
38 * "opts"
39 The options in effect for the current type of wiki formatting.
40
41 Use the accessors of the same names to retrieve the values of the
42 attributes.
43
44 * "add_text( @lines_of_text )"
45 Adds a list of lines of text to the current text for the block.
46 This is very useful when you encounter a block and want to merge it
47 with the previous block of the same type
48
49 * "add_args( @arguments )"
50 Adds further arguments to the block; useful when merging blocks.
51
52 * "formatted_text()"
53 Returns text formatted appropriately for this block. Blocks don't
54 have to have formatters, but they may.
55
56 * "formatter( $line_of_text )"
57 Formats the $line using "Text::WikiFormat::format_line()". You can
58 add your own formatter here; this is worth overriding.
59
60 * "merge( $next_block )"
61 Merges the current block with $next_block (the next block encoun‐
62 tered) if they're of the same type and are at the same level. This
63 adds the text and args of $next_block to the current block. It's
64 your responsibility to remove $next_block from whatever your code
65 iterates over.
66
67 * "nests()"
68 Returns true if this block should nest (as in lists and unordered
69 lists) for the active wiki formatting.
70
71 * "nest( $next_block )"
72 Nests $next_block under this block if the both nest and if
73 $next_block has a level greater than the current block. This actu‐
74 ally adds $next_block as a text item within the current block.
75 Beware.
76
78 chromatic, "chromatic at wgz dot org"
79
81 No known bugs.
82
84 Copyright (c) 2006, chromatic. Some rights reserved.
85
86 This module is free software; you can use, redistribute, and modify it
87 under the same terms as Perl 5.8.x.
88
89
90
91perl v5.8.8 2006-03-31 Text::WikiFormat::Blocks(3)