       content   : String
       html      : String
       checksum  : String
+      origin    : ObjectId
     sharedMethods   :
       static        : ['generateHTML']
 

    Module::update.apply this, arguments

  save:->
    @html = @generateHTML @content
    super

  @create = (formData, callback)->
    data = formData
    markdownDoc = null

    daisy queue = [
      =>
        data.checksum = @generateChecksum data.content
        queue.next()
      =>
        markdownDoc = new @ data
        queue.next()
      ->
        markdownDoc.save (err)->
          if err then callback err
          else callback null, markdownDoc
    ]


module.exports = class JMarkdownDoc extends Module

  {daisy, secure, ObjectId} = require 'bongo'

  @share()

