Skip to content

Commit

Permalink
docs/release: add optional translation from markdown to rst of long d…
Browse files Browse the repository at this point in the history
…escription using pypandoc
  • Loading branch information
Michał Jaworski committed Oct 30, 2014
1 parent 2cca1b3 commit 6dd5552
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ def get_version(version_tuple):

INSTALL_REQUIRES = reqs('requirements.txt')

README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print(
"warning: pypandoc module not found, could not convert Markdown to RST"
)
read_md = lambda f: open(f, 'r').read()

README = os.path.join(os.path.dirname(__file__), 'README.md')
PACKAGES = find_packages('src')
PACKAGE_DIR = {'': 'src'}

Expand All @@ -52,7 +61,7 @@ def get_version(version_tuple):
author='Clearcode - The A Room',
author_email='[email protected]',
description='Doorkeeper for consul discovered services.',
long_description=README,
long_description=read_md(README),

packages=PACKAGES,
package_dir=PACKAGE_DIR,
Expand Down

0 comments on commit 6dd5552

Please sign in to comment.