Create social share component in Jinja2 template based on share.js.
Project description
Create social share component in Jinja2 template based on share.js.
Get Started
Installation is easy:
$ pip install flask-share
Initialize the extension:
from flask_share import Share
...
share = Share(app)
Also support for factory pattern:
from flask_share import Share
share = Share()
def create_app():
app = Flask(__name__)
...
share.init_app(app)
Example
Here is a simple demo to demonstrate how to create a share component in template:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask-Share Demo</title>
{{ share.load() }}
</head>
<body>
<h1>Hello, Flask-Share!</h1>
<p>Maecenas tincidunt lacus at velit. Phasellus in felis. Praesent
id massa id nisl venenatis lacinia. Integer ac neque. Morbi ut odio.
Nullam varius. Sed vel enim sit amet nunc viverra dapibus. Nullam
varius. In hac habitasse platea dictumst.</p>
{{ share.create(title='Share with: ') }}
</body>
</html>
And here is what you get:
Links
Development
We welcome all kinds of contributions. You can run test like this:
$ python setup.py test
License
This project is licensed under the MIT License (see the LICENSE file for details).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-Share-0.1.1.tar.gz
(39.9 kB
view details)