Skip to content

Commit 51a4761

Browse files
committed
Merge branch 'translate-md-to-rst' of github.com:ssteinerx/django-webpack-loader into ssteinerx-translate-md-to-rst
2 parents c42432b + eca3f9c commit 51a4761

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ tests/node_modules/
7777
tests/assets/bundles/
7878
tests/webpack-stats.json
7979
tests/webpack-stats-app2.json
80+
81+
# PyCharm IDE
82+
.idea

Diff for: README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@
77
<br>
88
Read http://owaislone.org/blog/webpack-plus-reactjs-and-django/ for a detailed step by step guide on setting up webpack with django using this library.
99

10-
<br>
1110

1211
Use webpack to generate your static bundles without django's staticfiles or opaque wrappers.
1312

1413

1514
Django webpack loader consumes the output generated by [webpack-bundle-tracker](https://github.com/owais/webpack-bundle-tracker) and lets you use the generated bundles in django.
1615

16+
## Maintainers
17+
In order to overcome the lack of support for Markdown on PyPi, building this package can use [pandoc](http://pandoc.org/installing.html) along with [pypandoc](https://pypi.python.org/pypi/pypandoc) to convert the README.md into a Restructured Text format compatible with PyPI. This requires installing `pandoc` for your operating system (installation instructions on the pandoc site), and `pypandoc` which will be installed if you:
18+
19+
pip install -r requirements-dev.txt
20+
21+
before uploading to PyPI.
22+
23+
If pandoc or pypandoc fails, the README.md file will be uploaded as it was before this enhancement.
1724

18-
<br>
1925
## Compatibility
2026

2127
Test cases cover Django>=1.6 on Python 2.7 and Python>=3.3. 100% code coverage is the target so we can be sure everything works anytime. It should probably work on older version of django as well but the package does not ship any test cases for them.

Diff for: requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Django==1.10.1
33
django-jinja==2.2.1
44
django-jinja2==0.1
55
unittest2==1.1.0
6+
pypandoc==1.2.0

Diff for: setup.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ def rel(*parts):
88
'''returns the relative path to a file wrt to the current directory'''
99
return os.path.abspath(os.path.join(os.path.dirname(__file__), *parts))
1010

11-
with open(rel('README.md')) as handler:
12-
README = handler.read()
11+
try:
12+
import pypandoc
13+
README = pypandoc.convert('README.md', 'rst')
14+
except OSError, ImportError:
15+
with open(rel('README.md')) as handler:
16+
README = handler.read()
1317

1418
with open(rel('webpack_loader', '__init__.py')) as handler:
1519
INIT_PY = handler.read()

0 commit comments

Comments
 (0)