<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Arbitrary colors in style-code' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Arbitrary colors in style-code' posted on the 'Comments on this site' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Mon, 17 Jun 2013 20:40:16 -0700</pubDate>
    <lastBuildDate>Mon, 17 Jun 2013 20:40:16 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/85731/arbitrary-colors-in-style-code/</link>
      <description>Greetings!  I have a very small request...&lt;br /&gt;
&lt;br /&gt;
Right now, there are a limited amount of &lt;strong&gt;&lt;span style="color: Red;"&gt;c&lt;/span&gt;&lt;span style="color: Blue;"&gt;o&lt;/span&gt;&lt;span style="color: Green;"&gt;l&lt;/span&gt;&lt;span style="color: Purple;"&gt;o&lt;/span&gt;&lt;span style="color: Grey;"&gt;r&lt;/span&gt;s&lt;/strong&gt; that we can use to markup posts.  In addition to these, I would like to see arbitrary RGB values allowed - something like:&lt;br /&gt;
&lt;br /&gt;
[ff0000]this text would be red[/ff0000]&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
[ff0000]this text would be red[/color]&lt;br /&gt;
&lt;br /&gt;
This would be very easy to implement, taking 15 minutes to your time.&lt;br /&gt;
&lt;br /&gt;
I have written a script that automatically syntax highlights over 300 languages and file types for this message board.  However, the full spectrum of colors must be mapped down to the limited colors available on this board, so the results are sometimes very ugly. The script would be far more useful and powerful if this mapping was not necessary, if arbitrary RGB values were accepted.&lt;br /&gt;
&lt;br /&gt;
A secondary, but less important request: it would be nice to be able to set the background color of CODE blocks.&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/85731/arbitrary-colors-in-style-code/</guid>
      <pubDate>Thu, 08 Nov 2001 10:44:16 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>P.S.</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/85770/ps/#85770</link>
      <description>If you just don't have the time to do this, I will gladly add it myself. I would &lt;em&gt;really&lt;/em&gt; like this feature.  You could just send me the module responsible for parsing post to convert style-code to HTML, and I would make the necessary changes.  Language is unimportant.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/85770/ps/#85770</guid>
      <pubDate>Thu, 08 Nov 2001 15:35:43 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: P.S.</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/85823/re-ps/#85823</link>
      <description>Thanks for your offer, I will implement it by my self as soon as I got time &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt; &lt;br /&gt;
&lt;br /&gt;
If you want to contribute with your syntax-coloring, then send me an email because that would be really cool to have here.&lt;br /&gt;
&lt;br /&gt;
Regarding the syntax I think something like &lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: ff0000;"&gt;this text would be red&lt;/span&gt; would be more&lt;br /&gt;
suitable.&lt;br /&gt;
&lt;br /&gt;
What do you think? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/85823/re-ps/#85823</guid>
      <pubDate>Fri, 09 Nov 2001 04:24:14 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: P.S.</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86477/re-ps/#86477</link>
      <description>: Thanks for your offer, I will implement it by my self as soon as I got time &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt; &lt;br /&gt;
: &lt;br /&gt;
: If you want to contribute with your syntax-coloring, then send me an email because that would be really cool to have here.&lt;br /&gt;
&lt;br /&gt;
Well, my syntax highlighting script is for the editor VIM. The script queries VIM for highlighting information, which it then uses to markup the text with Programmer's Heaven style-codes. With the correct command line arguments, you &lt;em&gt;could&lt;/em&gt; use VIM to markup text from a CGI script.  Of course, this would require an extension the CODE tag so that you could specify which language to use for highlighting. Something like:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;

or

[code language=pascal]

: Regarding the syntax I think something like 
: 
: &lt;span style="color: ff0000;"&gt;this text would be red&lt;/span&gt; would be more
: suitable.
:
: What do you think? 

That's fine, though a little verbose. Some other alternatives...

