2015-06-20 31 views
1

我使用gitlab(https://gitlab.com/)來託管一個包含關聯wiki的私有包。我的工作流程是創建.Rmd文件(包含R代碼),然後渲染包含結果的.md和/或.html文件(使用R-Studio)。問題是:gitlab僅顯示.Rmd文件(它們被識別爲降價文件) - 但我希望wiki顯示結果,它們位於.md文件中!gitlab渲染.rmd而不是.md在wiki中

任何提示? 謝謝! 曼努埃爾

+0

可能的重複http://stackoverflow.com/questions/25169393/gitlab-rendering-the-wrong-readme-in-project-public-views(我結束了重新命名爲README.Rmd _README.Rmd編織後「解決」這個) – hrbrmstr

回答

3

我通過設置以下praeamble在Rmarkdown解決了這個問題:

--- 
title: "TITLE" 
author: "Manuel" 
date: '2015-06-20' 
output: 
html_document: 
keep_md: yes 
knit: (function(inputFile, encoding) { 
    ofi <- paste0(gsub(".Rmd","",inputFile),"_.md"); 
    rmarkdown::render(inputFile, encoding=encoding, output_file=ofi) }) 
--- 

這種做法節省了.MD文件TITLE_.md(從TITLE.Rmd)。