I guess another good option could be to put more weight behind <https://github.com/nim-lang/RFCs/issues/447>
Once you have a JSON representation the rest is comparatively easily doable, getting that proper first JSON representation though is going to need a bit of work, given that e.g. jsondoc doesn't split out doc comments.