I think this would be straightforward to do with some Node code, either against a single-file HTML wiki or a Node one.
But the trouble from a TW perspective is Markdown. If all we want out of our TW is Markdown content like we could have in ten thousand other applications, then all this will work fine. But TW has much more dynamic content than Markdown can handle. So if you have a wiki with lists, filters, macros, procedures, etc. used in displaying your content, it’s all quite a bit more challenging.