[#ff0000][/color]

or simply:

[#ff0000][/#]


These are just as easy to parse (if not easier), requires less typing, and are still unlikely to conflict with valid language constructs (unlike some style codes, like 'strikethrough' and 'bold').

In the end, it doesn't make much difference to me, as my editor will be doing the markup automatically.

Cheers,
Eric


P.S.  I'm sure you aware that some people's code is being incorrectly marked up when an expression in their code is mistaken for style-code.  For instance, this was a common problem with &lt;span style="color: Black;"&gt;[&lt;/span&gt;i] until you changed the style-code for italic to &lt;span style="color: Black;"&gt;[&lt;/span&gt;italic].  However, this did not solve the problem for other style-codes like &lt;span style="color: Black;"&gt;[&lt;/span&gt;x] and &lt;span style="color: Black;"&gt;[&lt;/span&gt;b].  I see this all the time in code like:

&lt;pre class="sourcecode"&gt;for( int x=0; x&amp;lt;10; ++x )
   cout &amp;lt;&amp;lt; myarray&lt;span style="color: Black;"&gt;[&lt;/span&gt;x] &amp;lt;&amp;lt; '\n'
&lt;/pre&gt;
One way to prevent this in the future, without needed to modify the syntax of style-code, and without requiring style-code characters to be 'escaped' in normal text, would be to &lt;em&gt;only markup text if the closing tag is found&lt;/em&gt;.  In the case of the code snippet above, &lt;span style="color: Black;"&gt;[&lt;/span&gt;x] would not be mistaken for a style-code because there is no closing &lt;span style="color: Black;"&gt;[&lt;/span&gt;/x] tag.



&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86477/re-ps/#86477</guid>
      <pubDate>Tue, 13 Nov 2001 15:13:08 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86547/re-arbitrary-colors-in-style-code/#86547</link>
      <description>I today rewrote the message rendering code and added support for any color and and code background.&lt;br /&gt;
&lt;br /&gt;
So, now you can do this&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;br /&gt;
&lt;span style="color: 000000;"&gt;P&lt;/span&gt;&lt;span style="color: 100000;"&gt;r&lt;/span&gt;&lt;span style="color: 200000;"&gt;o&lt;/span&gt;&lt;span style="color: 300000;"&gt;g&lt;/span&gt;&lt;span style="color: 400000;"&gt;r&lt;/span&gt;&lt;span style="color: 500000;"&gt;a&lt;/span&gt;&lt;span style="color: 600000;"&gt;m&lt;/span&gt;&lt;span style="color: 700000;"&gt;m&lt;/span&gt;&lt;span style="color: 800000;"&gt;e&lt;/span&gt;&lt;span style="color: 900000;"&gt;r&lt;/span&gt;&lt;span style="color: a00000;"&gt;s&lt;/span&gt; &lt;span style="color: b00000;"&gt;H&lt;/span&gt;&lt;span style="color: c00000;"&gt;e&lt;/span&gt;&lt;span style="color: d00000;"&gt;a&lt;/span&gt;&lt;span style="color: e00000;"&gt;v&lt;/span&gt;&lt;span style="color: f00000;"&gt;e&lt;/span&gt;&lt;span style="color: ff00000;"&gt;n&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
by using the [ color=xxxxxx].....[/color] tag, where the xxxxxx is the RGB HEX values.&lt;br /&gt;
&lt;br /&gt;
Also, i also now support the use of &lt;br /&gt;
[ code=xxxxxx] &lt;br /&gt;
Where you can set the default background color of a code block, like&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
case "blue"
    if closed=false then
        strBuf = strBuf &amp;amp; "&amp;lt;font color=""Blue""&amp;gt;"
    else
        strBuf = strBuf &amp;amp; "&amp;lt;/font&amp;gt;"
    end if
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86547/re-arbitrary-colors-in-style-code/#86547</guid>
      <pubDate>Wed, 14 Nov 2001 02:42:00 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86626/re-arbitrary-colors-in-style-code/#86626</link>
      <description>Awesome! You rock dude!&lt;br /&gt;
&lt;br /&gt;
Here's an example of my script highlighting some Java code, with two different colorization schemes...&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&lt;span style="color: a020f0;"&gt;import&lt;/span&gt; javax.swing.text.*;
&lt;span style="color: a020f0;"&gt;import&lt;/span&gt; javax.swing.undo.*;
&lt;span style="color: a020f0;"&gt;import&lt;/span&gt; javax.swing.event.*;
&lt;span style="color: a020f0;"&gt;import&lt;/span&gt; javax.swing.*;

&lt;span style="color: 80a0b0;"&gt;&lt;em&gt;/**&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: 80a0b0;"&gt;&lt;em&gt; *&lt;/em&gt;&lt;/span&gt;&lt;span style="color: 907050;"&gt; Sample application using the simple text editor component that&lt;/span&gt;
&lt;span style="color: 80a0b0;"&gt;&lt;em&gt; *&lt;/em&gt;&lt;/span&gt;&lt;span style="color: 907050;"&gt; supports only one font.&lt;/span&gt;
&lt;span style="color: 80a0b0;"&gt;&lt;em&gt; */&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: 000080;"&gt;&lt;strong&gt;class&lt;/strong&gt;&lt;/span&gt; Notepad &lt;span style="color: 000080;"&gt;&lt;strong&gt;extends&lt;/strong&gt;&lt;/span&gt; JPanel {

    &lt;span style="color: 000080;"&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: 000080;"&gt;&lt;strong&gt;static&lt;/strong&gt;&lt;/span&gt; ResourceBundle resources;

    &lt;span style="color: 000080;"&gt;&lt;strong&gt;static&lt;/strong&gt;&lt;/span&gt; {
        &lt;span style="color: 000000;"&gt;&lt;strong&gt;try&lt;/strong&gt;&lt;/span&gt; {
            resources = ResourceBundle.getBundle(&lt;span style="color: bb0000;"&gt;"resources.Notepad"&lt;/span&gt;,
                                                 Locale.getDefault());
        } &lt;span style="color: 000000;"&gt;&lt;strong&gt;catch&lt;/strong&gt;&lt;/span&gt; (MissingResourceException mre) {
            System.err.println(&lt;span style="color: bb0000;"&gt;"resources/Notepad.properties not found"&lt;/span&gt;);
            System.exit(&lt;span style="color: bb0000;"&gt;1&lt;/span&gt;);
        }
    }

    Notepad() {
  &lt;span style="color: 000080;"&gt;super&lt;/span&gt;(&lt;span style="color: bb0000;"&gt;true&lt;/span&gt;);

  &lt;span style="color: 80a0b0;"&gt;&lt;em&gt;// Force SwingSet to come up in the Cross Platform L&amp;amp;F&lt;/em&gt;&lt;/span&gt;
  &lt;span style="color: 000000;"&gt;&lt;strong&gt;try&lt;/strong&gt;&lt;/span&gt; {
      UIManager.setLookAndFeel(UIManager.getCrossPlatfor
mLookAndFeelClassName());
      &lt;span style="color: 80a0b0;"&gt;&lt;em&gt;// If you want the System L&amp;amp;F instead, comment out the above line and&lt;/em&gt;&lt;/span&gt;
      &lt;span style="color: 80a0b0;"&gt;&lt;em&gt;// uncomment the following:&lt;/em&gt;&lt;/span&gt;
      &lt;span style="color: 80a0b0;"&gt;&lt;em&gt;// UIManager.setLookAndFeel(UIManager.getSystemLookAn
dFeelClassName());&lt;/em&gt;&lt;/span&gt;
  } &lt;span style="color: 000000;"&gt;&lt;strong&gt;catch&lt;/strong&gt;&lt;/span&gt; (Exception exc) {
      System.err.println(&lt;span style="color: bb0000;"&gt;"Error loading L&amp;amp;F: "&lt;/span&gt; + exc);
  }
&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&lt;span style="color: ff80ff;"&gt;import&lt;/span&gt;&lt;span style="color: ffffff;"&gt; javax.swing.text.*;&lt;/span&gt;
&lt;span style="color: ff80ff;"&gt;import&lt;/span&gt;&lt;span style="color: ffffff;"&gt; javax.swing.undo.*;&lt;/span&gt;
&lt;span style="color: ff80ff;"&gt;import&lt;/span&gt;&lt;span style="color: ffffff;"&gt; javax.swing.event.*;&lt;/span&gt;
&lt;span style="color: ff80ff;"&gt;import&lt;/span&gt;&lt;span style="color: ffffff;"&gt; javax.swing.*;&lt;/span&gt;

&lt;span style="color: aaaa66;"&gt;&lt;em&gt;/**&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: aaaa66;"&gt;&lt;em&gt; *&lt;/em&gt;&lt;/span&gt;&lt;span style="color: ffa500;"&gt; Sample application using the simple text editor component that&lt;/span&gt;
&lt;span style="color: aaaa66;"&gt;&lt;em&gt; *&lt;/em&gt;&lt;/span&gt;&lt;span style="color: ffa500;"&gt; supports only one font.&lt;/span&gt;
&lt;span style="color: aaaa66;"&gt;&lt;em&gt; */&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;&lt;strong&gt;class&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; Notepad &lt;/span&gt;&lt;span style="color: ffffff;"&gt;&lt;strong&gt;extends&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; JPanel {&lt;/span&gt;

&lt;span style="color: ffffff;"&gt;    &lt;/span&gt;&lt;span style="color: ffffff;"&gt;&lt;strong&gt;private&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; &lt;/span&gt;&lt;span style="color: ffffff;"&gt;&lt;strong&gt;static&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; ResourceBundle resources;&lt;/span&gt;

&lt;span style="color: ffffff;"&gt;    &lt;/span&gt;&lt;span style="color: ffffff;"&gt;&lt;strong&gt;static&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;        &lt;/span&gt;&lt;span style="color: b3d2ff;"&gt;&lt;strong&gt;try&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;            resources = ResourceBundle.getBundle(&lt;/span&gt;&lt;span style="color: dd5555;"&gt;"resources.Notepad"&lt;/span&gt;&lt;span style="color: ffffff;"&gt;, &lt;/span&gt;
&lt;span style="color: ffffff;"&gt;                                                 Locale.getDefault());&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;        } &lt;/span&gt;&lt;span style="color: b3d2ff;"&gt;&lt;strong&gt;catch&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; (MissingResourceException mre) {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;            System.err.println(&lt;/span&gt;&lt;span style="color: dd5555;"&gt;"resources/Notepad.properties not found"&lt;/span&gt;&lt;span style="color: ffffff;"&gt;);&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;            System.exit(&lt;/span&gt;&lt;span style="color: dd5555;"&gt;1&lt;/span&gt;&lt;span style="color: ffffff;"&gt;);&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;        }&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;    }&lt;/span&gt;

&lt;span style="color: ffffff;"&gt;    Notepad() {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;  &lt;/span&gt;&lt;span style="color: ffffcc;"&gt;super&lt;/span&gt;&lt;span style="color: ffffff;"&gt;(&lt;/span&gt;&lt;span style="color: dd5555;"&gt;true&lt;/span&gt;&lt;span style="color: ffffff;"&gt;);&lt;/span&gt;

&lt;span style="color: ffffff;"&gt;  &lt;/span&gt;&lt;span style="color: aaaa66;"&gt;&lt;em&gt;// Force SwingSet to come up in the Cross Platform L&amp;amp;F&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;  &lt;/span&gt;&lt;span style="color: b3d2ff;"&gt;&lt;strong&gt;try&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;      UIManager.setLookAndFeel(UIManager.getCrossPlatfor
mLookAndFeelClassName());&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;      &lt;/span&gt;&lt;span style="color: aaaa66;"&gt;&lt;em&gt;// If you want the System L&amp;amp;F instead, comment out the above line and&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;      &lt;/span&gt;&lt;span style="color: aaaa66;"&gt;&lt;em&gt;// uncomment the following:&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;      &lt;/span&gt;&lt;span style="color: aaaa66;"&gt;&lt;em&gt;// UIManager.setLookAndFeel(UIManager.getSystemLookAn
dFeelClassName());&lt;/em&gt;&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;  } &lt;/span&gt;&lt;span style="color: b3d2ff;"&gt;&lt;strong&gt;catch&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: ffffff;"&gt; (Exception exc) {&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;      System.err.println(&lt;/span&gt;&lt;span style="color: dd5555;"&gt;"Error loading L&amp;amp;F: "&lt;/span&gt;&lt;span style="color: ffffff;"&gt; + exc);&lt;/span&gt;
&lt;span style="color: ffffff;"&gt;  }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86626/re-arbitrary-colors-in-style-code/#86626</guid>
      <pubDate>Wed, 14 Nov 2001 12:46:18 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86630/re-arbitrary-colors-in-style-code/#86630</link>
      <description>That's nice!&lt;br /&gt;
