Didn't know that. Did they open-source their solution? Thanks!
They did, and I looked at it for my adrdox too and based my solution on their concepts, though I didn't use their code (because it was too heavyweight with dependencies for my purposes).
The Wikipedia version does a *lot* of validation (as you can expect for a publicly editable site!) then pipes it out the latex program, server side, to generate the image files.