tidyverse / reprex

Render bits of R code for sharing, e.g., on GitHub or StackOverflow.
https://reprex.tidyverse.org
Other
742 stars 81 forks source link

pandoc error #178

Closed chris-prener closed 6 years ago

chris-prener commented 6 years ago

Hello! I have the current development version of reprex installed from GitHub and was trying to create a reprex when I got this error. This is a lab computer at my University, so I did a bit of checking to make sure pandoc is installed and that knitr is able to use it to create documents. It is indeed installed and knitr does work.

Is this an issue with reprex or on this specific machine? Thanks for your help sorting this out!

> library(reprex)
> reprex()
Rendering reprex...
pandoc.exe: unrecognized option `--quiet'
Try pandoc.exe --help for more information.
Error: pandoc document conversion failed with error 2
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS file12d87d4e3721_reprex.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pandoc12d858a078f6.html --smart --email-obfuscation none --self-contained --quiet --standalone --section-divs --template "E:\Users\prenercg\Documents\R\win-library\3.4\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "E:\Users\prenercg\AppData\Local\Temp\RtmpyAZbZo\rmarkdown-str12d8f0d788b.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"' had status 2 
batpigandme commented 6 years ago

What version of pandoc is being run? If you have rmarkdown installed, you can get this by running rmarkdown::pandoc_version().

chris-prener commented 6 years ago

Well, I bet that is the issue, Mara? Seems very out of date...

> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’

If you think that solves it, we can close this and I'll work to get our IT folks to update pandoc on these machines!

jennybc commented 6 years ago

😔 yeah it sounds like this is an option only supported by higher versions of Pandoc, which I didn't realize. I'm careful with other options but it never occurred to me something this generic (--quiet) would be new in Pandoc 2.0. I can make this conditional, but yes the best solution for you is to use a newer version of Pandoc.

jennybc commented 6 years ago

OK @chris-prener would you please install this in an affected machine and try again?

devtools::install_github("tidyverse/reprex@pandoc-quiet")

The sooner the better. reprex has been submitted to CRAN but it's still sitting in incoming purgatory, so if this fix works, I can probably re-submit and keep my place in line.

jennybc commented 6 years ago

I was able to test on Pandoc 1.19 and this seems to work. Will merge. @chris-prener please still let me know if you can verify this is an improvement.

chris-prener commented 6 years ago

thanks so much @jennybc! I was teaching this afternoon so sorry for my delayed response. Installed off the master since the pandoc-quiet branch was merged - everything worked smoothly.

This will be a huge help this semester - no way IT was going to get this done any time soon and I'm trying to make reprex() a key part of how students get help.

Does the update to CRAN also fix the clipboard access?

jennybc commented 6 years ago

Does the update to CRAN also fix the clipboard access?

If by that you mean re-enable the clipboard in general, yes. For a user, the clipboard functionality in v0.2.0 (the current submission) should be unchanged from the previous (authentic) CRAN release (v0.1.1). I am just being much more conservative re: clipboard access in non-interactive settings, such when CRAN checks and tests the package.

chris-prener commented 6 years ago

Ah ok - great! Thanks for maintaining this package - it is really valuable!

My mac had a slightly older CRAN release on it and so I demoed how it should work and it worked fine, but all of my students, who had just installed it, got the clipboard not accessible message. Thinking I should use Docker or something else to simulate the timing of when they download and install software so I don't get caught in the classroom with software that works slight differently - I don't want to impact my own set packages that I rely on for research. Have you heard of anyone doing something similar?

jennybc commented 6 years ago

all of my students, who had just installed it, got the clipboard not accessible message

No, there is something very unusual and specific going on with reprex at the moment (long story, see #171, #173). An update has been submitted to CRAN but not processed / accepted yet. The version CRAN is serving right now is fundamentally broken and not authored by me. I wouldn't let this event influence your decision re: how much to worry about package instability. This is an unusual glitch.

chris-prener commented 6 years ago

Yikes. The docker thought wasn't 100% influenced by reprex - I've been caught a couple times now either by Windows/macOS differences or software updates between when I write lectures and when I give them / students download the software. Ah the joys of teaching open source...

Anyway - thanks again - I hope you get reprex back onto CRAN soon!