flask-markdown-to-html-0.1.3
توضیحات
可以在flask中查看markdown代码
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | flask-markdown-to-html-0.1.3 |
| نام | flask-markdown-to-html |
| نسخه کتابخانه | 0.1.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | zyzlaozhang2011 |
| ایمیل نویسنده | zyzlaozhang2011@163.com |
| آدرس صفحه اصلی | https://github.com/zyzlaozhang/flask_markdown_to_html |
| آدرس اینترنتی | https://pypi.org/project/flask-markdown-to-html/ |
| مجوز | MIT |
# 1.导入方法
```cmd
pip install flask-markdown
```
```python
from flask import Flask
from flask_markdown_to_html import flask_markdown_to_html
app=Flask(__name__)
md=flask_markdown_to_html(app)
```
# 2.函数使用
确保目录结构为以下结构
> app.py
> static **为存放markdown的路径**
>> markdown **为存放markdown的路径**
## 2.1 markdown_to_html
使用方法
```html
{{ md.markdown_to_html("markdown代码") }}
```
_确保你已经导入本库_
## 2.2 render_markdown
使用方法
```python
@app.route("/")
def index():
return render_markdown("在static/markdown/路径下的文件.md")
```
_确保你的markdown_path无误_
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.0 | Python |
نحوه نصب
نصب پکیج whl flask-markdown-to-html-0.1.3:
pip install flask-markdown-to-html-0.1.3.whl
نصب پکیج tar.gz flask-markdown-to-html-0.1.3:
pip install flask-markdown-to-html-0.1.3.tar.gz