我正在尝试编译一个包小插图,以便 .md 文件保留在小插图文件夹中,以便它在 github 上仍然可见。我正在使用devtools
所有这些。我已经研究过这种方法,并将在下面概述:
我已经自动生成了一个小插图模板 use devtools::use_vignette()
。然后我将.Rmd
文件修改为如下所示(截断模板版本):
---
title: "package"
author: "author"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
toc: true
keep_md: true
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Vignettes are long form documentation commonly included in packages. Because they are part of the distribution of the package, they need to be as compact as possible. The `html_vignette` output type provides a custom style sheet (and tweaks some options) to ensure that the resulting html is as small as possible. The `html_vignette` format:
- Never uses retina figures
- Has a smaller default figure size
- Uses a custom CSS stylesheet instead of the default Twitter Bootstrap style
## Vignette Info
Note the various macros within the `vignette` section of the metadata block above. These are required in order to instruct R how to build the vignette. Note that you should change the `title` field and the `\VignetteIndexEntry` to match the title of your vignette.
所以.yaml
修改了但是当我使用它编译时devtools::build_vignettes()
似乎没有.md
在小插图目录中留下文件。没有错误消息,并且小插图构建良好,所以这有点令人困惑。
所以总结一下这个问题,有谁知道如何编译一个小插图devtools::build_vignette
,以便将基本的降价文件保存在小插图目录中?