Try adding

:results value raw

 to your options.
Here is what the org manual says:

The results are interpreted as raw Org mode code and are inserted directly
into the buffer. If the results look like a table they will be aligned as 
such by Org mode.

org is a fantastic environment for playing with Clojure.  I've got a lot 
done with it.

Regards,
Greg

On Friday, March 1, 2013 11:29:17 PM UTC-5, Mark C wrote:
>
> Sorry in advance if this doesn't turn out to be a clojure-specific 
> problem, but this seemed like a reasonable place to ask..
>
> Context: I'm a heavy org-mode user, so Mike Fogus' recent "usesthis" 
> post<http://mike.fogus.usesthis.com/>mentioning org-mode babel was quite 
> interesting. I got babel working fine 
> (for clojure, elisp, sh) then recalled that print-table in Clojure 1.5 
> outputs in org-mode compatible table format. Awesome. So naturally I'd like 
> to generate nice looking tables using something like:
>
> #+begin_src clojure :exports both
>     (with-out-str (print-table [{:a 1 :b 2 :c 3} {:b 5 :a 7 :c "dog"}]))
> #+end_src
>
> (Using with-out-str is needed because print-table of course returns nil)
>
> But what I get when generating HTML (via "C-c C-e b") is not a table, but 
> the literal text of the table markup. I.e. compiling the above source block 
> yeilds:
>
> #+RESULTS: clojure-org-table
> : 
> : | :a |  :c | :b |
> : |----+-----+----|
> : |  1 |   3 |  2 |
> : |  7 | dog |  5 |
>
> This makes sense. But how might one go about getting an HTML table 
> generated?
>
> I can edit the results show above and add some attributes before HTML 
> generation, e.g.
>
> #+CAPTION: This is a table with lines around and between cells
> #+ATTR_HTML: border="2" rules="all" frame="border"
> | :a |  :c | :b |
> |----+-----+----|
> |  1 |   3 |  2 |
> |  7 | dog |  5 |
>
> This yields a nice looking table in HTML, but I would like to eliminate 
> this manual step. Any ideas??
>
> Thanks,
> Mark
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to