Skip to content
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

Validate compatibility with Pandoc 2.0 #1756

Closed
jmcphers opened this issue Nov 15, 2017 · 6 comments
Closed

Validate compatibility with Pandoc 2.0 #1756

jmcphers opened this issue Nov 15, 2017 · 6 comments

Comments

@jmcphers
Copy link
Member

Pandoc 2.0 contains a large number of changes, some of which change behavior in important ways. While we don't bundle 2.0 yet, we do use the system version of Pandoc over our own in some configurations, so need to ensure compatibility with the new version.

@jjallaire pointed out that we may need to adjust our self-contained HTML generation function here so that it works with both Pandoc 1 and Pandoc 2:

.rs.addFunction("pandocSelfContainedHtml", function(input, output) {

See also the comments on this issue:

ramnathv/htmlwidgets#289

and this this PR from @jcheng5 which addresses it:

ramnathv/htmlwidgets#292

@jmcphers
Copy link
Member Author

jmcphers commented Dec 5, 2017

Since Pandoc 2 already exists in the wild, we should actually make this change for 1.1 patch (changed milestone). The work that should happen in 1.2 is updating the internal copy of Pandoc to Pandoc 2, which is now tracked in #1807.

@jmcphers
Copy link
Member Author

jmcphers commented Dec 6, 2017

pandocSelfContainedHtml always uses RSTUDIO_PANDOC to determine the version of Pandoc to use.

# build the conversion command
pandoc <- file.path(Sys.getenv("RSTUDIO_PANDOC"), "pandoc")
command <- paste(shQuote(c(pandoc, args)), collapse = " ")

It is possible to set RSTUDIO_PANDOC to Pandoc 2, even in RStudio 1.1, but it's probably not common. Compare with find_pandoc in the rmarkdown package, which will use a new pandoc in preference to RSTUDIO_PANDOC if it finds one.

https://github.com/rstudio/rmarkdown/blob/2b418a242af8a4eca1d3156614d25816d39e721a/R/pandoc.R#L513-L549

@jmcphers
Copy link
Member Author

backported to 1.1 in 80e1cb9.

@ronblum
Copy link
Contributor

ronblum commented Jan 11, 2018

Knit to HTML fails with RStudio 1.1.412 (both open source and Pro) on OpenSUSE 12.3 with Pandoc 2.0.6, with the error message:

/usr/bin/pandoc2.0.6/pandoc +RTS -K512m -RTS bobo.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bobo.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template /home/rstudio/R/x86_64-suse-linux-gnu-library/3.4/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' --include-in-header /tmp/RtmpYTAMGV/rmarkdown-str17687c71322e.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
--smart/-S has been removed. Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 2
Execution halted

Publishing is succeeds, though with the console message:

--smart/-S has been removed. Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.

Knit to HTML works fine with RStudio 1.1.383 on OpenSUSE, and 1.1.412 works fine on other environments (Ubuntu 16.0.4, MacOS 10.12.6).

@ronblum ronblum reopened this Jan 11, 2018
@jmcphers
Copy link
Member Author

What version of the rmarkdown package are you using?

@ronblum
Copy link
Contributor

ronblum commented Jan 12, 2018

1.6. It works fine with 1.8. Sorry about that. All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants