Skip to content

Commit 0cb4417

Browse files
author
- -
committed
translate document
1 parent 80441c5 commit 0cb4417

File tree

2 files changed

+47
-48
lines changed

2 files changed

+47
-48
lines changed

doc/configuration_en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [SimpleMDE Configuration](https://github.com/NextStepWebs/simplemde-markdown-editor#Configuration)
1+
## [SimpleMDE Configuration](https://github.com/NextStepWebs/simplemde-markdown-editor#configuration)
22

33
- **autoDownloadFontAwesome**: If set to `true`, force downloads Font Awesome (used for icons). If set to `false`, prevents downloading. Defaults to `undefined`, which will intelligently check whether Font Awesome has already been included, then download accordingly.
44
- **autofocus**: If set to `true`, autofocuses the editor. Defaults to `false`.

doc/configuration_zh.md

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [SimpleMDE 配置](https://github.com/NextStepWebs/simplemde-markdown-editor#Configuration)
1+
## [SimpleMDE 配置](https://github.com/NextStepWebs/simplemde-markdown-editor#configuration)
22

33
- **autoDownloadFontAwesome**: 如果设置为 `true`, force downloads Font Awesome (used for icons). If set to `false`, prevents downloading. Defaults to `undefined`, which will intelligently check whether Font Awesome has already been included, then download accordingly.
44
- **autofocus**: If set to `true`, autofocuses the editor. Defaults to `false`.
@@ -42,7 +42,7 @@
4242
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
4343

4444
```JavaScript
45-
// Most options demonstrate the non-default behavior
45+
// 以下大多数选项为非默认行为
4646
export default {
4747
data () {
4848
return {
@@ -76,14 +76,13 @@ export default {
7676
},
7777
placeholder: 'Type here...',
7878
previewRender: function(plainText) {
79-
return customMarkdownParser(plainText) // Returns HTML from a custom parser
79+
return customMarkdownParser(plainText) // 返回HTML自定义解析器
8080
},
81-
previewRender: function(plainText, preview) { // Async method
82-
setTimeout(function(){
81+
previewRender: function(plainText, preview) { // 异步方法
82+
setTimeout(function () {
8383
preview.innerHTML = customMarkdownParser(plainText)
8484
}, 250)
85-
86-
return 'Loading...'
85+
return '加载中...'
8786
},
8887
promptURLs: true,
8988
renderingConfig: {
@@ -117,41 +116,41 @@ export default {
117116
}
118117
```
119118

120-
#### Toolbar icons
119+
#### 工具栏
121120

122-
Below are the built-in toolbar icons (only some of which are enabled by default), which can be reorganized however you like. 'Name' is the name of the icon, referenced in the JS. 'Action' is either a function or a URL to open. 'Class' is the class given to the icon. 'Tooltip' is the small tooltip that appears via the `title='` attribute. Note that shortcut hints are added automatically and reflect the specified action if it has a keybind assigned to it (i.e. with the value of `action` set to `bold` and that of `tooltip` set to `Bold`, the final text the user will see would be 'Bold (Ctrl-B)').
121+
下面是内置的工具栏图标(只有一些默认启用),你可以根据喜好重新排列。如果按钮有快捷键,将自动显示提示(即如果把`action`设置为`toggleBold``title`设置`加粗`,最终的提示文本将为`加粗(Ctrl-B`)。
123122

124-
Additionally, you can add a separator between any icons by adding `'|'` to the toolbar array.
123+
此外,你可以在工具栏数组中任意两个图标之间添加一个分离线`'|'`
125124

126-
Name | Action | Tooltip<br>Class
125+
name | action | title<br>className
127126
:--- | :----- | :--------------
128-
bold | toggleBold | Bold<br>fa fa-bold
129-
italic | toggleItalic | Italic<br>fa fa-italic
130-
strikethrough | toggleStrikethrough | Strikethrough<br>fa fa-strikethrough
131-
heading | toggleHeadingSmaller | Heading<br>fa fa-header
132-
heading-smaller | toggleHeadingSmaller | Smaller Heading<br>fa fa-header
133-
heading-bigger | toggleHeadingBigger | Bigger Heading<br>fa fa-lg fa-header
134-
heading-1 | toggleHeading1 | Big Heading<br>fa fa-header fa-header-x fa-header-1
135-
heading-2 | toggleHeading2 | Medium Heading<br>fa fa-header fa-header-x fa-header-2
136-
heading-3 | toggleHeading3 | Small Heading<br>fa fa-header fa-header-x fa-header-3
137-
code | toggleCodeBlock | Code<br>fa fa-code
138-
quote | toggleBlockquote | Quote<br>fa fa-quote-left
139-
unordered-list | toggleUnorderedList | Generic List<br>fa fa-list-ul
140-
ordered-list | toggleOrderedList | Numbered List<br>fa fa-list-ol
141-
clean-block | cleanBlock | Clean block<br>fa fa-eraser fa-clean-block
142-
link | drawLink | Create Link<br>fa fa-link
143-
image | drawImage | Insert Image<br>fa fa-picture-o
144-
table | drawTable | Insert Table<br>fa fa-table
145-
horizontal-rule | drawHorizontalRule | Insert Horizontal Line<br>fa fa-minus
146-
preview | togglePreview | Toggle Preview<br>fa fa-eye no-disable
147-
side-by-side | toggleSideBySide | Toggle Side by Side<br>fa fa-columns no-disable no-mobile
148-
fullscreen | toggleFullScreen | Toggle Fullscreen<br>fa fa-arrows-alt no-disable no-mobile
149-
guide | [This link](https://simplemde.com/markdown-guide) | Markdown Guide<br>fa fa-question-circle
150-
151-
Customize the toolbar using the `toolbar` option like:
127+
bold | toggleBold | 加粗<br>fa fa-bold
128+
italic | toggleItalic | 斜体<br>fa fa-italic
129+
strikethrough | toggleStrikethrough | 删除线<br>fa fa-strikethrough
130+
heading | toggleHeadingSmaller | 标题<br>fa fa-header
131+
heading-smaller | toggleHeadingSmaller | 缩小标题<br>fa fa-header
132+
heading-bigger | toggleHeadingBigger | 增大标题<br>fa fa-lg fa-header
133+
heading-1 | toggleHeading1 | 大标题<br>fa fa-header fa-header-x fa-header-1
134+
heading-2 | toggleHeading2 | 中等标题<br>fa fa-header fa-header-x fa-header-2
135+
heading-3 | toggleHeading3 | 小标题<br>fa fa-header fa-header-x fa-header-3
136+
code | toggleCodeBlock | 代码块<br>fa fa-code
137+
quote | toggleBlockquote | 引用<br>fa fa-quote-left
138+
unordered-list | toggleUnorderedList | 无序列表<br>fa fa-list-ul
139+
ordered-list | toggleOrderedList | 有序列表<br>fa fa-list-ol
140+
clean-block | cleanBlock | 清除格式<br>fa fa-eraser fa-clean-block
141+
link | drawLink | 插入链接<br>fa fa-link
142+
image | drawImage | 插入图片<br>fa fa-picture-o
143+
table | drawTable | 插入表格<br>fa fa-table
144+
horizontal-rule | drawHorizontalRule | 插入水平线<br>fa fa-minus
145+
preview | togglePreview | 预览<br>fa fa-eye no-disable
146+
side-by-side | toggleSideBySide | 全屏预览<br>fa fa-columns no-disable no-mobile
147+
fullscreen | toggleFullScreen | 全屏<br>fa fa-arrows-alt no-disable no-mobile
148+
guide | [跳转链接](https://simplemde.com/markdown-guide) | Markdown引导<br>fa fa-question-circle
149+
150+
使用`toolbar`选项自定义工具栏:
152151

153152
```JavaScript
154-
// Customize only the order of existing buttons
153+
// 仅自定义现有按钮的顺序
155154
export default {
156155
data () {
157156
return {
@@ -162,7 +161,7 @@ export default {
162161
}
163162
}
164163

165-
// Customize all information and/or add your own icons
164+
// 自定义所有信息和/或添加你的图标
166165
export default {
167166
data () {
168167
return {
@@ -171,17 +170,17 @@ export default {
171170
name: 'bold',
172171
action: SimpleMDE.toggleBold,
173172
className: 'fa fa-bold',
174-
title: 'Bold'
173+
title: '加粗'
175174
},
176175
{
177176
name: 'custom',
178-
action: function customFunction(editor){
179-
// Add your own code
177+
action: function customFunction (editor) {
178+
// 添加你的代码
180179
},
181180
className: 'fa fa-star',
182-
title: 'Custom Button'
181+
title: '自定义按钮'
183182
},
184-
'|' // Separator
183+
'|' // 分隔符
185184
...
186185
]
187186
}
@@ -192,22 +191,22 @@ export default {
192191

193192
#### 快捷键
194193

195-
simplemde带有预定义键盘快捷键的数组,可以用一个配置选项改变。默认的列表如下:
194+
SimpleMDE带有预定义键盘快捷键的数组,可以用一个配置选项改变。默认的列表如下:
196195

197196
快捷键 | 操作
198197
:------- | :-----
199-
*Cmd-'* | 'toggleBlockquote'
198+
*Cmd-'* | '引用'
200199
*Cmd-B* | '加粗'
201-
*Cmd-E* | 'cleanBlock'
202-
*Cmd-H* | '降低标题级别'
200+
*Cmd-E* | '清除格式'
201+
*Cmd-H* | '缩小标题'
203202
*Cmd-I* | '斜体'
204203
*Cmd-K* | '插入链接'
205204
*Cmd-L* | '插入无序列表'
206205
*Cmd-P* | '预览'
207206
*Cmd-Alt-C* | '插入代码块'
208207
*Cmd-Alt-I* | '插入图片'
209208
*Cmd-Alt-L* | '插入有序列表'
210-
*Shift-Cmd-H* | '提高标题级别'
209+
*Shift-Cmd-H* | '增大标题'
211210
*F9* | '全屏预览'
212211
*F11* | '全屏'
213212

0 commit comments

Comments
 (0)