“Just” print a Markdown table #13552
Replies: 6 comments 19 replies
-
An interesting addon: If I capture the result in a string and print that
that also produces
I get the plain output
i.e. without indentation. Sadly also with the x which I do not want. And even text upfront but an empty line before makes the print again fall back to |
Beta Was this translation helpful? Give feedback.
-
Ah, I maybe forgot, this is in |
Beta Was this translation helpful? Give feedback.
-
@kellertuer https://github.com/quarto-dev/quarto-cli/discussions is the right place to ask questions about the cli. I moved your post here. There's an issue selector at quarto-dev/quarto. Please use that appropriately in the future: ![]() |
Beta Was this translation helpful? Give feedback.
-
@kellertuer Please provide a complete small self-contained example that can be used as is and not only snippets (code cells). You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
Now I am even more confused. Even without the keep md, the standalone thing like ---
engine: julia
julia:
exeflags: ["+1.12"]
format:
commonmark:
variant: -raw_html+tex_math_dollars
wrap: preserve
---
```{julia}
#| output: false
using PrettyTables, DataFrames
df = DataFrame(:a => [1,2,3], :b => [4,5,6])
```
```{julia}
# printing into normal output/code I get a nice markdown table,
# but this does only render in code and not as a nice markdown table
pretty_table(df, backend = :markdown, column_labels = ["A", "B"])
``` (same folder needs a project.toml with those two packages added) Then it works. But that is the same setup as for the start example. And on the start example I now spent several days trying to even narrowing that down. So I am out of ideas why the initial thing does not print a table. |
Beta Was this translation helpful? Give feedback.
-
Hm, maybe we should close this, because I am out of ideas. The MWE above adopted is ---
engine: julia
julia:
exeflags: ["+1.12"]
execute:
keep-md: true
format:
commonmark:
variant: -raw_html+tex_math_dollars
wrap: preserve
---
```{julia}
#| output: false
using Pkg;
Pkg.activate(; temp=true)
Pkg.add("PrettyTables")
Pkg.add("DataFrames")
using PrettyTables, DataFrames
df = DataFrame(:a => [1,2,3], :b => [4,5,6])
```
```{julia}
#| output: asis
# printing into normal output/code I get a nice markdown table,
# but this does only render in code and not as a nice markdown table
pretty_table(df, backend = :markdown, column_labels = ["A", "B"])
``` and that seems to run. But moving that setup over to the project from the original post - I again get |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug description
I have some table data in Jluia that I want to format a bit and “just” want to print that in markdown - plain markdown so it can get rendered later. I only manage to get the Markdown table when I put the output to code but then I also only get a code cell with the markdown code of the table not the table itself
Steps to reproduce
Use the JuliaNotebookRunnger (
engine: julia
) on the following.qmd
where your Julia environment should at least have the two packages used installedActual behavior
Expected behavior
The last output should be the second to last output with 4 spaces less upfront so I have a Markdown table (not the code of a markdown table) in the result if I continue with the markdown (e.g. through Julia Docu,emter.jl) - or as in the example above the output should read
(or the last 5 lines here instead of
[TABLE]
above)Your environment
Beta Was this translation helpful? Give feedback.
All reactions