Intended to be used in context of Jupyter and IPython projects, particularly by display areas.
Installation
npm install transformime
Usage
Transformime works in the browser (via browserify), converting a mimebundle (MIME type + data) into HTML Elements. transformime.transform returns promises for all the HTMLElements.
> // Create an arbitrary iframe and slap it in the body of the document> var iframe = document.createElement("iframe");> document.querySelector('body').appendChild(iframe);> var idoc = iframe.contentDocument;> // Pass the iframe's document as the document context for the created element> var p5 = t.transform({'text/html': '<h1>mimetic</h1>'}, idoc);> p5.then(function(result){... idoc.querySelector('body').appendChild(result.el);... })> idoc.querySelector(