2018-01-03 11:13:12 +01:00
|
|
|
|
~~~~{.julia}
|
|
|
|
|
import Base
|
|
|
|
|
function Base.show(io::IO, m::MIME"text/html", x::Array)
|
|
|
|
|
print(io, "<table>")
|
|
|
|
|
for i in 1:size(x,1)
|
|
|
|
|
print(io, "<tr>")
|
|
|
|
|
[print(io, "<td>$r</td>") for r in x[i,:]]
|
|
|
|
|
print(io, "</tr>")
|
|
|
|
|
end
|
|
|
|
|
print(io, "</table>")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#This isn't valid latex, doesn't matter for the test
|
|
|
|
|
function Base.show(io::IO, m::MIME"text/latex", x::Array)
|
|
|
|
|
println(io, "\\begin{tabular}")
|
|
|
|
|
for i in 1:size(x,1)
|
|
|
|
|
[print(io, "$r & ") for r in x[i,:]]
|
2018-07-24 10:46:04 +02:00
|
|
|
|
print(io, "\\\\")
|
2018-01-03 11:13:12 +01:00
|
|
|
|
println(io, " \\hline")
|
|
|
|
|
end
|
|
|
|
|
print(io, "\\end{tabular")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#This isn't valid markdown, doesn't matter for the test
|
|
|
|
|
function Base.show(io::IO, m::MIME"text/markdown", x::Array)
|
|
|
|
|
println(io, "-----")
|
|
|
|
|
for i in 1:size(x,1)
|
|
|
|
|
print(io, "| ")
|
|
|
|
|
[print(io, "$r | ") for r in x[i,:]]
|
|
|
|
|
println(io, "")
|
|
|
|
|
end
|
|
|
|
|
print(io, "-----")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = [collect(1:3) collect(1:3)]
|
|
|
|
|
ca = collect('a':'d')
|
|
|
|
|
ca
|
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-----
|
|
|
|
|
| a |
|
|
|
|
|
| b |
|
|
|
|
|
| c |
|
|
|
|
|
| d |
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
|
|
~~~~{.julia}
|
|
|
|
|
display(ca)
|
|
|
|
|
display(x)
|
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-----
|
|
|
|
|
| a |
|
|
|
|
|
| b |
|
|
|
|
|
| c |
|
|
|
|
|
| d |
|
|
|
|
|
-----
|
|
|
|
|
-----
|
|
|
|
|
| 1 | 1 |
|
|
|
|
|
| 2 | 2 |
|
|
|
|
|
| 3 | 3 |
|
|
|
|
|
-----
|
|
|
|
|
|
2018-01-03 18:32:10 +01:00
|
|
|
|
~~~~{.julia}
|
|
|
|
|
julia> x
|
|
|
|
|
3×2 Array{Int64,2}:
|
|
|
|
|
1 1
|
|
|
|
|
2 2
|
|
|
|
|
3 3
|
|
|
|
|
|
|
|
|
|
julia> ca
|
|
|
|
|
4-element Array{Char,1}:
|
|
|
|
|
'a'
|
|
|
|
|
'b'
|
|
|
|
|
'c'
|
|
|
|
|
'd'
|
|
|
|
|
|
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-03 11:13:12 +01:00
|
|
|
|
~~~~{.julia}
|
2018-07-24 10:46:04 +02:00
|
|
|
|
using Markdown
|
|
|
|
|
m = Markdown.parse("**Some Markdown**")
|
2018-01-03 11:13:12 +01:00
|
|
|
|
m
|
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Some Markdown**
|
|
|
|
|
|