&lt;br /&gt;
What I need now is a ASP script or COM component that could do real realtime syntaxcoloring!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86630/re-arbitrary-colors-in-style-code/#86630</guid>
      <pubDate>Wed, 14 Nov 2001 13:15:25 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86675/re-arbitrary-colors-in-style-code/#86675</link>
      <description>: I today rewrote the message rendering code and added support for any color and and code background.&lt;br /&gt;
: &lt;br /&gt;
: So, now you can do this&lt;br /&gt;
: &lt;br /&gt;
: &lt;span style="font-size: large;"&gt;&lt;br /&gt;
: &lt;span style="color: 000000;"&gt;P&lt;/span&gt;&lt;span style="color: 100000;"&gt;r&lt;/span&gt;&lt;span style="color: 200000;"&gt;o&lt;/span&gt;&lt;span style="color: 300000;"&gt;g&lt;/span&gt;&lt;span style="color: 400000;"&gt;r&lt;/span&gt;&lt;span style="color: 500000;"&gt;a&lt;/span&gt;&lt;span style="color: 600000;"&gt;m&lt;/span&gt;&lt;span style="color: 700000;"&gt;m&lt;/span&gt;&lt;span style="color: 800000;"&gt;e&lt;/span&gt;&lt;span style="color: 900000;"&gt;r&lt;/span&gt;&lt;span style="color: a00000;"&gt;s&lt;/span&gt; &lt;span style="color: b00000;"&gt;H&lt;/span&gt;&lt;span style="color: c00000;"&gt;e&lt;/span&gt;&lt;span style="color: d00000;"&gt;a&lt;/span&gt;&lt;span style="color: e00000;"&gt;v&lt;/span&gt;&lt;span style="color: f00000;"&gt;e&lt;/span&gt;&lt;span style="color: ff00000;"&gt;n&lt;/span&gt;&lt;br /&gt;
: &lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: by using the [ color=xxxxxx].....[/color] tag, where the xxxxxx is the RGB HEX values.&lt;br /&gt;
: &lt;br /&gt;
: Also, i also now support the use of &lt;br /&gt;
: [ code=xxxxxx] &lt;br /&gt;
: Where you can set the default background color of a code block, like&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: case "blue"
:     if closed=false then
:         strBuf = strBuf &amp;amp; "&amp;lt;font color=""Blue""&amp;gt;"
:     else
:         strBuf = strBuf &amp;amp; "&amp;lt;/font&amp;gt;"
:     end if
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Very cool! Thanks a million!&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86675/re-arbitrary-colors-in-style-code/#86675</guid>
      <pubDate>Wed, 14 Nov 2001 18:59:40 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86955/re-arbitrary-colors-in-style-code/#86955</link>
      <description>: : I today rewrote the message rendering code and added support for any color and and code background.&lt;br /&gt;
