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

Loading template for .Rmd file and using it #26

Open
fabriziojpiva opened this issue Jul 19, 2021 · 0 comments
Open

Loading template for .Rmd file and using it #26

fabriziojpiva opened this issue Jul 19, 2021 · 0 comments

Comments

@fabriziojpiva
Copy link

fabriziojpiva commented Jul 19, 2021

Hi,

Related to this other issue, when I open a .Rmd file, let's say xaringan_example.Rmd I have to first start a ess process by doing M-x R, and then I am able to start a template by executing M-n M-m.

However, when I select the desired template (in my case is "xaringan/Ninja Presentation"), the prompt immediately asks me for a "Draft name", in which I don't know what to type. So I proceed to type just another filename like example_presentation.Rmd and I see on the process that the command:

rmarkdown::draft('~/Downloads/xaringan_draft.Rmd', 'xaringan', package = "xaringan", edit = FALSE)

was executed. In addition, I also see on the prompt ESS process not ready. Finish your command before trying again.

Two things:

  1. What is the purpose of this "draft" that I am asked to fill in?
  2. When I try to execute the .Rmd file, I do M-n W and select knitr-ess to use the current R process, however, nothing happens after hitting enter. On the other hand, trying M-n w asks me to select the desired export format, in which I select HTML, but then I get just a plain .html file with clearly no usage of the template. How can I make poly-R to use the template that I selected doing M-n M-m?

Rstudio vs poly-R output files

Just to add extra information to solve the problem, I run exactly the same file on Rstudio using the package xaringan. The source code of the generated file starts with the following code:

`

<title>Presentation Ninja</title> <script src="libs/header-attrs/header-attrs.js"></script> <script src="libs/htmlwidgets/htmlwidgets.js"></script> <script src="libs/jquery/jquery.min.js"></script> <script src="libs/leaflet/leaflet.js"></script> <script src="libs/proj4/proj4.min.js"></script> <script src="libs/Proj4Leaflet/proj4leaflet.js"></script> <script src="libs/leaflet-binding/leaflet.js"></script> <script src="libs/datatables-binding/datatables.js"></script> <script src="libs/dt-core/js/jquery.dataTables.min.js"></script> <script src="libs/crosstalk/js/crosstalk.min.js"></script> <textarea id="source">`

and so on. On the other hand, when using poly-R the output doesn't contain anything like that, it starts directly with the content.
My interpretation of the problem is that poly-R is not using xaringan package with weaving the file to html using knitr. It would be nice to know how to generate the same output as Rstudio.

Thanks in advance for the help!

PD: selecting as draft the current opened file (xaringan_example.Rmd) doesn't solve the issue.

@fabriziojpiva fabriziojpiva changed the title Load template for .Rmd file and usage Loading template for .Rmd file and using it Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant