diff --git a/flask_website/__init__.py b/flask_website/__init__.py index 882877c6..8ba8a261 100644 --- a/flask_website/__init__.py +++ b/flask_website/__init__.py @@ -23,8 +23,10 @@ def remove_db_session(response): from flask_website.views.general import general from flask_website.views.mailinglist import mailinglist from flask_website.views.snippets import snippets +from flask_website.views.extensions import extensions app.register_module(general) app.register_module(mailinglist) app.register_module(snippets) +app.register_module(extensions) from flask_website.database import User, db_session diff --git a/flask_website/static/extensions.png b/flask_website/static/extensions.png new file mode 100644 index 00000000..7302aed1 Binary files /dev/null and b/flask_website/static/extensions.png differ diff --git a/flask_website/static/style.css b/flask_website/static/style.css index e2997630..22929486 100644 --- a/flask_website/static/style.css +++ b/flask_website/static/style.css @@ -16,6 +16,7 @@ pre { padding: 7px 30px; margin: 15px -30px; line-height: 1.3; } p { line-height: 1.4; } ul { margin: 15px 0 15px 0; padding: 0; list-style: none; line-height: 1.4; } ul li:before { content: "\00BB \0020"; color: #888; position: absolute; margin-left: -19px; } +ol { line-height: 1.4; margin: 15px 0 15px 30px; padding: 0; } blockquote { margin: 0; font-style: italic; color: #444; } .footer { font-size: 13px; color: #888; text-align: right; margin-top: 25px; } .nav { text-align: center; } @@ -70,6 +71,12 @@ input.openid { background: url(openid.png) no-repeat 4px center; .mail .quote { color: #004B6B; } .mail .sig { color: #888; } +/* extensions */ +.extension div.description p { margin: 10px 0; } +.extension dl { margin: 0; font-size: 0.9em; } +.extension dl dt { width: 130px; float: left; height: 22px; } +.extension dl dd { height: 22px; } + /* pygments style, same as flaskystyle */ .hll { background-color: #ffffcc } .c { color: #8f5902; font-style: italic } /* Comment */ diff --git a/flask_website/templates/extensions/creating.html b/flask_website/templates/extensions/creating.html new file mode 100644 index 00000000..0ff73ced --- /dev/null +++ b/flask_website/templates/extensions/creating.html @@ -0,0 +1,38 @@ +{% extends "extensions/layout.html" %} +{% block title %}Creating Extensions{% endblock %} +{% block body %} +
+ Extensions to Flask are regular Python packages. But there are some + rules you should/must follow so that we can enlist your extension on + the Flask extension registry: +
flaskext.
+ namespace package. This makes it easier for others to locate
+ your extension and does not clutter the PyPI index with generic
+ toplevel packages.
+ + We scan the PyPI index in regular intervals for new Flask packages + so your extension should sooner or later end up here. If this is + not quick enough for you, send me a mail. +{% endblock %} diff --git a/flask_website/templates/extensions/index.html b/flask_website/templates/extensions/index.html new file mode 100644 index 00000000..c8169d51 --- /dev/null +++ b/flask_website/templates/extensions/index.html @@ -0,0 +1,36 @@ +{% extends "extensions/layout.html" %} +{% block title %}Extensions Registry{% endblock %} +{% block body %} +
+ Welcome to the Flask extensions registry. Here you can find a list + of packages that extend Flask. This list is moderated and updated + on a regular basis. If you want your package to show up here, + follow the guide on creating + extensions. + {% for extension in extensions %} +
Adds OAuth support to Flask. + ''', + github='mitsuhiko/flask-oauth', + docs='http://packages.python.org/Flask-OAuth' + ), + Extension('Flask-OpenID', 'Armin Ronacher', + description=''' +
Adds OpenID support to Flask. + ''', + github='mitsuhiko/flask-openid', + docs='http://packages.python.org/Flask-OpenID' + ) +] +database.sort(key=lambda x: x.name.lower()) + + +@extensions.route('/') +def index(): + return render_template('extensions/index.html', extensions=database) + + +@extensions.route('/creating/') +def creating(): + return render_template('extensions/creating.html')