{ "info": { "author": "zeleven", "author_email": "chengsmo@outlook.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Flask-SOEditor\nA Stack Overflow editor extension for Flask.\n## Installation\n`pip install Flask-SOEditor`\n## Usage\n### Initialization\nThe first step is to initialize the extension:\n```Python\nfrom flask import Flask, render_template\nfrom flask_soeditor import SOEditor\n\napp = Flask(__name__)\n\nsoeditor = SOEditor(app)\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\nif __name__ == '__main__':\n app.run(debug=True)\n```\nAlternatively, you could use the `init_app()` method, like this:\n```Python\nfrom flask import Flask, render_template\nfrom flask_soeditor import SOEditor\n\nsoeditor = SOEditor()\n\ndef create_app(config_name):\n app = Flask(__name__)\n app.config.from_object(config[config_name])\n config[config_name].init_app(app)\n \n soeditor.init_app(app)\n ...\n```\n\n### Add editor in template\nFirst, you have to load the css and js files, and then replace your textarea:\n```Html\n\n\n
\n\t