: : &lt;br /&gt;
: : So, now you can do this&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;span style="font-size: large;"&gt;&lt;br /&gt;
: : &lt;span style="color: 000000;"&gt;P&lt;/span&gt;&lt;span style="color: 100000;"&gt;r&lt;/span&gt;&lt;span style="color: 200000;"&gt;o&lt;/span&gt;&lt;span style="color: 300000;"&gt;g&lt;/span&gt;&lt;span style="color: 400000;"&gt;r&lt;/span&gt;&lt;span style="color: 500000;"&gt;a&lt;/span&gt;&lt;span style="color: 600000;"&gt;m&lt;/span&gt;&lt;span style="color: 700000;"&gt;m&lt;/span&gt;&lt;span style="color: 800000;"&gt;e&lt;/span&gt;&lt;span style="color: 900000;"&gt;r&lt;/span&gt;&lt;span style="color: a00000;"&gt;s&lt;/span&gt; &lt;span style="color: b00000;"&gt;H&lt;/span&gt;&lt;span style="color: c00000;"&gt;e&lt;/span&gt;&lt;span style="color: d00000;"&gt;a&lt;/span&gt;&lt;span style="color: e00000;"&gt;v&lt;/span&gt;&lt;span style="color: f00000;"&gt;e&lt;/span&gt;&lt;span style="color: ff00000;"&gt;n&lt;/span&gt;&lt;br /&gt;
: : &lt;/span&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : by using the [ color=xxxxxx].....[/color] tag, where the xxxxxx is the RGB HEX values.&lt;br /&gt;
: : &lt;br /&gt;
: : Also, i also now support the use of &lt;br /&gt;
: : [ code=xxxxxx] &lt;br /&gt;
: : Where you can set the default background color of a code block, like&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : case "blue"
: :     if closed=false then
: :         strBuf = strBuf &amp;amp; "&amp;lt;font color=""Blue""&amp;gt;"
: :     else
: :         strBuf = strBuf &amp;amp; "&amp;lt;/font&amp;gt;"
: :     end if
: : &lt;/pre&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: : &lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: &lt;br /&gt;
: Very cool! Thanks a million!&lt;br /&gt;
: &lt;br /&gt;
&lt;pre class="sourcecode"&gt; testing &lt;/pre&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;testing&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="sourcecode"&gt;Ignore this post&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&lt;em&gt; if this post works this is damn cool man
&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86955/re-arbitrary-colors-in-style-code/#86955</guid>
      <pubDate>Fri, 16 Nov 2001 08:58:27 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>pls ignore my posts - i am testing</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86956/pls-ignore-my-posts---i-am-testing/#86956</link>
      <description>: : : I today rewrote the message rendering code and added support for any color and and code background.&lt;br /&gt;
