-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displaying JSON data #934
Comments
Wouldn't it be sufficient to add |
There seems to be two separate display systems in place:
The following works for the first system: const JSON_TYPES = [String, Real, Nothing, Bool, Array, Dict]
for T in JSON_TYPES
@eval begin
IJulia._showable(::MIME"application/json", ::$T) = true
IJulia.display_mimejson(mime::MIME"application/json", x::$T) = (mime, JSON.JSONText(JSON.json(x)))
end
end
IJulia.register_jsonmime(MIME"application/json"()) but then the JSON output format is always used for displaying these types, which isn't what's desired. Ideally you should just be able to call |
Jupyter has a special type of output cell for JSON data, which you can get in Python by wrapping parsed data (dict or list) in a
IPython.display.JSON
object and displaying it using IPython's built-in display machinery (just having it as the last line of a cell is enough). Is there an equivalent way to do this in IJulia, using a value fromJSON.parse
?The closest thing I can get is
display(MIME"application/json"(), s::String)
which triggers the correct output cell type, but only displays the literal strings
. This method does not work forDict
orArray
.The text was updated successfully, but these errors were encountered: