Skip to content

Validate compatibility with Pandoc 2.0 #1756

Closed

Description

@jmcphers

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

Activity

  1. added this to the v1.2 milestone on Nov 15, 2017
  2. modified the milestones: v1.2, v1.1-patch on Dec 5, 2017
  3. jmcphers commented on Dec 5, 2017

    @jmcphers
    MemberAuthor

    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.

  4. jmcphers commented on Dec 6, 2017

    @jmcphers
    MemberAuthor

    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

  5. jmcphers commented on Dec 18, 2017

    @jmcphers
    MemberAuthor

    backported to 1.1 in 80e1cb9.

  6. ronblum commented on Jan 11, 2018

    @ronblum
    Contributor

    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).

  7. jmcphers commented on Jan 11, 2018

    @jmcphers
    MemberAuthor

    What version of the rmarkdown package are you using?

  8. ronblum commented on Jan 12, 2018

    @ronblum
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions