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

WISH: as_pkgdown() / pkgdown:::package_vignettes() support any vignette format - not just rmarkdown #781

Open
HenrikBengtsson opened this Issue Aug 7, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@HenrikBengtsson

HenrikBengtsson commented Aug 7, 2018

Posting partly as a feature request, and partly in case others are trying to figure out why their vignettes are not showing up as "articles" when running pkgdown::build_site().

Issue

pkgdown::build_site() calls pkgdown::build_articles() internally for build "articles" from the package vignettes. However, this will only happen for vignettes under vignettes/ with filename extensions "\\.[rR]md$" and (it looks like) the vignettes should be in Rmarkdown format with a yaml header. For instance, a traditional Sweave vignettes/*.Rnw vignette will be (silently) ignored.

Wish

It would be neat if any R vignette format that R itself supports would be recognized. Not sure if it's useful, but tools::pkgVignettes(dir = pkg) is what R itself uses to parse the package source for vignettes, e.g.

> tools::pkgVignettes(dir = ".")
$docs
[1] "/home/hb/repositories/R.rsp/vignettes/R_packages-Static_PDF_and_HTML_vignettes.pdf.asis"
[2] "/home/hb/repositories/R.rsp/vignettes/R_packages-LaTeX_vignettes.ltx"                   
[3] "/home/hb/repositories/R.rsp/vignettes/Dynamic_document_creation_using_RSP.tex.rsp"      
[4] "/home/hb/repositories/R.rsp/vignettes/R_packages-RSP_vignettes.md.rsp"                  
[5] "/home/hb/repositories/R.rsp/vignettes/R_packages-Vignettes_prior_to_R300.tex.rsp"       
[6] "/home/hb/repositories/R.rsp/vignettes/RSP_intro.html.rsp"                               
[7] "/home/hb/repositories/R.rsp/vignettes/RSP_refcard.tex.rsp"                              

$names
[1] "R_packages-Static_PDF_and_HTML_vignettes"
[2] "R_packages-LaTeX_vignettes"              
[3] "Dynamic_document_creation_using_RSP"     
[4] "R_packages-RSP_vignettes"                
[5] "R_packages-Vignettes_prior_to_R300"      
[6] "RSP_intro"                               
[7] "RSP_refcard"                             

$engines
[1] "R.rsp::asis" "R.rsp::tex"  "R.rsp::rsp"  "R.rsp::rsp"  "R.rsp::rsp" 
[6] "R.rsp::rsp"  "R.rsp::rsp" 

$patterns
[1] "[.](pdf|html)[.]asis$" "[.](tex|ltx)$"         "[.][^.]*[.]rsp$"      
[4] "[.][^.]*[.]rsp$"       "[.][^.]*[.]rsp$"       "[.][^.]*[.]rsp$"      
[7] "[.][^.]*[.]rsp$"      

$encodings
/home/hb/repositories/R.rsp/vignettes/R_packages-Static_PDF_and_HTML_vignettes.pdf.asis 
                                                                                     "" 
                   /home/hb/repositories/R.rsp/vignettes/R_packages-LaTeX_vignettes.ltx 
                                                                                     "" 
      /home/hb/repositories/R.rsp/vignettes/Dynamic_document_creation_using_RSP.tex.rsp 
                                                                                     "" 
                  /home/hb/repositories/R.rsp/vignettes/R_packages-RSP_vignettes.md.rsp 
                                                                                     "" 
       /home/hb/repositories/R.rsp/vignettes/R_packages-Vignettes_prior_to_R300.tex.rsp 
                                                                                     "" 
                               /home/hb/repositories/R.rsp/vignettes/RSP_intro.html.rsp 
                                                                                     "" 
                              /home/hb/repositories/R.rsp/vignettes/RSP_refcard.tex.rsp 
                                                                                     "" 

$dir
[1] "/home/hb/repositories/R.rsp/vignettes"

$pkgdir
[1] "/home/hb/repositories/R.rsp"

$msg
character(0)

attr(,"class")
[1] "pkgVignettes"

UPDATE 2018-08-07: tools::pkgVignettes(dir = ".") example is now using the R.rsp package (was future package)

@hadley

This comment has been minimized.

Show comment
Hide comment
@hadley

hadley Aug 9, 2018

Member

I'd be happy to review a PR that implemented this, but realistically, I'm unlikely to find the time to do it myself.

Member

hadley commented Aug 9, 2018

I'd be happy to review a PR that implemented this, but realistically, I'm unlikely to find the time to do it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment