I’ve been using ob-ipython in
org-mode lately with ijulia as the kernel. In general, it works pretty well and
papers over some of the current issues with ob-julia. The one thing it doesn’t
do natively is formatting the results as org-mode tables when an array or
dataframe is returned. To get around this, I currently have the following
snippet in my .juliarc.jl (definition for orgify not shown but can be shared
if interest).
"Tries to represent arrays as an org-table"
function Base.show(st::IO, ty::MIME"text/org", x::AbstractArray)
stringrepresentations = map(string,x)
write(st, orgify(stringrepresentations))
end
"Tries to represent as an org-table"
function Base.show(st::IO, ty::MIME"text/org", x)
write(st, orgify(x))
end
This works fairly well for my purposes, but it occurred to me that this is
functionality probably worth sharing (whether shared as julia package or emacs
package yet to be determined). However, I shouldn’t really be publishing a package
anywhere that has this kind of type-piracy. Any ideas how to avoid the
type-piracy here?