NAME
Pod::Elemental::Transformer::SynMux - apply multiple SynHi transformers to one document in one pass
VERSION
version 0.101001
SYNOPSIS
my $xform = Pod::Elemental::Transformer::SynMux->new({
transformers => [ @list_of_SynHi_transformers ],
});
$xform->transform_node( $pod_document );
OVERVIEW
SynMux uses an array of SynHi transformers to perform syntax highlighting markup in one pass over the input Pod.
If multiple transformers for the same format name have been given, an exception will be thrown at object construction time.
Also, if the format_name
attribute for the transformer is set (and it defaults to set, to synmux
) then a single hunk of code may be marked to be syntax highlighted by multiple highlighters, then concatenated together, for example:
#!synmux
#!perl
print "This code will be highlighted with the #!perl highlighter.";
#!vim javascript
console.log("...and this code by VimHTML javascript syntax.");
All the shebang lines will be stripped. Assuming the syntax highlighting transformers all behave close to the standard behavior, you'll end up with one code box with multiple styles of highlighting in it, which can be useful for marking up one document with a few kinds of syntax.
PERL VERSION
This library should run on perls released even a long time ago. 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.
SEE ALSO
AUTHOR
Ricardo SIGNES <cpan@semiotic.systems>
COPYRIGHT AND LICENSE
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.