-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for rich text, added display methods for markdown and latex
- Loading branch information
Showing
7 changed files
with
286 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
|
||
|
||
~~~~{.julia} | ||
using DataFrames | ||
df = DataFrame(letters = 'a':'z', numbers = 1:26) | ||
|
||
df | ||
|
||
~~~~~~~~~~~~~ | ||
|
||
|
||
~~~~ | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
~~~~ | ||
|
||
|
||
|
||
~~~~{.julia} | ||
z = 51 | ||
display(df) | ||
~~~~~~~~~~~~~ | ||
|
||
|
||
~~~~ | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
~~~~ | ||
|
||
|
||
|
||
|
||
|
||
~~~~{.julia} | ||
head(df) | ||
~~~~~~~~~~~~~ | ||
|
||
|
||
~~~~ | ||
6x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
~~~~ | ||
|
||
|
||
|
||
|
||
|
||
~~~~{.julia} | ||
julia> df | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
~~~~~~~~~~~~~ | ||
|
||
|
||
|
||
|
||
|
||
|
||
~~~~{.julia} | ||
m = Base.Markdown.parse("**Some Markdown**") | ||
m | ||
~~~~~~~~~~~~~ | ||
|
||
|
||
|
||
**Some Markdown** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
|
||
|
||
\begin{juliacode} | ||
using DataFrames | ||
df = DataFrame(letters = 'a':'z', numbers = 1:26) | ||
|
||
df | ||
|
||
\end{juliacode} | ||
\begin{juliaout} | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
\end{juliaout} | ||
|
||
\begin{juliacode} | ||
z = 51 | ||
display(df) | ||
\end{juliacode} | ||
\begin{juliaout} | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
\end{juliaout} | ||
|
||
|
||
|
||
\begin{juliacode} | ||
head(df) | ||
\end{juliacode} | ||
\begin{juliaout} | ||
6x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
\end{juliaout} | ||
|
||
|
||
|
||
\begin{juliaterm} | ||
julia> df | ||
26x2 DataFrames.DataFrame | ||
│ Row │ letters │ numbers │ | ||
┝━━━━━┿━━━━━━━━━┿━━━━━━━━━┥ | ||
│ 1 │ 'a' │ 1 │ | ||
│ 2 │ 'b' │ 2 │ | ||
│ 3 │ 'c' │ 3 │ | ||
│ 4 │ 'd' │ 4 │ | ||
│ 5 │ 'e' │ 5 │ | ||
│ 6 │ 'f' │ 6 │ | ||
│ 7 │ 'g' │ 7 │ | ||
│ 8 │ 'h' │ 8 │ | ||
⋮ | ||
│ 18 │ 'r' │ 18 │ | ||
│ 19 │ 's' │ 19 │ | ||
│ 20 │ 't' │ 20 │ | ||
│ 21 │ 'u' │ 21 │ | ||
│ 22 │ 'v' │ 22 │ | ||
│ 23 │ 'w' │ 23 │ | ||
│ 24 │ 'x' │ 24 │ | ||
│ 25 │ 'y' │ 25 │ | ||
│ 26 │ 'z' │ 26 │ | ||
\end{juliaterm} | ||
|
||
|
||
|
||
|
||
\begin{juliacode} | ||
m = Base.Markdown.parse("**Some Markdown**") | ||
m | ||
\end{juliacode} | ||
|
||
\textbf{Some Markdown} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,9 @@ head(df) | |
```julia; term=true | ||
df | ||
``` | ||
|
||
|
||
```julia | ||
m = Base.Markdown.parse("**Some Markdown**") | ||
m | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Weave, Compat | ||
using Base.Test | ||
|
||
function mmtest(source, resfile, doctype) | ||
weave("documents/$source", out_path = "documents/multimedia/$resfile", doctype=doctype, plotlib=nothing) | ||
result = @compat readstring(open("documents/multimedia/$resfile")) | ||
ref = @compat readstring(open("documents/multimedia/$resfile.ref")) | ||
@test result == ref | ||
end | ||
|
||
mmtest("rich_output.jmd", "rich_output.md", "pandoc") | ||
mmtest("rich_output.jmd", "rich_output.tex", "tex") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters