Skip to content

Commit

Permalink
Fix readme, add to CI (encode#5625)
Browse files Browse the repository at this point in the history
* Add readme build to CI

* Fix pandoc import in setup.py

* Replace sponsor HTML with markdown

This loses the image centering, but can be converted to RST.

* Fix README RST conversion

- Links do not render correctly inside italics
- Add hr between image caption and section, fixes markup on older
  versions of pandoc.
  • Loading branch information
Ryan P Kilby authored and Pierre Chiquet committed Mar 24, 2020
1 parent 92368fe commit 7948ae1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ matrix:
- { python: "3.6", env: DJANGO=2.0 }
- { python: "2.7", env: TOXENV=lint }
- { python: "2.7", env: TOXENV=docs }
- python: "2.7"
env: TOXENV=readme
addons:
apt_packages: pandoc
exclude:
- { python: "2.7", env: DJANGO=master }
- { python: "2.7", env: DJANGO=2.0 }
Expand Down
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@ Full documentation for the project is available at [http://www.django-rest-frame

REST framework is a *collaboratively funded project*. If you use
REST framework commercially we strongly encourage you to invest in its
continued development by **[signing up for a paid plan][funding]**.
continued development by [signing up for a paid plan][funding].

The initial aim is to provide a single full-time position on REST framework.
*Every single sign-up makes a significant impact towards making that possible.*

<p align="center">
<a href="http://jobs.rover.com/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rover-readme.png"/></a>
<a href="https://getsentry.com/welcome/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/sentry-readme.png"/></a>
<a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/stream-readme.png"/></a>
<a href="https://hello.machinalis.co.uk/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/machinalis-readme.png"/></a>
<a href="https://rollbar.com/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rollbar-readme.png"/></a>
</p>
[![][rover-img]][rover-url]
[![][sentry-img]][sentry-url]
[![][stream-img]][stream-url]
[![][machinalis-img]][machinalis-url]
[![][rollbar-img]][rollbar-url]

*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com/).*
Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Rover][rover-url], [Sentry][sentry-url], [Stream][stream-url], [Machinalis][machinalis-url], and [Rollbar][rollbar-url].

---

Expand All @@ -50,6 +48,8 @@ There is a live example API for testing purposes, [available here][sandbox].

![Screenshot][image]

----

# Requirements

* Python (2.7, 3.4, 3.5, 3.6)
Expand Down Expand Up @@ -188,6 +188,18 @@ Send a description of the issue via email to [rest-framework-security@googlegrou
[funding]: https://fund.django-rest-framework.org/topics/funding/
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors

[rover-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rover-readme.png
[sentry-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/sentry-readme.png
[stream-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/stream-readme.png
[machinalis-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/machinalis-readme.png
[rollbar-img]: https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rollbar-readme.png

[rover-url]: http://jobs.rover.com/
[sentry-url]: https://getsentry.com/welcome/
[stream-url]: https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf
[machinalis-url]: https://hello.machinalis.co.uk/
[rollbar-url]: https://rollbar.com/

[oauth1-section]: http://www.django-rest-framework.org/api-guide/authentication/#django-rest-framework-oauth
[oauth2-section]: http://www.django-rest-framework.org/api-guide/authentication/#django-oauth-toolkit
[serializer-section]: http://www.django-rest-framework.org/api-guide/serializers/#serializers
Expand Down
3 changes: 3 additions & 0 deletions requirements/requirements-packaging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ transifex-client==0.11

# Pandoc to have a nice pypi page
pypandoc

# readme_renderer to check readme syntax
readme_renderer
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from setuptools import setup, find_packages

try:
from pypandoc import convert
from pypandoc import convert_file

def read_md(f):
return convert(f, 'rst')
return convert_file(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")

Expand Down
9 changes: 7 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ envlist =
{py27,py34,py35}-django110,
{py27,py34,py35,py36}-django111,
{py34,py35,py36}-django20,
{py35,py36}-djangomaster
lint,docs
{py35,py36}-djangomaster,
lint,docs,readme,

[travis:env]
DJANGO =
Expand Down Expand Up @@ -42,3 +42,8 @@ commands = mkdocs build
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt

[testenv:readme]
commands = ./setup.py check -rs
deps =
-rrequirements/requirements-packaging.txt

0 comments on commit 7948ae1

Please sign in to comment.