-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(rule | ||
(targets test.jpynb) | ||
(deps | ||
(:x test.md) | ||
(package mdx)) | ||
(action | ||
(with-stdout-to | ||
%{targets} | ||
(run %{bin:ocaml-mdx} jupyter %{x})))) | ||
|
||
(rule | ||
(alias runtest) | ||
(deps | ||
(:x test.jpynb) | ||
(:y test.jpynb.expected)) | ||
(action | ||
(diff? %{y} %{x}))) |
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 @@ | ||
{"metadata":{"kernelspec":{"display_name":"OCaml 4.07.1","language":"OCaml","name":"ocaml-jupyter"},"language_info":{"name":"OCaml","version":"4.07.1","codemirror_mode":"text/x-ocaml","file_extension":".ml","mimetype":"text/x-ocaml","nbconverter_exporter":null,"pygments_lexer":"OCaml"}},"nbformat":4,"nbformat_minor":2,"cells":[{"cell_type":"markdown","metadata":{},"source":"## Generating a Jupyter notebook\n\n\n"},{"cell_type":"code","metadata":{},"source":"let x = 1\nlet () = assert true","outputs":[],"execution_count":1},{"cell_type":"markdown","metadata":{},"source":"\nThis block should not be executed by the tests:"},{"cell_type":"code","metadata":{},"source":"let x = 2\nlet () = assert false (* Don't print this! *)","outputs":[],"execution_count":2},{"cell_type":"code","metadata":{},"source":"let () = print_int x","outputs":[],"execution_count":3}]} |
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,16 @@ | ||
## Generating a Jupyter notebook | ||
|
||
```ocaml | ||
let x = 1 | ||
let () = assert true | ||
``` | ||
|
||
This block should not be executed by the tests: | ||
```ocaml skip | ||
let x = 2 | ||
let () = assert false (* Don't print this! *) | ||
``` | ||
|
||
```ocaml | ||
let () = print_int x | ||
``` |