Pod::Elemental::Transformer::SynMux - apply multiple SynHi transformers to one document in one pass
version 0.101001
my $xform = Pod::Elemental::Transformer::SynMux->new({ transformers => [ @list_of_SynHi_transformers ], }); $xform->transform_node( $pod_document );
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:
format_name
synmux
#!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.
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.
Pod::Elemental::Transformer::SynHi
Ricardo SIGNES <cpan@semiotic.systems>
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.
To install Pod::Elemental::Transformer::SynHi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::Elemental::Transformer::SynHi
CPAN shell
perl -MCPAN -e shell install Pod::Elemental::Transformer::SynHi
For more information on module installation, please visit the detailed CPAN module installation guide.