Skip to main content

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:

https://raw.githubusercontent.com/greyli/flask-share/master/images/demo.png

Before you ask, the share component is highly customizable.

Development

We welcome all kinds of contributions. You can run test like this:

$ python setup.py test

Authors

Maintainer: Grey Li

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License (see the LICENSE file for details).

Release files for Flask-Share 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Share 0.1.1
File Size Uploaded
Flask-Share-0.1.1.tar.gz 39.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-Share 0.1.1
File Interpreter ABI Platform
Flask_Share-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 89.8 kB

Release files / Flask-Share-0.1.1.tar.gz

Download URL Flask-Share-0.1.1.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7425e4dd20bf3b63ba3ec02b78502ff3166a23c469c8787cf1b21e402e0a098b
BLAKE2b-256 checksum
How to use checksums
25a444786a33e59ebea4ab07b90bba41d77bc2a6802967f8e8988f60805b0567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Flask_Share-0.1.1-py2.py3-none-any.whl

Download URL Flask_Share-0.1.1-py2.py3-none-any.whl
Size 49.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e9673aafcde7c24a41ac831473a9fb2c6d159915e7335ca89cacac9114dd01f3
BLAKE2b-256 checksum
How to use checksums
ddfc8ea7d8afbf899957cbebae043a330763c3a12e595091fcb20fbe30775f86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page