Skip to content

Commit

Permalink
Use pandoc to convert markdown to rst (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkpeprah authored Sep 27, 2017
1 parent fae4c02 commit 9952eaa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ python:

install:
- pip install -r requirements.txt
- pip install pypandoc

script:
- pycodestyle .
Expand All @@ -20,3 +21,8 @@ deploy:
on:
branch: master
tags: true

addons:
apt:
packages:
- pandoc
24 changes: 23 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,28 @@ def run(self):
return behave.main([self.features_dir])


def long_description():
"""Reads and returns the contents of the README.
On failure, returns the project long description.
Returns:
The project's long description.
"""
cwd = os.path.abspath(os.path.dirname(__file__))
readme_path = os.path.join(cwd, 'README.md')
if not os.path.exists(readme_path):
return pylink.__long_description__

try:
import pypandoc
return pypandoc.convert(readme_path, 'rst')
except (IOError, ImportError):
pass

return open(readme_path, 'r').read()


setuptools.setup(
# Project information.
name='pylink-square',
Expand All @@ -213,7 +235,7 @@ def run(self):
author=pylink.__author__,
author_email=pylink.__author_email__,
description=pylink.__description__,
long_description=pylink.__long_description__,
long_description=long_description(),
license=pylink.__license__,
keywords='SEGGER J-Link',
url=pylink.__url__,
Expand Down

0 comments on commit 9952eaa

Please sign in to comment.