: : : &lt;br /&gt;
: : : So, now you can do this&lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;span style="font-size: large;"&gt;&lt;br /&gt;
: : : &lt;span style="color: 000000;"&gt;P&lt;/span&gt;&lt;span style="color: 100000;"&gt;r&lt;/span&gt;&lt;span style="color: 200000;"&gt;o&lt;/span&gt;&lt;span style="color: 300000;"&gt;g&lt;/span&gt;&lt;span style="color: 400000;"&gt;r&lt;/span&gt;&lt;span style="color: 500000;"&gt;a&lt;/span&gt;&lt;span style="color: 600000;"&gt;m&lt;/span&gt;&lt;span style="color: 700000;"&gt;m&lt;/span&gt;&lt;span style="color: 800000;"&gt;e&lt;/span&gt;&lt;span style="color: 900000;"&gt;r&lt;/span&gt;&lt;span style="color: a00000;"&gt;s&lt;/span&gt; &lt;span style="color: b00000;"&gt;H&lt;/span&gt;&lt;span style="color: c00000;"&gt;e&lt;/span&gt;&lt;span style="color: d00000;"&gt;a&lt;/span&gt;&lt;span style="color: e00000;"&gt;v&lt;/span&gt;&lt;span style="color: f00000;"&gt;e&lt;/span&gt;&lt;span style="color: ff00000;"&gt;n&lt;/span&gt;&lt;br /&gt;
: : : &lt;/span&gt;&lt;br /&gt;
: : : &lt;br /&gt;
: : : by using the [ color=xxxxxx].....[/color] tag, where the xxxxxx is the RGB HEX values.&lt;br /&gt;
: : : &lt;br /&gt;
: : : Also, i also now support the use of &lt;br /&gt;
: : : [ code=xxxxxx] &lt;br /&gt;
: : : Where you can set the default background color of a code block, like&lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;pre class="sourcecode"&gt;
: : : case "blue"
: : :     if closed=false then
: : :         strBuf = strBuf &amp;amp; "&amp;lt;font color=""Blue""&amp;gt;"
: : :     else
: : :         strBuf = strBuf &amp;amp; "&amp;lt;/font&amp;gt;"
: : :     end if
: : : &lt;/pre&gt;&lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;br /&gt;
: : &lt;br /&gt;
: : Very cool! Thanks a million!&lt;br /&gt;
: : &lt;br /&gt;
: &lt;span style="color: 00ff00;"&gt; testing &lt;/span&gt;&lt;br /&gt;
: &lt;span style="color: 100000;"&gt;testing&lt;/span&gt;&lt;br /&gt;
: &lt;span style="color: 100001;"&gt;Ignore this post&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: &lt;em&gt; if this post works this is damn cool man
: &lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86956/pls-ignore-my-posts---i-am-testing/#86956</guid>
      <pubDate>Fri, 16 Nov 2001 09:00:12 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/86986/re-arbitrary-colors-in-style-code/#86986</link>
      <description>Well, you could easily use VIM as an external text filter.  Let's say you encounter:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Black;"&gt;[&lt;/span&gt;code=ff0000 lang=fortran]&lt;br /&gt;
   ... text ...&lt;br /&gt;
&lt;span style="color: Black;"&gt;[&lt;/span&gt;/code]&lt;br /&gt;
&lt;br /&gt;
You gather up the text and pass it off to VIM along with the language name. VIM would markup the text with the appropriate style-code and return it to you.  You could feed the text to VIM via stdin, and receive the altered text via stdout (like a CGI app), or you could just save it the text to a temp file and pass the filename to VIM.&lt;br /&gt;
&lt;br /&gt;
I've not had the occasion to use ASP before, but if it requires external code to reside in a COM component, we could easily write one that exported a single conversion function and took care of invoking VIM...&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
  string markupText( in string text, in string language )
