Skip to main content

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:

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).

Project details


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)

Uploaded Source

Built Distribution

Flask_Share-0.1.1-py2.py3-none-any.whl (49.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-Share-0.1.1.tar.gz.

File metadata

  • Download URL: Flask-Share-0.1.1.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Flask-Share-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7425e4dd20bf3b63ba3ec02b78502ff3166a23c469c8787cf1b21e402e0a098b
MD5 8340605771926a4f06d419aaf2288f2d
BLAKE2b-256 25a444786a33e59ebea4ab07b90bba41d77bc2a6802967f8e8988f60805b0567

See more details on using hashes here.

File details

Details for the file Flask_Share-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Share-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e9673aafcde7c24a41ac831473a9fb2c6d159915e7335ca89cacac9114dd01f3
MD5 3e506d4e6567804ef08d4280427b0156
BLAKE2b-256 ddfc8ea7d8afbf899957cbebae043a330763c3a12e595091fcb20fbe30775f86

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page