brian d foy recently released a text density widget that I thought was pretty neat. After hacking out my own, I wondered if it would be possible to make one that would give a graphical representation of syntactically interesting things, rather than just text density.
After finding -- and abusing -- the delightful Syntax-Highlight-Perl, I have created just such a thing. I decided to copy the source code for S::H::P into a new project and bend it to my whims rather than subclassing it because the changes I made were so specific to this particular idea. I tried to stick with the same color scheme ,blue for unimportant things up to red for more important, but it can stand to be tinkered with.
usage : $0 perlfile pngfile
update fixed code...
update well, heck. I've apparently run up against some sort of character limit in perlmonks. I'll post a link to the code when I get home from work. Sorry, folks. Nothing to see here right now.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|