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

Vignettes roclet #314

Closed
hadley opened this issue Dec 12, 2014 · 8 comments
Closed

Vignettes roclet #314

hadley opened this issue Dec 12, 2014 · 8 comments

Comments

@hadley
Copy link
Member

hadley commented Dec 12, 2014

Should rebuild if compiled is older than source.

Ping @jjallaire about RStudio UI support when done

@hadley hadley closed this as completed in a69c8e4 Jan 6, 2015
@jjallaire
Copy link

RStudio support is in the current daily (>= v0.99.148). Note that the vignette roclet is only used for roxygen2 >= 4.1.0.9001 so the package still needs a version bump for this to work.

@jennybc
Copy link
Member

jennybc commented Mar 21, 2015

What are you doing here that causes intermediate Markdown of your vignettes to be left behind? I have enabled the Vignettes roclet in Project Build Options in RStudio and it's being run when I document my package, but I'm only getting vignette.Rmd --> vignette.R and vignette.html. No vignette.md 😢

@rmflight
Copy link

I wouldn't have expected that the intermediate vignette.md is kept around @jennybc as this isn't the default behavior in build_vignettes. AFAIK build_vignettes only does as you describe, keeping the .R and .html output, and discarding the .md.

@jennybc
Copy link
Member

jennybc commented Mar 21, 2015

But I see .md for the vignettes here:

https://github.com/klutometis/roxygen/tree/master/vignettes

and they appear to have been checked in at same time as the .html and .R files. That's why I thought maybe this new roclet had some impact on retention of intermediate markdown.

@Geoff99
Copy link
Contributor

Geoff99 commented Mar 22, 2015

Hi @jennybc

Very much a guess (I only started to read up on creating vignettes in the last day) but maybe you can retain the intermediate files by using rmarkdown::render from the Rstudio console. I think render is used "underneath the hood" to generate vignettes.

There is an argument clean which defaults to TRUE, but if set to FALSE seems to leave heaps of intermediate stuff lying round.

From ?rmarkdown::render

clean TRUE to clean intermediate files created during rendering.

Maybe that would get what you are looking for? Not quite as painless as running from the RStudio buttons and menus, but it might work. (I tried on a dummy example and got some .md files, but not able to tell if they are the ones you want.) If I discover an easier or more elegant method I'll update this set of comments. (I have yet to read up on the vignettes roclet).

@jennybc
Copy link
Member

jennybc commented Mar 22, 2015

Thanks @Geoff99. I'm pretty well-versed in the usage of rmarkdown::render. What I'm getting at here is whether I'm overlooking some new way to get intermediate .md for free when I automate package development tasks, such as updating docs.

@jennybc
Copy link
Member

jennybc commented Mar 22, 2015

Thanks again @Geoff99. Your message prompted me to be more bold re: modifying the YAML of my R Markdown vignette, as I would with any other .Rmd document. So this YAML now gets me my intermediate Markdown without any manual intervention. YAY.

---
title: "gspreadr Basic Usage"
author: "Joanna Zhao, Jenny Bryan"
date: "`r Sys.Date()`"
output:
  rmarkdown::html_vignette:
    toc: true
    keep_md: true
vignette: >
  %\VignetteIndexEntry{gspreadr Basic Usage}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

@Geoff99
Copy link
Contributor

Geoff99 commented Mar 23, 2015

Glad I was able to help in some small way @jennybc , even though I didn't have the right answer. I've learnt something new from your solution and will add looking into YAML more closely to my "to learn about" list.

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

5 participants