-
Notifications
You must be signed in to change notification settings - Fork 24
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
print.htmlTable ignores useViewer = TRUE #27
Comments
Hi Peter, yes, that was the fix for issue #26. I like when the table appears inside the notebook and adding the html-class seemed to do the job. This was a bummer though. Any suggestions on how to address this? /Max |
Hi Max, I've got a clumsy workaround using the I can do a PR tonight if you're still interested in the workaround. Peter. |
Awesome. It seems like it may take a while before the rstudio team has time to fix this. I should probably post an rstudio issue |
Thanks, excellent work as always. I'll post it to CRAN in a few days. I don't think any unit tests are possible here and the previous viewer code was untested. |
Hi Peter, Just noticed I often don't use the html_notebook but frequently the Gmisc::docx_document, my current thoughts are:
What are your thoughts on this? |
Hi Max, I avoided parsing the filename as The problem with a general option is that a user might switch between different types of markdown files during a session. You would need to be able to reset that option when focus changes, but AFAIK RStudio does not provide hooks. In the absence of a way to detect where code is submitted from you will always need to parse the active document to detect what the user intended, I'm afraid. edit: Totally forgot that this is also influenced by the global RStudio option - "show output inline for all markdown documents." htmlTable should respect this, of course. It seems that it is readable through an undocumented method. Peter. |
Thanks Peter, I've updated the package and fixed a few minor bugs and moved the Rmd detection to a private function since your PR:
I think this is a reasonable compromise until further. The thought of having an Rcmd check note feels like less appealing as the folks at CRAN won't like it. Although I think one can add |
Oh forgot, the docx_document is a wrapper around html_document and creates output that has the same color, font etc as a standard Word-docx document. I'm stuck with using Word for my manuscripts and then I want to just copy-paste the document without any hassle. I think our workflow is rather similar. I just found that trying out tables within the document is even easier than viewing them through the Viewer since many tables relate to the information in the previous table. I think that a single option is enough for now. Having a document-specific options seems like overdoing it although one could add a vector of filenames that are searched. |
It doesn't work for me though. If code is submitted from a .Rmd file the function returns TRUE without running the notebook detection part. |
In my case I sometimes have child documents that are of Rmd type but don't have a yaml intro. It seems that this requires relying on the file path for it to work since I can't deduce it from the context I'm in. We can use |
I hadn't considered child documents, but as you say these will always have a non-NULL path. The current develop version does not work for html_document - it returns TRUE before evaluating the notebook detection code. I am using RStudio version 1.0.136 - I can read the preference from the console, from within a .Rmd html_document and from a html_notebook. |
Another complication to consider: according to the Rmd specification it is possible to specify multiple output formats in a single yaml header. I think the only correct way forward is to find a way to determine which hook knitr will use to print something. All other solutions will make somebody unhappy. |
Found these similar issues:
I use 1.0.136 but neither the Windows nor the Linux version provide any useful output. |
> .rs.readUiPref("rmd_chunk_output_inline")
[1] TRUE when the checkbox "Tools > Global Options... > R Markdown > Show output inline for all R Markdown documents" is checked. > .rs.readUiPref("rmd_chunk_output_inline")
[1] FALSE when the checkbox is unchecked. Tested under windows on three different installations. |
any news on this? |
I haven't worked on this for a while. From looking at the rmarkdown bugs the activity has been low over there as well. |
I get this issue when using |
@dannyparsons I don't think I've adapted concatHtmlTables so it relies on the pre-notebook approach. I haven't heard back from any of the RStudio team and I guess they are busy on more pressing issues. Unfortunately I've been busy with other projects lately an I haven't had the time to dive into this issue again, any help is appreciated and you're welcome checking how concatHtmlTables work:
Thanks! |
Thanks for the reply, I certainly understand being busy with multiple projects! I'll try to get time to look into your suggestions and get back if I find anything useful. |
Hi Max,
I can't get htmlTable to use the RStudio viewer pane anymore (version 1.9). The class of a htmlTable object is now
"html" "htmlTable" "character"
Everything works fine after manually setting the class to"htmlTable" "character"
. Is it possible that the fix for issue #26 caused this?thanks
Peter.
The text was updated successfully, but these errors were encountered: