<?xml version="1.0" encoding="windows-1252"?>
<node id="397051" title="Code highlighting?" created="2004-10-06 12:03:12" updated="2005-07-17 18:27:43">
<type id="1036">
monkdiscuss</type>
<author id="375088">
radiantmatrix</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;strong&gt;Update 2004-10.Oct-19:&lt;/strong&gt; Due to many concerns, both public and private, this proposal has been withdrawn.
&lt;strike&gt;&lt;p&gt;I've forgotten where, now, but I visited a site last week with some example Perl code listings.  The code was highlighted much as it might be in Komodo, Emacs, Vi, &amp;c..

&lt;p&gt;Our &lt;tt&gt;&amp;lt;code&amp;gt;&lt;/tt&gt; tags are used mostly for Perl code, but sometimes for other forms of text.  So, if the Monestary added code highlighting support, we'd need to have a way of specifying what counts as "Perl code" and what is just a block of preformatted text (without using the &lt;tt&gt;&amp;lt;pre&amp;gt;&lt;/tt&gt; tags.  The two that pop into my head are an attribute:
&lt;code&gt;
# I've needed to escape slashes in HTML tags...

&lt;code type='perl'&gt;print("This is perl code");&lt;\/code&gt;
# or
&lt;code type='noperl'&gt;This is output, or some non-perl code&lt;\/code&gt;
&lt;/code&gt;

Or a special tag:
&lt;code&gt;
&lt;pcode&gt;Perl code &lt;/pcode&gt;
#or
&lt;notcode&gt;Not code &lt;/notcode&gt;
&lt;/code&gt;

&lt;p&gt;Only one of either pair would need to be implemented: e.g. if &lt;tt&gt;&amp;lt;pcode&amp;gt;&lt;/tt&gt; tags were used, the default &lt;tt&gt;&amp;lt;code&amp;gt;&lt;/tt&gt; tags would be non-perl code.  And vice-versa.

&lt;p&gt;I am willing to apply my less-than-saintly coding skills to do the work, but I'm curious before I start: is this something the Monestary would like?  If so, how should it work?  Restrictions, ideas?
&lt;/strike&gt;
</field>
</data>
</node>
