From 6118f6aece46a3a98f917a1e9997fde54e66b4de Mon Sep 17 00:00:00 2001 From: DeanWu Date: Thu, 18 Jul 2019 16:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- README_CN.md | 4 +++- mdeditor/configs.py | 4 +++- mdeditor/templates/markdown.html | 4 ++-- mdeditor_demo/settings.py | 4 +++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3e1243f..55537eb 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,9 @@ MDEDITOR_CONFIGS = {     'tex': True, # whether to open the tex chart function     'flow_chart': True, # whether to open the flow chart function     'sequence': True, # Whether to open the sequence diagram function - 'watch': True # Live preview + 'watch': True, # Live preview + 'lineWrapping': False, # lineWrapping + 'lineNumbers': False # lineNumbers }      } diff --git a/README_CN.md b/README_CN.md index 423ebd2..2edda33 100644 --- a/README_CN.md +++ b/README_CN.md @@ -202,7 +202,9 @@ MDEDITOR_CONFIGS = { 'tex': True, # 是否开启 tex 图表功能 'flow_chart': True, # 是否开启流程图功能 'sequence': True, # 是否开启序列图功能 - 'watch': True # 实时预览 + 'watch': True, # 实时预览 + 'lineWrapping': False, # 自动换行 + 'lineNumbers': False # 行号 } ``` diff --git a/mdeditor/configs.py b/mdeditor/configs.py index 6dcf68f..cf821dc 100644 --- a/mdeditor/configs.py +++ b/mdeditor/configs.py @@ -27,7 +27,9 @@ 'flow_chart': True, 'sequence': True, 'language': 'zh', # zh / en - 'watch': True # Live preview + 'watch': True, # Live preview + 'lineWrapping': False, # lineWrapping + 'lineNumbers': False # lineNumbers } diff --git a/mdeditor/templates/markdown.html b/mdeditor/templates/markdown.html index 0027ead..d81f409 100644 --- a/mdeditor/templates/markdown.html +++ b/mdeditor/templates/markdown.html @@ -46,8 +46,8 @@ $(function () { editormd("{{ id }}-wmd-wrapper", { watch: {{ config.watch|lower }}, // 关闭实时预览 - lineNumbers: false, - lineWrapping: false, + lineNumbers: {{ config.lineNumbers|lower }}, + lineWrapping: {{ config.lineWrapping|lower }}, width: "{{ config.width }}", height: {{ config.height }}, // 当有多个mdeditor时,全屏后,其他mdeditor仍然显示,解决此问题。 diff --git a/mdeditor_demo/settings.py b/mdeditor_demo/settings.py index 02616b7..1b02b77 100644 --- a/mdeditor_demo/settings.py +++ b/mdeditor_demo/settings.py @@ -147,7 +147,9 @@ 'flow_chart': True, 'sequence': True, 'language': 'zh', # zh / en - 'watch': True # Live preview + 'watch': True, # Live preview + 'lineWrapping': False, # lineWrapping + 'lineNumbers': True # lineNumbers }, 'custom': { 'width': '90%',