 
 ;; Incanter Plot
 
-(defrecord IncanterPlot [chart width height])
+(defrecord IncanterPlot [chart width height]
 
-(extend-protocol mc/PMimeConvertible
-  IncanterPlot
+  mc/PMimeConvertible
   (to-mime [plot]
     (let [out (io/java.io.ByteArrayOutputStream.)
           {:keys [chart width height]} plot]


;; Markdown

(defrecord Markdown [markdown])

(extend-protocol mc/PMimeConvertible
  Markdown
  (to-mime [self]
    (mc/stream-to-string
      {:text/markdown (:markdown self)})))

(defn make-markdown [latex]
  (Markdown. latex))


;; Html

(defrecord Html [html]

  mc/PMimeConvertible
  (to-mime [_]
    (mc/stream-to-string
     {:text/html html})))

(defn make-html [html]
  (Html. html))

;; Latex

(defrecord Latex [latex]

  mc/PMimeConvertible
  (to-mime [_]
    (mc/stream-to-string
     {:text/latex latex})))

(defn make-latex [latex]
  (Latex. latex))
