I’ve started work on a ruby wrapper here.
Instead of wrapping the tree returned by libcmark, we traverse the tree to create a pure ruby structure, to avoid memory management hassles and make the AST easier to manipulate. And instead of using libcmark’s fast HTML renderer, we provide a pure ruby HTML renderer which can easily be customized and extended. We also provide idiomatic ruby functions for manipulating the AST.
I’m not sure about this approach – it might be better, performance-wise, to wrap the nodes returned by libcmark, and I might switch to that approach at some point.