Skip to content

Commit

Permalink
fix doc rendering for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
lehinevych committed Jul 13, 2018
1 parent f1484f6 commit 1e4ad1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MediaWikiAPI

[![PyPI version](https://img.shields.io/pypi/v/mediawikiapi.svg)](https://pypi.python.org/pypi/mediawikiapi)
[![Version](https://img.shields.io/pypi/pyversions/mediawikiapi.svg)](https://pypi.python.org/pypi/mediawikiapi)
[![Build Status](https://travis-ci.org/lehinevych/MediaWikiAPI.svg?branch=master)](https://travis-ci.org/leginevych/MediaWikiAPI)
[![Build Status](https://travis-ci.org/lehinevych/MediaWikiAPI.svg?branch=master)](https://travis-ci.org/lehinevych/MediaWikiAPI)
[![GitHub Issues](https://img.shields.io/github/issues/lehinevych/MediaWikiAPI.svg)](https://github.com/lehinevych/MediaWikiAPI/issues)
[![License](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![Docs](https://readthedocs.org/projects/mediawikiapi/badge/?version=latest)
Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ def local_file(file):
if line.strip() != ''
]


with open("README.md", "r") as fh:
long_description = fh.read()
try:
import pypandoc
long_description = pypandoc.convert_file('README.md', 'rst')
except(IOError, ImportError, OSError):
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')) as f:
long_description = f.read()


setuptools.setup(
Expand All @@ -41,6 +44,7 @@ def local_file(file):
install_requires = install_reqs,
packages = ['mediawikiapi'],
long_description = long_description,
long_description_content_type='text/markdown',
classifiers = [
'Development Status :: 4 - Beta',
'Topic :: Software Development :: Libraries',
Expand Down

0 comments on commit 1e4ad1d

Please sign in to comment.