
// allow to require('riot')
var riot = module.exports = require(process.env.RIOT || require('path').resolve(__dirname, '../../riot'))

var compiler = require('riot-compiler')

// allow to require('riot').compile
riot.compile = compiler.compile
riot.parsers = compiler.parsers


// allow to require('some.tag')
require.extensions['.tag'] = function(module, filename) {
  var src = riot.compile(require('fs').readFileSync(filename, 'utf8'))
  module._compile(
    'var riot = require(process.env.RIOT || "riot/riot.js");module.exports =' + src
  , filename)
}

// simple-dom helper
var sdom = require('./sdom')

function createTag(tagName, opts) {
  var root = document.createElement(tagName),
    tag = riot.mount(root, opts)[0]
  return tag
}

riot.render = function(tagName, opts) {
  var tag = createTag(tagName, opts),
    html = sdom.serialize(tag.root)
  // unmount the tag avoiding memory leaks
  tag.unmount()
  return html
}

riot.render.dom = function(tagName, opts) {
  return createTag(tagName, opts).root
}

@@ -608,142 +608,8 @@
 ')%0A%0A
-function createTag(tagName, opts) %7B%0A  var root = document.createElement(tagName),%0A    tag = riot.mount(root, opts)%5B0%5D%0A  return tag%0A%7D%0A%0A
 riot
@@ -656,23 +656,29 @@
 r tag = 
-createT
+riot.render.t
 ag(tagNa
@@ -857,36 +857,184 @@
 urn 
-createTag(tagName, opts).root
+riot.render.tag(tagName, opts).root%0A%7D%0A%0Ariot.render.tag = function(tagName, opts) %7B%0A  var root = document.createElement(tagName),%0A    tag = riot.mount(root, opts)%5B0%5D%0A  return tag
 %0A%7D%0A

Add riot.render.tag function to create raw tag