code: function(opts){
      opts = opts || {};
  
      // Pull textarea from opts or create and append a new one.
      // "Unwrap" in case a jQuery (or any $ style) object is provided.
      this.$textarea = opts.textarea !== null
          ? utils.unwrapElement(opts.textarea)
          : document.body.appendChild(document.createElement("textarea"));
  
      // Create a CodeMirror instance from $textarea
      this.editor = CodeMirror.fromTextArea(this.$textarea, {
          mode: "gfm", // Use Github flavoured Markdown
          lineWrapping: true,
          theme: opts.theme || "catdown",
          keyMap: "sublime"
      });
  
      // Create references to editor el and vertical-scroll el
      this.$editor = this.editor.display.wrapper;
      this.$scroll = this.$editor.childNodes[1];
  
      // Allow people to replace the default markdown parser.
      // Must be a function that accepts markdown and returns a HTML string.
      this.parser = opts.parser || marked;
  
      // Import the core plugins, passing along the options hash.
      // This is where most of the functionality is.
      // Contans events, rendering, key binding and associated methods.
      this.use(require("catdown-core"), opts);
  
      // Set initial value
      if(opts.value) this.set(opts.value);
  
      // If a plugins hash is passed, use each plugin
      if(opts.plugins) this.use(opts.plugins);
  
      // Setup any events in the options hash, binding the methods to instance.
      for(var ev in opts.events) this.on(ev, opts.events[ev].bind(this));
  
      // Once we're done, send a ready event.
      // Although nothing is async, it's a good convention.
      this.signal("ready");
  
      // Signal a change event every time the editor instance changes.
      this.editor.on("change", function(){
          this.signal("change");
      }.bind(this));
  
      // Focus on initialisation.
      this.focus();
  }
docs: Constructor