develooper Front page | perl.pod-people | Postings from April 2012

Add handle_code() method to Pod::Simple::XHTML

Thread Next
From:
Gisle Aas
Date:
April 28, 2012 01:31
Subject:
Add handle_code() method to Pod::Simple::XHTML
Message ID:
B5B2814C-C9C5-4939-AE32-D845712171F9@activestate.com
For ActivePerl we plug in a syntax highlighter for the code snippets in the generated HTML documentation.  In order to support this for perl-5.16 I ended up patching Pod::Simple::XHTML like this:

   https://github.com/gisle/pod-simple/commit/9cafd6c5dd1aa753ba0dc698324b1fe6ef05274d

We will then subclass Pod::Simple::XHTML to invoke our syntax highlighter in an overridden handle_code method.

For this to work without much hassle I also found that I needed to add code to join subsequent text segments so that they were all processed by a single _handle_text invocation:

   https://github.com/gisle/pod-simple/commit/b6bd1521d06246b6c314e149287a590a1ed21da3

Does this look like a sane way to approach this?

--Gisle



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About