&lt;/pre&gt;&lt;br /&gt;
Of course, spawning external processes to do work is not as fast as memory resident server extensions, but that wouldn't really be an issue here.  This would only need to be done once with each new post.&lt;br /&gt;
&lt;br /&gt;
Once this was in place, Programmer's Heaven would be able to automatically syntax highlighting for over 300 filetypes!&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt; abaqus, abc, abel, acedb, ada, aflex, ahdl, amiga, aml, antlr, apache, apachestyle, asm, asm68k, asmh8300, asn, aspperl, aspvbs, atlas, automake, ave, awk, ayacc, b, basic, bc, bdf, bib, bindzone, blank, btm, c, catalog, cf, cfg, ch, change, changelog, cl, clean, clipper, cobol, colortest, conf, config, cpp, crontab, csc, csh, csp, css, cterm, ctrlh, cupl, cuplsim, cvs, cweb, cynlib, cynpp, dcl, debchangelog, debcontrol, def, diff, diva, dns, docbk, dosbatch, dosini, dot, dracula, dsl, dtd, dtml, dylan, dylanintr, dylanlid, ecd, eiffel, elf, elmfilt, erlang, esqlc, eterm, expect, exports, fgl, focexec, form, forth, fortran, foxpro, fvwm, gdb, gdmo, gedcom, gnuplot, gp, groff, gsp, gtkrc, haskell, hb, help, hercules, hitest, hog, html, htmlm4, htmlos, ia64, icon, idl, idlang, indent, inform, inittab, ishd, iss, ist, jam, jargon, java, javacc, javascript, jess, jgraph, jproperties, jsp, kix, kscript, kwt, lace, latte, lex, lftp, lhaskell, lilo, lisp, lite, lotos, lout, lprolog, lss, lua, lynx, m4, mail, make, man, manual, maple, masm, mason, master, matlab, mel, mf, mgp, mib, mma, model, modsim3, modula2, modula3, mp, msql, mush, muttrc, named, nasm, nastran, natural, ncf, nosyntax, nqc, nroff, objc, ocaml, omnimark, openroad, opl, ora, papp, pascal, pcap, pccts, perl, pfmain, php, phtml, pic, pike, pilrc, pine, plm, plsql, po, pod, postscr, pov, povini, ppwiz, procmail, progress, prolog, psf, ptcap, purifylog, python, qf, r, radiance, ratpoison, rc, rcslog, readline, rebol, registry, remind, rexx, robots, rpcgen, rtf, ruby, samba, sas, sather, scheme, screen, sdl, sed, sgml, sgmldecl, sgmllnx, sh, sicad, simula, sinda, sindacmp, sindaout, skill, sl, slang, slrnrc, slrnsc, sm, smil, smith, sml, snnsnet, snnspat, snnsres, snobol4, spec, specman, spice, spup, sql, sqlforms, sqr, squid, st, stp, strace, syncolor, synload, syntax, tads, tags, tak, takcmp, takout, tasm, tcl, terminfo, tex, texinfo, texmf, tf, tidy, tli, trasys, tsalt, tsscl, tssgm, tssop, types, uc, uil, vb, verilog, vgrindefs, vhdl, vim, viminfo, virata, vrml, vsejcl, wdiff, web, webmacro, wget, whitespace, winbatch, wml, wsh, xdefaults, xkb, xmath, xml, xpm, xpm2, xs, xxd, yacc, z8a, zsh &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Personally, it doesn't make a difference to me.  My editor already does this for me.  But if you want to add this for everyone elses benefit, I could help you out with the VIM part of it, supplying the conversion script and the appropriate command-line.  If you think it would be feasible (you know more about your website setup than I do), I could even write the COM component for you.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/86986/re-arbitrary-colors-in-style-code/#86986</guid>
      <pubDate>Fri, 16 Nov 2001 12:21:37 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87204/re-arbitrary-colors-in-style-code/#87204</link>
      <description>Hi&lt;br /&gt;
&lt;br /&gt;
calling processes/execute programs externally from the server  for rendering the code sounds like a to much resource-intensive task for the server. The rendering of the posts is also done in realtime to get the best flexibility.&lt;br /&gt;
&lt;br /&gt;
Of course it could be done once when posting, but that is not a very flexible solution because you will get problems if you got bugs in the rendering and you want to re-render the messages. Its quite difficult to "remove" the rendering from the original post. And storing two versions of the same message (one un-rendered and one renderend) is not a solution either. So it got to be realtime with low overhead.&lt;br /&gt;
&lt;br /&gt;
I agree that it could be a very simple way of doing it, but perhaps not the best way for a high-volume WEB-site. It needs to be a COM-component or a ASP script to do this efficiently. &lt;br /&gt;
&lt;br /&gt;
It could also be a simple thing to do if I moved to .NET (that I hope to be able to do in the future).&lt;br /&gt;
&lt;br /&gt;
I think making a parser would be the simplest solution at the moment. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87204/re-arbitrary-colors-in-style-code/#87204</guid>
      <pubDate>Sun, 18 Nov 2001 08:48:35 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87283/re-arbitrary-colors-in-style-code/#87283</link>
      <description>: calling processes/execute programs externally from the server  for rendering the code sounds like a to much resource-intensive task for the server. The rendering of the posts is also done in realtime to get the best flexibility.&lt;br /&gt;
