Bringing Pharo syntax highlighting to the Internet

I would like to know if there is a way to get the Pharo syntax highlighting in the Iliad encoded web application.

Actually, the structure should not matter, because I need a simple HTML line of this kind:

<span style="color: rgb(102, 0, 0);">^</span> Set <span
style="color: rgb(0, 0, 153);">withAll:</span> <span
style="color: rgb(102, 0, 0);">self</span>

I guess this will not be trivial at all ... :)

+3
source share
3 answers

We wrote a small but quite complete syntactic marker in Pharo for Seaside. It takes a method, parses it, and outputs annotated html. You should specify only some rules in css to change the color of different AST nodes (selectors, strings, characters, numbers, keywords, variables).

WebDoc squeaksource. SourceFormatter, , , .

+2

There is also a small pigment lexer that has slightly more penetration than smalltalk based alternatives.

+1
source

All Articles