Pandoc::Filter::HeaderIdentifiers - Add identifiers to headers
Contents
Character Properties
InPandocHeaderIdentifier
Matches all Unicode lowercase letters, digits 0 to 9, underscore, hyphen, and period. In the unlikely
event that you want to check whether a given string could have been generated as header identifier, use
this:
$id =~ /^\p{InPandocHeaderIdentifier}+$/ and $id =~ /^\p{Letter}/
Description
This Pandoc::Filter adds identifier attributes (id) to all Headers elements. It uses the same algorithm
as internally used by pandoc. The module also exports function "header_identifier" to calculate an
identifier from a list of elements.
Functions
header_identifier($content[,$ids])
Returns an identifier for a given list of inlines or string ($content). Optionally takes into account and
updates existing ids, given as hash reference mapping identifier to usage count ($ids).
Methods
apply($element[,$ids])
Add identifiers to all Header elements found at a given element (typically a Document. A hash reference
of existing identifier counts (or an empty hash to get the new counts) can be passed in addition.
Name
Pandoc::Filter::HeaderIdentifiers - Add identifiers to headers
See Also
<http://pandoc.org/MANUAL.html#header-identifiers>
perl v5.38.2 2024-08-03 Pandoc::Filter::HeaderIdentifiers(3pm)
Synopsis
my $id = header_identifier( $header->content ); # calculate identifier
Pandoc::Filter::HeaderIdentifiers->new->apply($doc); # add all identifiers
