PPI for Mojolicious
In the past week or so, there has been a lot of discussion about improving the Perl tutorials. I think this is a great idea, and I even think I have something to contribute. Much of my work has been to allow for more scientific computation with Perl, including using PDL.
In order to start making a “Perl for Science” tutorial site, including some non-science Perl beginning material, I wanted to find a CMS, written in Perl (I can’t have a Perl tutorial site written in PHP!!) and having built-in code syntax highlighting. I couldn’t find it. Then I decided I had wanted a reason to try Mojolicious, so maybe this was it. I could write a template for tutorials and populate then with content using PPI to provide highlighting.
Since Mojolicious::Plugin::PPI
didn’t exist yet, I made it up, based in large part on PPI::HTML. It is still rough around the edges, but I thought I would post something here to get some comments. I’m thinking about trying PrePAN too, but I haven’t gotten to it yet.
P.S. The tutorial site isn’t up yet, and may not be for a little bit. Of course I will post here when it is.
It doesn’t call itself a CMS, but ikiwiki comes really damn close to being one. :)
(Also, it already does have code highlighting capabilities.)
looking forward to the tutorial! I would not mind if the site displaying Perl content was written in PHP. :-)
There is a Javascript syntax highlighter that works for Perl: http://alexgorbatchev.com/SyntaxHighlighter/
By the way I use it in https://github.com/zby/Nblog - which is a blog engine I am working on.
@zby, thanks. I have used that before, and should this project not end up succeeding the way I want, I will probably revert to it.
Again, part of the idea was to be as pure Perl as possible; part was since I was going to focus on Perl, that I should use a syntax highlighter geared at Perl given its known parsing difficulty; and part was that I wanted to try it.
Should I get to C/XS I may have to the JS highlighter anyway, since I don’t know if PPI can do it (it might).