&lt;br /&gt;
I assume 'rendering in realtime' means that style-code is converted to HTML each time the page is served, rather than once when the message is posted.  In that case, yeah, it would be a bit resource intensive, mostly because VIM does not perform the conversion very quickly (can take over a second if the code is long enough).&lt;br /&gt;
&lt;br /&gt;
On the other hand, while spawning external processes is not ideal, it's not as bad as you think. After all, this is how all dynamic content was generated for most of the Web's history (i.e. CGI).&lt;br /&gt;
&lt;br /&gt;
: Of course it could be done once when posting, but that is not a very flexible solution because you will get problems if you got bugs in the rendering and you want to re-render the messages. Its quite difficult to "remove" the rendering from the original post. And storing two versions of the same message (one un-rendered and one renderend) is not a solution either. So it got to be realtime with low overhead.&lt;br /&gt;
&lt;br /&gt;
Well, clearly it doesn't &lt;em&gt;have&lt;/em&gt; to be (no one is holding a gun to your head), but I agree that it is the most elegant way to do it.&lt;br /&gt;
&lt;br /&gt;
: I agree that it could be a very simple way of doing it, but perhaps not the best way for a high-volume WEB-site. It needs to be a COM-component or a ASP script to do this efficiently. &lt;br /&gt;
&lt;br /&gt;
Even with the overhead of spawning an external process, it would still be faster to do the conversion with a native app than with an ASP script. I mean, ASP uses ActiveScript, right? I've not used ASP before, but I'm familar with the Microsoft's JScript implementation.  It's &lt;em&gt;extremly&lt;/em&gt; fast - orders of magnitude faster than the Mozilla implementation of ECMA-262.  Yes it is still far, far slower than native code.&lt;br /&gt;
&lt;br /&gt;
Another alternative would be to turn VIM into a COM component (it &lt;em&gt;is&lt;/em&gt; open source), but that's a lot of work.  Too much for me anyway.  ;) Like I said, I already have this feature via my editor.&lt;br /&gt;
&lt;br /&gt;
: It could also be a simple thing to do if I moved to .NET (that I hope to be able to do in the future).&lt;br /&gt;
&lt;br /&gt;
Why, does .NET come with built in syntax highlighting libraries. ;)&lt;br /&gt;
&lt;br /&gt;
: I think making a parser would be the simplest solution at the moment. &lt;br /&gt;
&lt;br /&gt;
Writing a C++ parser is the 'simplest solution'? OK. Good luck!&lt;br /&gt;
&lt;br /&gt;
If you're going to do the parsing yourself, I would not recommend writing full-blown, grammar based language parsers - this is overkill, and would make the cost of adding support for new languages prohibitively high.  I would do what VIM does - use regular expressions to get "close enough".  That makes it easy to add new languages, which is precisely why VIM supports so many.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87283/re-arbitrary-colors-in-style-code/#87283</guid>
      <pubDate>Sun, 18 Nov 2001 22:23:34 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87296/re-arbitrary-colors-in-style-code/#87296</link>
      <description>: On the other hand, while spawning external processes is &lt;br /&gt;
: not ideal, it's not as bad as you think. After all, this &lt;br /&gt;
: is how all dynamic content was generated for most of &lt;br /&gt;
: the Web's history (i.e. CGI).&lt;br /&gt;
: &lt;br /&gt;
I know that , but still, its much more resource intensive than  a ASP/COM solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: &lt;br /&gt;
: Even with the overhead of spawning an external process, &lt;br /&gt;
: it would still be faster to do the conversion with a native &lt;br /&gt;
: app than with an ASP script. I mean, ASP uses ActiveScript,&lt;br /&gt;
:  right? I've not used ASP before, but I'm familar with the&lt;br /&gt;
: Microsoft's JScript implementation.  It's &lt;em&gt;extremly&lt;br /&gt;
: &lt;/em&gt; fast - orders of magnitude faster than the Mozilla&lt;br /&gt;
: implementation of ECMA-262.  Yes it is still far, far slower&lt;br /&gt;
: than native code.&lt;br /&gt;
&lt;br /&gt;
I have found ASP to be quite fast, its not as fast (of course) as a COM object or native code, but the IIS is caching the interpreted ASP scripts , so its quite fast. I think a good start could be to do some simpler color syntax thing to get started ,like making the comments in one color and the rest in a another color.&lt;br /&gt;
&lt;br /&gt;
I guess I need to do some regular expression hacking to get this done. I am using that to render the messages today.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: &lt;br /&gt;
: Another alternative would be to turn VIM into a COM &lt;br /&gt;
: component (it &lt;em&gt;is&lt;/em&gt; open source), but that's a &lt;br /&gt;
: lot of work.  Too much for me anyway.  ;) Like I said, I &lt;br /&gt;
: already have this feature via my editor.&lt;br /&gt;
&lt;br /&gt;
That sounds like to much work, its not worth that effort. but I am sure there must be some open-source or public domain sourcecode for a tool like that.&lt;br /&gt;
&lt;br /&gt;
: &lt;br /&gt;
: Why, does .NET come with built in syntax highlighting libraries. ;)&lt;br /&gt;
&lt;br /&gt;
No, but in .NET you can create more advanced WEB-solution/parsers more easily. doing COM is just a lot of trouble, COM is quite a nightmare to develop, test, register, unregister, restarting the WEB-server each time.... &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87296/re-arbitrary-colors-in-style-code/#87296</guid>
      <pubDate>Mon, 19 Nov 2001 00:04:39 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87370/re-arbitrary-colors-in-style-code/#87370</link>
      <description>: I think a good start could be to do some simpler color syntax thing to get started ,like making the comments in one color and the rest in a another color.&lt;br /&gt;
