Ricardo SIGNES 😄


Pod::Elemental::Transformer::SynMux - apply multiple SynHi transformers to one document in one pass


version 0.101000


  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:


  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.



Ricardo SIGNES <rjbs@cpan.org>


This software is copyright (c) 2014 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.