Skip to content
An Extensible Markup Language
Ruby TeX Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Doublesing Logo

Build Status Test Coverage Code Climate

Doublesing is a wiki markup language based on TeX. It's very simple and extremely flexible. You can register your own tags (including over-riding builtin ones) to suit your needs, effectively allowing a custom dialect to be built with just ruby objects.


Add this line to your application's Gemfile:

gem 'doublesing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install doublesing


Doublesing is a TeX-like language designed to be used for online markup. It takes the relatively simple form of:


Here, maybe a use case will help:

\bold[This text becomes bold!]


<b>This text becomes bold!</b>

You can have blocks that take multiple arguments:

\header[1][This is a header]
<h1>This is a header</h1>

Parsing this is easy:

Doublesing.setup! # Must call once, probably in an initializer
Doublesing.parse(str) #=> Processed HTML

Where it gets interesting is the fact that you can register your own block types. A common use case of this might be to add site-specific functionality. Let's say you're making a website about pictures of famous dogs. You probably want your user to be able to reference dogs pretty quickly. Well, with Doublesing, you can do something like:

class DogFinder
  def initialize(args)
    @dog_name = args.first
    @body = args[1]

  def find_dog
    dog = Dog.where(name: @dog_name).pluck(:id).first

  def to_s
    "<a href=\"#{find_dog}\">#{@body.to_s}</a>"

Then, register it:

Doublesing.register("dog", DogFinder)

Now, assuming you're using Doublesing to parse comments, a user can say:

\dog[Rowlf][My favorite musical dog!]

To easily get a link to the page on the piano player of the Muppets. Pretty neat, huh?

Run rake specification to generate a .pdf with the full specification of built-in blocks.

There aren't that many right now, but you're free to submit a pull request with one! Note: You gotta have PDFLatex installed for that to work.


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
You can’t perform that action at this time.