rstudio / distill

Distill for R Markdown
https://rstudio.github.io/distill/
Apache License 2.0
422 stars 57 forks source link

Pandoc error when initializing blog #29

Open geneorama opened 6 years ago

geneorama commented 6 years ago

I'm getting an error when I try to initialize a blog.

image

> create_blog(dir = "C:/R/Example",
+             title = "Something about data science")
Creating website directory C:/R/Example
Creating C:/R/Example/_site.yml
Creating C:/R/Example/index.Rmd
Creating C:/R/Example/about.Rmd
Creating C:/R/Example/_posts/welcome/welcome.Rmd
Rendering blog...

  |                                                                       
  |                                                                 |   0%
  |                                                                       
  |................................                                 |  50%
  ordinary text without R code

  |                                                                       
  |.................................................................| 100%
label: setup (with options) 
List of 1
 $ include: logi FALSE

"C:/R/pandoc-2.3-windows-i386/pandoc" +RTS -K512m -RTS about.utf8.md --to html5 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output about.html --email-obfuscation none --standalone --no-highlight --template "C:\R\R-3.5.1\library\radix\rmarkdown\templates\radix_article\resources\default.html" --lua-filter "C:\R\R-3.5.1\library\radix\rmarkdown\templates\radix_article\resources\distill.lua" "--metadata=link-citations:true" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3462df490fhtml" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e347d2e4f9dhtml" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3419d29fahtml" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e341fb152bchtml" --include-before-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3432387a36html" --include-before-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3450173c2html" --include-before-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e34291e2chtml" --include-after-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3456da5c01html" --include-after-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e346c536db4html" --include-after-body "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e347e525b57html" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\rmarkdown-str2e34653564eb.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --include-in-header "C:\Users\username\AppData\Local\Temp\Rtmp2pPtja\file2e3432dc2731html" 
Error: pandoc document conversion failed with error 5

My session info:

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

other attached packages:
[1] radix_0.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18    digest_0.6.16   rprojroot_1.3-2
 [4] jsonlite_1.5    backports_1.1.2 magrittr_1.5   
 [7] evaluate_0.11   stringi_1.2.4   rstudioapi_0.7 
[10] whisker_0.3-2   rmarkdown_1.10  tools_3.5.1    
[13] stringr_1.3.1   yaml_2.2.0      compiler_3.5.1 
[16] htmltools_0.3.6 knitr_1.20 

(also, by the way, you might want to mention in the tutorials that you need pandoc to run radix!)

maxheld83 commented 6 years ago

this might be a little hard to debug, based on the information you provided.

It's not obvious to me that this is a radix problem (or have you verified that?).

I would recommend:

If either of those things fail, then the source of the problem may be somewhere else.

Not knowing where the problem stems from, community.rstudio.com might be a better venue to debug this, or StackOverflow (though both would need a complete reproducible example).

Lastly, I don't think there needs to be an extra reminder to install pandoc; radix is an rmarkdown template, and rmarkdown is always powered by pandoc.

geneorama commented 6 years ago

I'm happy to close the issue. It's not important to me, I was just trying to follow the example instructions. (I was trying to help radix development, not my own work.)

Good troubleshooting ideas. Step 1: knitr produces a markdown file that looks right. Step 2: pandoc produces an html file that has no content.

Looks like Pandoc is installed normally, I don't remember if I unzipped pandoc and added it to the path manually or if I used the installer. I probably just installed it for this demo. This is a new computer image and I doubt I had installed pandoc for anything else yet.

If other people are not getting the same error on fresh installs, I'll assume it is me.

geneorama commented 6 years ago

Actually, I would recommend adding these troubleshooting steps to a readme. I think these are great suggestions for basic first steps to confirm that the user has everything installed and on the path.

I would add to the instructions where to look for posts, and here to put the output.

For me this was

knitr::knit(input="_posts/welcome/welcome.Rmd",
            output = "_posts/welcome/welcome.md")

Then at the command line cd to project directory, then pandoc _posts/welcome/welcome.md -o _posts/welcome/welcome.html

Or tell the user where the output belongs, I'm not sure if the html belongs in the same folder as the Rmd and md files.

Thank you