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


module.exports = class JMarkdownDoc extends Module

  {daisy} = require 'bongo'

  @share()


    Module::update.apply this, arguments

  save:->
    @html     = JMarkdownDoc.generateHTML @content
    @checksum = JMarkdownDoc.generateChecksum @content
    super

  @create$ = secure (client, formData, callback)->
    formData.origin = client.connection.delegate.getId()
    @create formData, callback

  @create = (formData, callback)->
    markdownDoc = new @ formData
    markdownDoc.save (err)->
      if err then callback err
      else callback null, markdownDoc
