     html = React.createClass
       render: -> React.DOM.div className: 'user-html', dangerouslySetInnerHTML: __html: @props.value
 
-    fn 'text', 'Prints text', (string) ->
-      @add_component text value: string
+    component_fn 'text', 'Prints text', (string) ->
+      text value: string
 
-    fn 'pre', 'Prints preformatted text', (string) ->
-      @add_component pre value: string
+    component_fn 'pre', 'Prints preformatted text', (string) ->
+      pre value: string
 
-    fn 'html', 'Adds some HTML', (string) ->
-      @add_component html value: string
+    component_fn 'html', 'Adds some HTML', (string) ->
+      html value: string
 
     ErrorComponent = React.createClass
       render: -> React.DOM.pre {className: 'error'}, @props.message
 
-    fn 'error', 'Shows a preformatted error message', (message) ->
-      @add_component ErrorComponent {message}
+    component_fn 'error', 'Shows a preformatted error message', (message) ->
+      ErrorComponent {message}
 
     example = React.createClass
       render: -> React.DOM.div {className: 'example', onClick: @on_click}, @transferPropsTo source()

            React.DOM.td {}, command.doc
          ]

    cmd 'keys', 'Shows the key bindings', ->
      all_keys = {}
      # TODO some commands are functions instead of names
      build_map = (map) ->

          build_map CodeMirror.keyMap[name] for name in fallthroughs
      build_map CodeMirror.keyMap.lead

      KeyBindingComponent keys: all_keys, commands: CodeMirror.commands

    fn 'In', 'Gets previous input', (n) ->
      @value @get_input_value n

    component_fn 'object', 'Prints an object as JSON', (o) ->
      try
        s = JSON.stringify(o, null, '  ')
      catch
        s = null
      s ||= new String o
      source value: s, language: 'json'

    MarkdownComponent = React.createClass
      render: -> React.DOM.div className: 'user-html', dangerouslySetInnerHTML: __html: marked @props.value

    component_fn 'md', 'Renders Markdown', (string) ->
      MarkdownComponent value: string

    text = React.createClass
      render: -> React.DOM.p {}, @props.value
