-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fetching output of display #255
Comments
Do you have a MWE? |
Here is a minimum example. $ cat example.jl
struct DF x end
Base.show(io::IO, ::MIME"text/plain", df::DF) = print(io, "DF($(df.x)) as text/plain")
Base.show(io::IO, ::MIME"text/html", df::DF) = print(io, "DF($(df.x)) as text/html")
Base.show(io::IO, ::MIME"text/latex", df::DF) = print(io, "DF($(df.x)) as text/latex")
#-
foreach(display, [DF(1), DF(2)])
DF(3)
#-
display(MIME("text/latex"), DF(4))
$ julia example.jl
DF(1) as text/plain
DF(2) as text/plain
DF(4) as text/latex
$ julia --project=. -e 'import Literate; Literate.markdown("example.jl", "mfe"; execute=true)'
[ Info: generating markdown page from `~/a/curr_research/Literate.jl/example.jl`
[ Info: writing result to `~/a/curr_research/Literate.jl/mfe/example.md`
$ cat mfe/example.md
```@meta
EditURL = "../example.jl"
```
````julia
struct DF x end
Base.show(io::IO, ::MIME"text/plain", df::DF) = print(io, "DF($(df.x)) as text/plain")
Base.show(io::IO, ::MIME"text/html", df::DF) = print(io, "DF($(df.x)) as text/html")
Base.show(io::IO, ::MIME"text/latex", df::DF) = print(io, "DF($(df.x)) as text/latex")
````
````julia
foreach(display, [DF(1), DF(2)])
DF(3)
````
```@raw html
DF(3) as text/html
```
````julia
display(MIME("text/latex"), DF(4))
````
---
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have some
display()
calls in my code, but it seems they're not showing up in the generated markdown.#128 marks this as fixed, but perhaps it only fixed it for the notebook output.
@fredrikekre This was fixed for notebooks in ceff7a3 and a TODO was added for markdown. Would the fix for markdown be similar to the notebook fix? Or is it more complicated? If it's straightforward, I can make a PR with the changes for markdown.
The text was updated successfully, but these errors were encountered: