Added reStructuredText syntax check to setup.py and updated README.

This commit is contained in:
Jon Grace-Cox
2018-02-10 11:27:40 -05:00
parent 259437b4b1
commit 6d9863262c
3 changed files with 45 additions and 10 deletions

View File

@@ -108,13 +108,35 @@ anybadge --value=2.22 --file=pylint.svg pylint
### Examples
| Example | Badge |
| ------- | ----- |
| `anybadge --value=2.22 --file=pylint.svg pylint` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg)
| `anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg)
| `anybadge --value=65 --file=coverage.svg coverage` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/coverage.svg)
| `anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pipeline.svg)
| `anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/awesomeness.svg)
#### Pylint using template
```
anybadge --value=2.22 --file=pylint.svg pylint
```
![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg)
#### Pylint using arguments
```
anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green
```
![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg)
#### Coverage using template
```
anybadge --value=65 --file=coverage.svg coverage
```
![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/coverage.svg)
#### Pipeline, using labeled colors
```
anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red
```
![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pipeline.svg)
#### Badge with fixed color
```
anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00
```
![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/awesomeness.svg)
### Options

View File

@@ -1,2 +1,3 @@
mister-bump>=1.0.0
m2r
m2r
restructuredtext_lint

View File

@@ -2,11 +2,24 @@
from setuptools import setup
from mister_bump import bump
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=parse_from_file('README.md'),
long_description=rst_readme,
version=bump(),
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
@@ -18,7 +31,6 @@ setup(
options={
'bdist_wheel': {'universal': True}
},
platform=['any'],
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main'],