Skip to content
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

Markdown tables are not rendered correctly by Literate #247

Open
tpoisot opened this issue Oct 17, 2024 · 3 comments
Open

Markdown tables are not rendered correctly by Literate #247

tpoisot opened this issue Oct 17, 2024 · 3 comments

Comments

@tpoisot
Copy link

tpoisot commented Oct 17, 2024

I am trying to use PrettyTables with Literate, and when the table is return using the Markdown backend, Literate renders it as a code block.

In fredrikekre/Literate.jl#262 the Literate maitainers suggest that this might be because PrettyTables does not rely on show. Is there an easy fix / workaround?

@ronisbr
Copy link
Owner

ronisbr commented Oct 18, 2024

Hi @tpoisot !

Actually PrettyTables just print to the selected IO. Would it work if you call str = pretty_table(String, ...), which will render the table as a string, and then show(stdout, MIME("text/markdown"), str) ?

@tpoisot
Copy link
Author

tpoisot commented Oct 18, 2024

Good question - I'll fix a few other bugs with my documentation, and then try this and report back.

@fredrikekre
Copy link

No That won't work because a String isn't showable as text/markdown. I think something like the PrettyTable struct from fredrikekre/Literate.jl#262 (comment) would be useful. That would let the frontend decide what formatting makes sense to display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants