Closed vincentarelbundock closed 3 years ago
@vincentarelbundock Thanks a lot for this suggestion! It seems that you want to add markdown support to both the input and the output? Here are a few things that are not very clear to me.
I hope save_kable
could have more functionalities as you suggested in option 1 but at the same time, I'm also looking for a unified interface. Have you looked into pandoc and see if the two questions above are possible?
I had a much less general (or perhaps a stopgap) measure in mind: If the user supplies an object with attr("format")=="pipe"
and a file name with a ".txt" or ".md" or ".Rmd" extension, then writeLines
to file.
Honestly, I think that if users want an image, it would be much better for them to go through LaTeX or HTML. I just don't see a realistic and compelling use-case for going through markdown if you want a JPG in the end. Plus, this would add a lot of complications for little payoff.
My main worry is to be able to save markdown files in a useable text-only format. As far as I can tell, there is currently no "clean" way to do that, beyond calling writeLines
(with some kind of paste(collapse='\n')
. It seems natural to expect save_kable(tab, "file.md")
to "Just Work", and it would be quite easy to get that minimal functionality in, without diving deep into options that will probably have very few actual use cases (in my expectation).
@vincentarelbundock I see. Sure, a PR on save_kable
will be really appreciated! It's probably a good idea to send out some warning or stop if users want to do these md -> image thing. I sort of learned that users will try every possible route. ;)
Currently, using
save_kable
for markdown table produces an unusable file:Which produces: