Skip to content

Commit

Permalink
prep for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesflynn committed Apr 23, 2014
1 parent 2e08a66 commit e92ae1a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 48 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include LICENSE AUTHORS
recursive-include eve_docs/templates *.html
47 changes: 0 additions & 47 deletions README.md

This file was deleted.

69 changes: 69 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Eve-docs
========

A blueprint that generates documentation for
`Eve <https://github.com/nicolaiarocci/eve>`__ APIs in HTML and JSON
formats. Eve-docs creates the documentation from your existing Eve
configuration file, with no additional configuration required.

Installation
~~~~~~~~~~~~

Clone this repo into your Eve application and modify your launch script
to activate the blueprints:

::

from flask.ext.bootstrap import Bootstrap
from eve_docs import eve_docs
...
Bootstrap(app)
app.register_blueprint(eve_docs, url_prefix='/docs')

After restarting, documentation is availabile at the ``url_prefix``
defined in your launch script. ``example.py`` shows how to do this using
the launch script from Nicola Iarocci's
`eve-demo <https://github.com/nicolaiarocci/eve-demo>`__ repo.

HTML output
~~~~~~~~~~~

The HTML documentation is produced using the
`Flask-Bootstrap <https://github.com/mbr/flask-bootstrap>`__ blueprint.
Expand each domain to show available endpoint methods, and further
expand each method to show parameter details. A screenshot with one
method expanded follows, and you can also view a `fully expanded
example <http://charonex.com/img/evedocs-example2.png>`__. |Sample
output|

JSON output
~~~~~~~~~~~

Documentation is also exposed as JSON at ``url_prefix/spec.json`` for
programmatic consumption. Example output:

::

{
"base": "http://localhost:5000",
"domains": {
"people": {
"/people/{_id}": {
"GET": {
"label": "Retrieve a person",
"params": [
{
"name": "_id",
"type": "string",
"required": true
}
]
...

License
~~~~~~~

Released under the `MIT
License <http://www.opensource.org/licenses/MIT>`__.

.. |Sample output| image:: http://charonex.com/img/evedocs-example.png
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/usr/bin/env python

from setuptools import setup, find_packages
LONG_DESCRIPTION = open('README.rst').read()

setup(
name='Eve-docs',
version='0.1.0',
url='https://github.com/charlesflynn/eve-docs',
author='Charles Flynn',
author_email='git@irab.org',
description='Generates documentation for Eve APIs',
long_description=LONG_DESCRIPTION,
license=open('LICENSE').read(),
packages=find_packages(),
zip_safe=False,
include_package_data=True,
Expand All @@ -16,5 +20,14 @@
'Eve>=0.1',
'Flask>=0.10',
'Flask-Bootstrap>=3.0',
]
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)

0 comments on commit e92ae1a

Please sign in to comment.