Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loose Ruby interface for Pandoc, the most powerful markup processor.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 pandoku.gemspec
README.markdown

Pandoku

Pandoku is a loose Ruby interface for Pandoc, the most powerful markup processor written in Haskell.

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. It can read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF, RTF, DocBook XML, OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, groff man pages, and S5 HTML slide shows.

Installation

You should install Pandoc before installing Pandoku. If Haskell platform is installed on your system, you should just use cabal tool.

cabal install pandoc

Pandoku gem is distributed with RubyGems.

gem update --system
gem install pandoku

Simple Way

It defines String#pandoku method.

require 'pandoku'
doc = <<MKD
Pandoku
=======

[Pandoku][] is loose Ruby interface for [Pandoc][].

[pandoku]: http://github.com/lunant/pandoku
[pandoc]: http://johnmacfarlane.net/pandoc/
MKD
puts doc.pandoku(:markdown => :html)

Above code prints the following HTML:

<div id="pandoku"
><h1
>Pandoku</h1
><p
><a href="http://github.com/lunant/pandoku"
  >Pandoku</a
  > is loose Ruby interface for <a href="http://johnmacfarlane.net/pandoc/"
  >Pandoc</a
  >.</p
></div
>

Path Of Pandoc

You should export the environment variable PANDOC_PATH when the executable binary of Pandoc is not in PATH.

export PANDOC_PATH="$HOME/.cabal/bin/pandoc"

Or you can define the constant Pandoku::PANDOC_PATH before require 'pandoku'.

module Pandoku; PANDOC_PATH = "#{ENV['HOME']}/.cabal/bin/pandoc"; end
require 'pandoku'

Web Sites

The source code of Pandoku is available on GitHub. It is also an offical page of Pandoku.

http://github.com/lunant/pandoku

The Gem package is distributed on RubyGems.

http://rubygems.org/gems/pandoku

Also take a look at the original Pandoc, an amazing markup processor.

http://johnmacfarlane.net/pandoc/

There is a good alternative Ruby interface to Pandoc from a different angle.

http://github.com/autodata/pandoc-ruby

Author

Hong Minhee (洪民憙)
http://dahlia.kr/
dahlia@lunant.net

Something went wrong with that request. Please try again.