gitlab rendering .rmd instead of .md in wiki

1.3k views Asked by At

I am using gitlab (https://gitlab.com/) for hosting a private package with an associated wiki. My workflow is to create .Rmd files (containing the R-code) and then render the .md and/or .html file(s) (with R-Studio) which contain the results. The problem is: gitlab shows only the .Rmd files (which are recognized as markdown files) - but I want the wiki to show the results, which are in the .md file!

Any hints? Thanks! Manuel

1

There are 1 answers

0
Manuel On

I solved the problem by setting the following praeamble in 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) })
---

That approach saves the .md file as TITLE_.md (from TITLE.Rmd).