Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8978811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:41:55+00:00 2026-06-15T19:41:55+00:00

I am trying to write a Jekyll converter for R Markdown files. I created

  • 0

I am trying to write a Jekyll converter for R Markdown files. I created RMarkdownConverter.rb and placed it in my _plugins directory. I have verified that other plugins are working but this one is not. I also don’t see any error messages, including the ones I put in myself. It seems this is not being used. However, Jekyll is generating an HTML file for my .Rmd file but simply processes the R chuck as code chuck. Any help or thoughts would be greatly appreciated.

RMarkdownConverter.rb file:

module Jekyll
    class RMarkdownConverter < Converter
        safe true
        priority :low

    def setup
      STDERR.puts "Setting up R Markdown..."
      return if @setup
      require 'rinruby'
      @setup = true
    rescue
      STDERR.puts 'do `gem install rinruby`'
      raise FatalException.new("Missing dependency: rinruby")
    end

        def matches(ext)
            ext =~ /Rmd/i
        end

        def output_ext(ext)
           '.html'
        end

        def convert(content)
      setup
      STDERR.puts "Using R Markdown..."
      R.eval "require(knitr)"
      R.eval "render_markdown(strict=TRUE)"
      R.assign "content", content
      STDERR.puts content
      R.eval "out <- knit(text=content)"
      R.eval "print(out)"
        end
    end
end

The contents of my first R Markdown post:

--- 
layout: post
title: Using (R) Markdown, Jekyll, and Github for Blogging
published: true
tags: R R-Bloggers Jekyll github
type: post
status: publish
---

First, we need to install [RinRuby](https://sites.google.com/a/ddahl.org/rinruby-users/) to call R from Ruby. In the terminal, execute:

    gem install rinruby

First R chuck:

```{r}
2 + 2
```
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:41:56+00:00Added an answer on June 15, 2026 at 7:41 pm

    Try replacing the last few lines with the following

    R.assign "content", content
    R.eval "knitr::render_markdown(strict = TRUE)"
    R.pull "(knitr::knit2html(text = content, fragment.only = TRUE))"
    

    I think you need R.pull to copy the contents of R output to Ruby. Moreover, I would recommend directly converting from Rmd to html. I have used this strategy successfully in working with Ruhoh which is another ruby based blogging platform.

    UPDATE. It is very odd but using the extension rmd seems to conflict with md. I changed it randomly to ram and jekyll seems to pick it up correctly. I am not sure why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying write a script in awk that (among other things) replaces all instances
I'm trying to write a custom tag plugin for Jekyll that will output a
I'm trying to write a Jekyll plugin which generates an array of pages in
I m trying write code that after reset set up rrpmax as 3000. It
I am trying write a function that generates simulated data but if the simulated
Trying to write app for service technicians that will display open service calls within
Trying to write a couple of functions that will encrypt or decrypt a file
Trying to write a code at the moment that basically tests to see if
I'm trying write a query to find records which don't have a matching record
Trying to write a code that searches hash values for specific string's (input by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.