Skip to content

Commit

Permalink
Merge branch 'dev-docs' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
imzbf committed May 11, 2024
2 parents 7ea96d1 + fa3d5cc commit 61f5006
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-editor-rt",
"version": "4.13.5",
"version": "4.14.0",
"keywords": [
"react",
"nextjs",
Expand Down Expand Up @@ -31,7 +31,7 @@
"dayjs": "^1.11.3",
"markdown-it-link-attributes": "^4.0.1",
"markdown-it-mark": "^4.0.0",
"md-editor-rt": "^4.13.5",
"md-editor-rt": "^4.14.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^7.2.6",
Expand Down
65 changes: 63 additions & 2 deletions public/doc-en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,10 @@ Except for the same as `MdPreview`:

### 📅 tableShape

- **type**: `[number, number]`
- **type**: `[number, number] \| [number, number, number, number]`
- **default**: `[6, 4]`

Preset the size of the table, [columns, rows].
Preset the size of the table, [columns, rows, Maximum number of columns, Maximum number of rows]

```jsx
<MdEditor tableShape={[8, 4]}>
Expand Down Expand Up @@ -1426,6 +1426,21 @@ config({
---
#### 🍥 zIndex
```js
import { config } from 'md-editor-rt';

config({
editorConfig: {
// for modal component
zIndex: 2000
}
});
```
---
### 🥠 editorExtensions
Config some dependency libraries, like highlight..
Expand Down Expand Up @@ -1487,6 +1502,52 @@ export interface EditorExtensions {
---
### 🥠 editorExtensionsAttrs
Synchronously add attributes to the CDN link tags, consistent with the type of `editorExtensions`, with a value type of `HTMLElementTagNameMap['tagName']`.
```js
import { config } from 'md-editor-rt';

config({
editorExtensionsAttrs: {
highlight: {
js: {
className: 'hglh-js'
},
css: {
atom: {
light: {
className: 'atom-light-css'
},
dark: {
className: 'atom-dark-css'
}
}
}
}
}
});
```
Example of using built-in basic configuration:
```js
import { config, editorExtensionsAttrs } from 'md-editor-rt';

config({
editorExtensionsAttrs
});
```
!!! warning Warning
Do not attempt to define the src \ onload \ id of the script and rel \ href \ id of the link in editorExtensionsAttrs, as they will be overwritten by default values
!!!
---
### 🫨 iconfontType
Set the way to display icons:
Expand Down
65 changes: 63 additions & 2 deletions public/doc-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,10 @@

### 📅 tableShape

- **类型**`[number, number]`
- **类型**`[number, number] \| [number, number, number, number]`
- **默认值**`[6, 4]`

标题栏添加表格时,预设待选表格大小,第一个代表最大列数,第二个代表最大行数。
标题栏添加表格时,预设待选表格大小,第一个代表最大列数,第二个代表最大行数,第三个代表扩展最大列数,第四个代表扩展最大行数

```jsx
<MdEditor tableShape={[8, 4]}>
Expand Down Expand Up @@ -1472,6 +1472,21 @@ config({
---
#### 🍥 zIndex
```js
import { config } from 'md-editor-rt';

config({
editorConfig: {
// 内部弹窗的zIndex
zIndex: 2000
}
});
```
---
### 🥠 editorExtensions
类型如下,用于配置编辑器内部的扩展
Expand Down Expand Up @@ -1533,6 +1548,52 @@ export interface EditorExtensions {
---
### 🥠 editorExtensionsAttrs
同步添加CDN链接标签的上属性,类型与`editorExtensions`一直,值类型是`HTMLElementTagNameMap<script|link>` 内部提供所有链接的`integrity`值,使用方式如下:
```js
import { config } from 'md-editor-rt';

config({
editorExtensionsAttrs: {
highlight: {
js: {
className: 'hglh-js'
},
css: {
atom: {
light: {
className: 'atom-light-css'
},
dark: {
className: 'atom-dark-css'
}
}
}
}
}
});
```
使用内置的基础属性配置示例:
```js
import { config, editorExtensionsAttrs } from 'md-editor-rt';

config({
editorExtensionsAttrs
});
```
!!! warning 提醒
不要尝试在editorExtensionsAttrs定义script的src\onload\id,link的rel\href\id它们会被默认值覆盖
!!!
---
### 🫨 iconfontType
固定使用那种方式展示图标,可以切换展示的方式
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3599,10 +3599,10 @@ marked@*:
resolved "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz#051ea8c8c7f65148a63003df1499515a2c6de716"
integrity sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==

md-editor-rt@^4.13.5:
version "4.13.5"
resolved "https://registry.npmjs.org/md-editor-rt/-/md-editor-rt-4.13.5.tgz#1d0fc0c92a671022520b65ce960abd11abac0aea"
integrity sha512-3CdDvOdBXK7o6bS+Xc9T4VQ4N09R6hK3HQB/tvl2EIGBk+YxVlaRdzf/Ov7fhDSjMObnq7Qv7WdKU/lJZ67mqg==
md-editor-rt@^4.14.0:
version "4.14.0"
resolved "https://registry.npmjs.org/md-editor-rt/-/md-editor-rt-4.14.0.tgz#9d2e20be7804d5aabf19cafbccec19b5faa353ae"
integrity sha512-3ZqAh6PbWZgF50M8lsvc1FhPDxEy480ZO1fKXG7EX2xFD69WrwI10oaqIBz5874pU6UzvOsxpydvwMwOlM/kJw==
dependencies:
"@codemirror/lang-markdown" "^6.2.5"
"@codemirror/language-data" "^6.5.1"
Expand Down

0 comments on commit 61f5006

Please sign in to comment.