I will add the docs for advanced usage of medium-draft soon. Until then, you can read the code of editor.js which explains a lot of things code-wise.