Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 003fc46

Browse files
committed
Add a json display function
1 parent 3712a8b commit 003fc46

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/main/java/org/scijava/notebook/NotebookService.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ default Object latex(String content) {
126126
default Object table(Object table) {
127127
return display(table, HTMLTableNotebookOutput.class);
128128
}
129+
130+
default Object json(String content) {
131+
JsonSlurper jsonSlurper = new JsonSlurper();
132+
Object json = jsonSlurper.parseText(content);
133+
return displayMimetype("application/json", json);
134+
}
129135

130136
default Object vega(String content) {
131137
return vega3(content);

0 commit comments

Comments
 (0)