After I couldn't find a decent way to implement nice, colorful code snippets inside blogger (which holds me back from posing code related articles) as I mentioned in my last post, and after checking "CopySourceAsHtml" as suggested by Asher in his comment to my last post (and didn't like it - it creates HTML I really don't want to use), I decided to go on with writing my own converter.
I used the GOLD parsing system, along with the Calitha gold parser engine to parse source code of a given grammar (grammars for GOLD can be found here), added some metadata to that grammar (currently I've only done a proof-of-concept, so everything is hard-coded) that defines how to indent and colorize (HTMLize) it, and wrote this application:
Next will probably be adding another language (C# - currently only tried it with XML), extracting metadata to external files (should see if I can merge it with the GOLD parser grammar files, and read it from there somehow), and making things look nicer, for starters.
The code is currently not available for download, but I'll probably start a project on sourceforge for that soon. I'll post an update when I will.
This comment has been removed by a blog administrator.
ReplyDelete