Skip to content

Loading template for .Rmd file and using it #26

@fabriziojpiva

Description

@fabriziojpiva

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions