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 8663407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:58:45+00:00 2026-06-12T16:58:45+00:00

Playing with Ruby and Ruby-Pandoc. Seems like a nice tool, if I can get

  • 0

Playing with Ruby and Ruby-Pandoc. Seems like a nice tool, if I can get it to work.

I’d like to convert some Markdown text (with embedded lists and other fanciness) to Rich Text. Here’s the text I’m converting:

Title
===

This is a paragraph. Hallelujah.

Here comes a nested list.
---

* List item 1
  * List item 1.1
  * List item 1.2
* List item 2
  * List item 2.1

Here’s my Ruby code…

require 'pandoc-ruby'

input = File.read(test.md)
converter = PandocRuby.new(input, from: :markdown, to: :rtf)
puts converter.convert

… which (after saving the output to a file) produces a document without anything but a title:

screenshot of RTF

Here’s the code of the RTF file:

{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Title\par}
{\pard \ql \f0 \sa180 \li0 \fi0 This is a paragraph. Hallelujah.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Here comes a nested list.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1.1\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1.2\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 2\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 2.1\sa180\par}

In addition, even if it did show up in my RTF viewer (Mac TextEdit), the RTF code seems to have lost all list nesting. I don’t know how to diagnose this, whether I have not stated necessary header information or something in Ruby-Pandoc.

Thanks in advance!

  • 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-12T16:58:46+00:00Added an answer on June 12, 2026 at 4:58 pm

    Wrap your output in a prolog and closing brace. Like this:

    {\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}
    {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Title\par}
    {\pard \ql \f0 \sa180 \li0 \fi0 This is a paragraph. Hallelujah.\par}
    {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Here comes a nested list.\par}
    {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1\par}
    {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1.1\par}
    {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 1.2\par}
    {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 2\par}
    {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab List item 2.1\sa180\par}
    }
    

    Update

    am I missing a “wrapper” configuration setting?

    Yes, as per the gem readme.

    If you are trying to generate a standalone file with full file headers rather than just a marked up fragment, remember to pass the :standalone option so the correct header and footer are added.

    what about the lack of nesting lists?

    As per the PanDoc documentation, your source text is missing 2 more spaces of indentation.

    So putting that together, here is the complete solution.

    Your source file:

    Title
    ===
    
    This is a paragraph. Hallelujah.
    
    Here comes a nested list.
    ---
    
    * List item 1
        * List item 1.1
        * List item 1.2
    * List item 2
        * List item 2.1
    

    The conversion code:

    require 'pandoc-ruby'
    input = File.read('./test.md')
    puts PandocRuby.markdown(input).to_rtf(:standalone)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing with writing a MUD/text adventure (please don't laugh) in Ruby. Can anyone
I'm playing with Ruby Mechanize with a website. But it seems that it ignored
I'm playing with vim-ruby indent, and there are some pretty complex regexes there: Regex
I'm playing around with Ruby to do some file versioning for me. I have
I'm learning Ruby and I like playing with irb to discover new features and
I have been playing with the Ruby library shoes. Basically you can write a
I'm new to Ruby and I've been playing around with making some webapps with
I'm playing with Ruby EventMachines for some time now and I think I'm understandings
So I have been playing with a Ruby gem for a work project that
I am playing around with getting some basic stuff to work in Python before

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.