Hello! I developed in OCaml a program to parse a simple TeX file and transform it into an HTML file you can render and C/C in the ScribbleHub textarea!
I do that for AGH and its works really well.
The licence is on MIT and I believe on free open source software so you can do almost everything...