&lt;br /&gt;
If you do move in that direction - &lt;em&gt;please&lt;/em&gt; make it optional. ;)&lt;br /&gt;
&lt;br /&gt;
: I guess I need to do some regular expression hacking to get this done. I am using that to render the messages today.&lt;br /&gt;
&lt;br /&gt;
If you made your regular expression based highlighting system compatible with VIM, then you could take advantage of VIM's plethora of syntax definitions. &lt;br /&gt;
&lt;br /&gt;
Come to think of it, VIM is extremely modular - the syntax highlighting portion of the code is totally optional, and can be easily #defined out of a build.  So the highlighting code &lt;em&gt;might&lt;/em&gt; be easy to hack out and turn into a standalone highlighting component.  I'll look into it tonight.&lt;br /&gt;
 &lt;br /&gt;
: That sounds like to much work, its not worth that effort. but I am sure there must be some open-source or public domain sourcecode for a tool like that.&lt;br /&gt;
&lt;br /&gt;
Not really.  I've seen one that supports C++ and Java, but it uses full-blown language parsers (via LEX and YACC), so extending it to support other languages is non-trivial (writing a whole new scanner-parser!).&lt;br /&gt;
&lt;br /&gt;
: doing COM is just a lot of trouble, COM is quite a nightmare to develop, test, register, unregister, restarting the WEB-server each time.... &lt;br /&gt;
&lt;br /&gt;
Why do you have to test the component in the web server?  You write the object first in a regular, stand-alone app, where testing is easy.  Perfect it there.  You then "COM-ify" it, testing it with another stand-alone host app. MSVC++ registers the component for you automatically each time you re-build, so it's pretty painless.  Only after the component is verified rock-solid do you move it over the the web server.&lt;br /&gt;
&lt;br /&gt;
Yes, writing the COM-glue from scratch can be painful - but ATL makes it much easier, and MFC makes it trivial.  Besides, you really only need a COM object that exposes one method "markup( code, language )".  Not too hard. ;)&lt;br /&gt;
&lt;br /&gt;
Hmmm... as long as you were going to pass &lt;em&gt;part&lt;/em&gt; of the text to a native app, you might as well just pass all of it. Something like "StyleCodeToHTML(buffer)".  If I wrote such a thing, would you be willing to try it out?&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87370/re-arbitrary-colors-in-style-code/#87370</guid>
      <pubDate>Mon, 19 Nov 2001 11:55:17 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87389/re-arbitrary-colors-in-style-code/#87389</link>
      <description>: Hmmm... as long as you were going to pass &lt;em&gt;part&lt;/em&gt; of the text to a native app, you might as well just pass all of it. Something like "StyleCodeToHTML(buffer)".  If I wrote such a thing, would you be willing to try it out?&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Sure, I always appreciate all kinds of contributions and you will of course get full credits for that on the site. &lt;br /&gt;
&lt;br /&gt;
I would require to get access to the sourcecode to make sure its not a trojan horse or something &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt; I don't want to run strange COM objects that I don't trust, I hope you understand that.&lt;br /&gt;
&lt;br /&gt;
But I think before you do anything that we have to lookaround for existing solutions. PErhaps there are some Perl/PHP stuff that can be converted? There's no point in inventing the wheel again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;em&gt;&lt;strong&gt;/WEBMASTER&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87389/re-arbitrary-colors-in-style-code/#87389</guid>
      <pubDate>Mon, 19 Nov 2001 13:42:23 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
    <item>
      <title>Re: Arbitrary colors in style-code</title>
      <link>http://www.programmersheaven.com/mb/pheaven/85731/87392/re-arbitrary-colors-in-style-code/#87392</link>
      <description>: : Hmmm... as long as you were going to pass &lt;em&gt;part&lt;/em&gt; of the text to a native app, you might as well just pass all of it. Something like "StyleCodeToHTML(buffer)".  If I wrote such a thing, would you be willing to try it out?&lt;br /&gt;
: : &lt;br /&gt;
: &lt;br /&gt;
: Sure, I always appreciate all kinds of contributions and you will of course get full credits for that on the site.&lt;br /&gt;
: &lt;br /&gt;
: I would require to get access to the sourcecode to make sure its not a trojan horse or something &lt;img src="http://www.programmersheaven.com/images/Community/smile.gif" width="15" height="15" alt="" /&gt; I don't want to run strange COM objects that I don't trust, I hope you understand that.&lt;br /&gt;
&lt;br /&gt;
I understand completely.&lt;br /&gt;
&lt;br /&gt;
: But I think before you do anything that we have to lookaround for existing solutions. PErhaps there are some Perl/PHP stuff that can be converted? There's no point in inventing the wheel again.&lt;br /&gt;
&lt;br /&gt;
Sure. Of course, a Perl implementation would be no better than invoking VIM, right?  Anyway, I'll look around.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Eric&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pheaven/85731/87392/re-arbitrary-colors-in-style-code/#87392</guid>
      <pubDate>Mon, 19 Nov 2001 14:02:38 -0700</pubDate>
      <category>Comments on this site</category>
    </item>
  </channel>
</rss>