{"id":31539780,"url":"https://github.com/zhenyong97/flask-mdeditor","last_synced_at":"2025-10-04T09:14:50.069Z","repository":{"id":49403781,"uuid":"274028935","full_name":"zhenyong97/flask-mdeditor","owner":"zhenyong97","description":"A Markdown Editor as Flask extention ","archived":false,"fork":false,"pushed_at":"2024-12-01T11:28:15.000Z","size":6425,"stargazers_count":19,"open_issues_count":3,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T14:18:25.833Z","etag":null,"topics":["flask","mdeditor","python"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhenyong97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-22T03:14:33.000Z","updated_at":"2025-09-14T05:30:15.000Z","dependencies_parsed_at":"2024-03-04T07:32:30.647Z","dependency_job_id":"70b484a2-9e34-4ee4-accb-b2885b9b81fc","html_url":"https://github.com/zhenyong97/flask-mdeditor","commit_stats":{"total_commits":17,"total_committers":4,"mean_commits":4.25,"dds":"0.17647058823529416","last_synced_commit":"da79222db468d470af4315be759279e46eb891a3"},"previous_names":["callmehero/flask-mdeditor"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zhenyong97/flask-mdeditor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenyong97%2Fflask-mdeditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenyong97%2Fflask-mdeditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenyong97%2Fflask-mdeditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenyong97%2Fflask-mdeditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhenyong97","download_url":"https://codeload.github.com/zhenyong97/flask-mdeditor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenyong97%2Fflask-mdeditor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278290993,"owners_count":25962667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","mdeditor","python"],"created_at":"2025-10-04T09:14:48.859Z","updated_at":"2025-10-04T09:14:50.063Z","avatar_url":"https://github.com/zhenyong97.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-mdeditor\n[![ENV](https://img.shields.io/badge/release-v0.1-blue.svg)](https://github.com/pylixm/django-mdeditor)\n[![ENV](https://img.shields.io/badge/pypi-v0.1-blue.svg)](https://pypi.org/project/Flask-MDEditor/)\n[![ENV](https://img.shields.io/badge/中文-v0.1-blue.svg)](./README_CN.md)\n[![ENV](https://img.shields.io/badge/python-3.7+-green.svg)]()\n[![ENV](https://img.shields.io/badge/flask-2.0+-green.svg)]()\n[![LICENSE](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)\n\n![](./flask_and_mdeditor.png)\n\n**Flask-mdeditor** is Markdown Editor plugin application for [Flask](https://flask.palletsprojects.com/en/2.1.x/) and is based on [Editor.md](https://github.com/pandao/editor.md).\n\n**Flask-mdeditor** was inspired by the great [django-mdeditor](https://github.com/pylixm/django-mdeditor) and [flask-ckeditor](https://github.com/greyli/flask-ckeditor)\n\n**Note:**\n    \n* For Markdown page rendering issues, backend rendering is recommended. You can use markdown render plugin such as [mistune](https://github.com/lepture/mistune).\n\n## Features\n------------------------------\n* Almost Editor.md features:\n    * Supports Standard Markdown/CommonMark and GFM(GitHub Flavored Markdown); \n    * Full-featured: Real-time Preview, Image upload, Preformatted text/Code blocks/Tables insert, search replace, Themes and Multi-languages;\n    * The MDEditorField is provided for the FlaskForm.\n\n\n## Quick Start\n------------------------------\n### Installation\n\u003e `pip install flask-mdeditor`\n### Initialization\nThis extension needs to be initialized in the usual way before it can be used. In order to be able to **save upload image** correctly, `MDEDITOR_FILE_UPLOADER` needs to be first configured, such as:\n```python\nfrom flask_mdeditor import MDEditor\nimport os\n\nbasedir = os.path.abspath(os.path.dirname(__file__))\napp = Flask(__name__)\napp.config['MDEDITOR_FILE_UPLOADER'] = os.path.join(basedir, 'uploads') # this floder uesd to save your uploaded image\nmdeditor = MDEditor(app)\n```\n### Working with Flask-WTF/WTForms\nWhen using Flask-WTF/WTForms, you can import MDEditorField provided by FLASK-MDEDITOR and use it just like StringField:\n```python\nfrom flask_mdeditor import  MDEditorField\nclass PostForm(FlaskForm):\n    content = MDEditorField('Body', validators=[DataRequired()])\n    submit = SubmitField()\n\n```\nThen you can use it in your template:\n```html\n\u003cform action=\"/xxx\" method=\"POST\"\u003e\n        {{ form.csrf_token }}\n        {{ form.content.label }} {{ form.content() }}\n        {{ form.submit() }}\n\u003c/form\u003e\n```\nOr, if you don't use the wtf, you can use the global jinja2 func `{{ mdeditor.load() }}` to load the editor, such as:\n```html\n\u003cform action=\"/\" method=\"POST\"\u003e\n    {{ mdeditor.load() }}\n    \u003cbutton type=\"submit\"\u003esubmit\u003c/button\u003e\n\u003c/form\u003e\n```\n\n### Get the Data\n* Use the wtf\n```python\n@app.route('/post', methods=['GET', 'POST'])\ndef post():\n    form = PostForm()\n    if form.validate_on_submit():\n        body = form.content.data\n        ...\n```\n* Else,\nsince the MDEditor textarea is just a normal `\u003ctextarea\u003e` element, you can get the data from request.form by passing **mdeditor** as key:\n```python\n@app.route('/save', methods=['POST'])\ndef new_post():\n    if request.method == 'POST':\n        data = request.form.get('mdeditor')\n    ...\n```\n------------------\n## Tip\nCheck the demo application at demo/flask_test.\n\n## Available Configuration\nThe more configuration options available are listed below:\n|Name|Default Value| Info | Required | Option\n|-|-|-|-|-|\n|MDEDITOR_FILE_UPLOADER| path | the floder path used to save uploaded img  | √ | \n|MDEDITOR_HEIGHT|500px|Browser rendering editor height|×|\n|MDEDITOR_WIDTH|100%|Browser rendering editor width|×|\n|MDEDITOR_THEME|default|editor main theme|×|dark / default|\n|MDEDITOR_PREVIEW_THEME|default|preview area theme|×| default / dark\n|MDEDITOR_EDITOR_THEME|default|edit area theme|×| pastel-on-dark / default\n|MDEDITOR_LANGUAGE|en|editor language|×|zh / en\n\n## TODO\n* Unit Testing\n* code optimization\n* More Features\n## License\nThe MIT License.\n\nCopyright (c) 2020 Zisc","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenyong97%2Fflask-mdeditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhenyong97%2Fflask-mdeditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenyong97%2Fflask-mdeditor/lists"}