
It all boils down to (?:.|\n)*?</\s*\1\s*>
Posted Saturday, 7 March, 2009 - 19:16 by the FiddlerOr, more specifically, @"<(mml:math)[^>]*?>(?:.|\n)*?</\s*\1\s*>".
Ah, the beauty of a regex: so powerful, concise and oh so readable. (Thank $deity for regex libraries!)
What this obscure little monster does, is strip MathML tags from XML files. MathML tags, just like those used in OpenGL reference pages.
Yes, OpenTK now comes with integrated OpenGL documentation. No, it's not perfect yet: the generator is not smart enough to deal with all cases, but it works. Obligatory screenshots at the bottom of the post.
The process is simple enough: OpenGL functions come with corresponding docs (a quick estimation indicates that roughly 1 out of 3 functions is documented). The generator strips unsupported tags from the docs, feeds them to an XSL transform and outputs the results to GL.cs.
Unfortunately this tends to skip a large number of overloaded functions. This is possible to fix, but I'm not sure it's worth it now that the largest part of the API has been deprecated.
- the Fiddler's blog
- Login or register to post comments


Comments
Re: It all boils down to (?:.|\n)*?</\s*\1\s*>
How sweet is that!