-
Notifications
You must be signed in to change notification settings - Fork 65
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
Make it possible to hook into the output #248
Comments
Thanks for this proposal, which makes a lot of sense, but I will have to make sure that it doesn't break many things in the reverse dependencies -- as eg |
Ok, I never considered that there more packages which do document conversations... If this becomes a problem, this could be solved the same was as the
|
@JanSchulz can you please have a look at the above PR and test with Jupyter? I am not sure if you need a character vector or concatenated string. If it seems to work, then I will add some docs on this behavior and merge. |
This doesn't work :-( We need to have something which differentiates it from a plain character vector, so that we can treat it differently from such a vector:
|
@JanSchulz please check the updated PR based on that. |
See the pr... |
Currently it is not possible to get the output and display it as markdown without either using a wrapper function or setting some knitr options to get a
knit_asis
object. Unfortunately, the asis object doesn't work in the context of the Jupyter R kernel, as it lacks information what kind of content is in the asis object (html, latex, md,...)To make it possible to consume the output of teh pander call in both knitr and irkernel, I propose to change the API of the
pander
call to return a structure and then implement three methods to print the markdown as appropriate in the current context.Prototype:
As far as I understand it, the only downside is that
x = paste(capture.output(pander(...)), collapse="\n")
wont work afterwards anymore, as the call itself won'tcat
anything. All such calls would have to be changed toas.character(pander(...))
-> breaking API change :-(.If this is acceptable, a question is how deep you want to change this: the easiest implementation would just use
capture.output()
, but this issue/PR could also be used to change the calls further down to use string concatenation and return a string instead of using cat directly.If you agree with this proposal, I can do a PR...
[This original issue for this was https://github.com/IRkernel/repr/issues/33 // cc: @flying-sheep]
The text was updated successfully, but these errors were encountered: