[Pharo-project] File Out html with Syntax Highlighting

Stéphane Ducasse Stephane.Ducasse at inria.fr
Thu Feb 11 07:17:23 EST 2010

Background note:
	we removed this functionality because it was badly implemented hardcoding
	<h1> everywhere.
A fileouter should act as a visitor on the class not hack inside the fileout.

People could extend the latex exporter damien cassou did. And damien did not
added '\section{' everytwhere with conditional inside the fileout behavior....
like this is done in Squeak.


On Feb 11, 2010, at 3:11 AM, Levente Uzonyi wrote:

> On Wed, 10 Feb 2010, Nathan Tuttle wrote:
>> I find it very useful when learning a language to see the code accurately
>> syntax highlighted on a web page when a snippet is shown. I want to design a
>> fileout method that will allow developers to file out code with html to put
>> into a web page.
>> I know I need to use RBFormatter; any ideas on where to go from here? Where
>> do I get a codestream for example?
> In Squeak there's a "copy html" menu item in the context menu of 
> StringHolder (available in Browser, Workspace, etc.) which copies the 
> contents as html to the clipboard. If you just want a few code snippets 
> with syntax highlight you can use this (the syntax highlight is provided 
> by Shout).
> If you need something more complex, you can still use Shout to higlight 
> your code (which will give you Text objects) and Text >> #printHtmlOn: to 
> convert it to html.
> Note that both the "copy html" menu item and the Text to html conversion 
> was removed from Pharo so you have to roll your own if you need it. Syntax 
> highlighting can still be done with Shout.
> Levente
>> thanks
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

More information about the Pharo-dev mailing list