Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Python wrapper for Pandoc—the universal document converter.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 pandoc
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 HISTORY.rst
Octocat-spinner-32 LICENSE
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.rst
Octocat-spinner-32 TODO.rst
Octocat-spinner-32 fabfile.py
Octocat-spinner-32 setup.py
README.rst

Pyandoc: a simple Pandoc wrapper for Python

Requirements

  • Pandoc

Usage

Get setup.

import pandoc

pandoc.PANDOC_PATH = '/usr/bin/pandoc'

Let's start with a Markdown document:

doc = pandoc.Document()
doc.markdown = '''
# I am an H1 Tag

* bullet point
* more points
* point with [link](http://kennethreitz.com)!
'''

Now let's convert that into a ReST document:

>>> print doc.rst

I am an H1 Tag
==============


-  bullet point
-  more points
-  point with `link <http://kennethreitz.com>`_!
Formats available:
  • context
  • docbook
  • epub
  • html
  • html_lhs
  • latex
  • latex_lhs
  • man
  • markdow
  • nmarkdown_lhs
  • mediawiki
  • native
  • odt
  • opendocument
  • plain
  • rst
  • rst_lhs
  • rtf
  • s5
  • slidy
  • texinfo'

Enjoy.

Roadmap

  • Cleanup
  • Figure out epub, odt support
  • Figure out better path management
  • Proper Exceptions
  • Unit testing
  • CI
Something went wrong with that request. Please try again.