seankross / postcards

💌 Create simple, beautiful personal websites and landing pages using only R Markdown.
Other
552 stars 87 forks source link

Pandoc issues #6

Closed zorgster closed 4 years ago

zorgster commented 4 years ago

Hi

The knit is failing on my Windows 10 laptop with the latest RStudio (1.3.n) and R 4.0.2...

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS postcards.utf8.md --to html4 --from markdown+tex_math_single_backslash-autolink_bare_uris --output postcs.html --lua-filter "C:\Data\Software\R\lib\4.0\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Data\Software\R\lib\4.0\rmarkdown\rmarkdown\lua\latex-div.lua" --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Data\Software\R\lib\4.0\postcards\pandoc_templates\trestles.html" --highlight-style pygments --include-in-header "C:\Users\mail\AppData\Local\Temp\Rtmp6NYl4q\rmarkdown-str8e5c4a0456c1.html" 
"template" (line 34, column 26):
unexpected "/"
expecting "." or ")$"
Error: pandoc document conversion failed with error 5
Execution halted

This refers to the for loop for the Links key/value pairs in the markup metadata:

$for(links)$
$for(it/pairs)$   
.... $it.value$ .... $it.key$ ... 
$endfor$
$endfor$

It works if I change the relevant sections to use . notation on the anaphoric it rather than the /:

$for(links)$
$for(it.pairs)$   
.... $it.value$ .... $it.key$ ... 
$endfor$
$endfor$

Updating RStudio 1.3 which includes Pandoc 2.7.3 didn't resolve it.

I've debugged the rmarkdown::render command, through to the rmarkdown::pandoc_convert command and it fails on the system(command) line that calls out to pandoc.exe.

elinw commented 4 years ago

This is the same as #5 (But with a more descriptive title).

@seankross Do you know what version of pandoc is needed?

seankross commented 4 years ago

I believe the minimum version of pandoc required is 2.8. I am able to recreate this error on my windows machine but the fix of substituting . for / is causing other errors for me.

zorgster commented 4 years ago

I updated RStudio to the latest version for Windows and pandoc 2.7.3 was installed.

Yes... the pipe into pairs function makes sense - to split the array into values and keys. The . notation probably was a deprecated and lost in 2.8+ ...

seankross commented 4 years ago

Closing this because it is a duplicate of #5. @zorgster please follow along there I really appreciate you reporting these issues.