Skip to content

Commit

Permalink
style: fix markdown code style (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming authored Jan 13, 2025
1 parent 6a1ad72 commit 8d91194
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 27 deletions.
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default antfu(

'no-restricted-globals': 'off',
'eqeqeq': 'off',
'no-new': 'off',
'no-new-func': 'off',
'no-alert': 'off',
'prefer-promise-reject-errors': 'off',
Expand Down
13 changes: 9 additions & 4 deletions packages/docs/fluent-editor/docs/api/fluent-editor-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ FluentEditor 类继承自 Quill 类,包含了 Quill 类的全部静态变量
- 类型

```typescript
Quill.import(path): any
class Quill {
static import(path): any
}
```

- 详细信息
Expand Down Expand Up @@ -51,9 +53,12 @@ const Link = FluentEditor.import('formats/link')
- 类型

```typescript
Quill.register(format: Attributor | BlotDefinintion, supressWarning: boolean = false)
Quill.register(path: string, def: any, supressWarning: boolean = false)
Quill.register(defs: { [path: string]: any }, supressWarning: boolean = false)
class Quill {
static register(format: Attributor | BlotDefinintion, supressWarning: boolean = false): void
static register(path: string, def: any, supressWarning: boolean = false): void
static register(defs: { [path: string]: any }, supressWarning: boolean = false): void
static register(...args: any[]): void
}
```

- 详细信息
Expand Down
16 changes: 11 additions & 5 deletions packages/docs/fluent-editor/docs/api/fluent-editor-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ Fluent Editor 基于 Quill,因此 Fluent Editor 的实例对象包含 Quill

- 类型

```typescript
getModule(name: string): any
```ts
class Quill {
getModule(name: string): any
}
```

- 详细信息
Expand All @@ -43,7 +45,9 @@ const i18n = quill.getModule('i18n')
- 类型

```typescript
getContents(index: number = 0, length: number = remaining): Delta
class Quill {
getContents(index: number = 0, length: number = remaining): Delta
}
```

- 详细信息
Expand All @@ -65,7 +69,9 @@ const delta = editor.getContents()
- 类型

```typescript
setContents(delta: Delta, source: string = 'api'): Delta
class Quill {
setContents(delta: Delta, source: string = 'api'): Delta
}
```

- 详细信息
Expand All @@ -79,7 +85,7 @@ editor.setContents([
{ insert: 'Hello ' },
{ insert: 'World!', attributes: { bold: true } },
{ insert: '\n' },
]);
])
```

- 参考[内容初始化](/docs/demo/set-content)
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/fluent-editor/docs/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ export interface FluentEditorOptions extends QuillOptions {
'better-table'?: boolean | BetterTableOptions

// 字符统计模块
counter: boolean | CounterOption
'counter': boolean | CounterOption

// 表情模块
'emoji-toolbar'?: boolean

// 文件上传模块
file?: boolean
'file'?: boolean

// 可编辑公式模块
mathlive: boolean
'mathlive': boolean

// @提醒模块
mention?: boolean | MentionOptions
'mention'?: boolean | MentionOptions
}

// 是否给超链接自动增加协议前缀
Expand Down
24 changes: 12 additions & 12 deletions packages/docs/fluent-editor/docs/modules/header-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ new FluentEditor('#editor', {
'toolbar': {
container: [[{ header: [null, 1, 2, 3, 4, 5, 6] }, 'header-list']],
handlers: {
'header-list': HeaderList.toolbarHandle
}
'header-list': HeaderList.toolbarHandle,
},
},
'header-list': {
container: document.getElementById('directory'), // 指定一个元素来接收头部列表
Expand All @@ -35,16 +35,16 @@ new FluentEditor('#editor', {

## Options 配置

| 名称 | 类型 | 描述 | 默认值 | 是否必选 |
| --------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------- |
| container | `string \| HTMLElement` | 列表容器,字符串必须是元素的id | - | `true` |
| scrollContainer | `string \| HTMLElement` | 编辑器滚动容器,默认是 `quill.root` | - | `false` |
| hideClass | `number` | 列表隐藏时的类名 | `is-hidden` | `false` |
| topOffset | `number \| () => number` | 从顶部的偏移量(单位为 `px` | `0` | `false` |
| 名称 | 类型 | 描述 | 默认值 | 是否必选 |
| --------------- | ------------------------ | ---------------------------------------------------------------------------- | ----------- | -------- |
| container | `string \| HTMLElement` | 列表容器,字符串必须是元素的id | - | `true` |
| scrollContainer | `string \| HTMLElement` | 编辑器滚动容器,默认是 `quill.root` | - | `false` |
| hideClass | `number` | 列表隐藏时的类名 | `is-hidden` | `false` |
| topOffset | `number \| () => number` | 从顶部的偏移量(单位为 `px`| `0` | `false` |
| headerHeight | `number` | 编辑器中的头部高度,这是用于计算头部滚动高亮的,不要使h1和h6之间的高度差过大 | `36` | `false` |
| onBeforeShow | `() => boolean` | 在显示前触发,返回 `true` 将取消显示 | - | `false` |
| onBeforeHide | `() => boolean` | 在隐藏前触发,返回 `true` 将取消隐藏 | - | `false` |
| onItemClick | `(id: string) => void` | 点击列表项时触发,id是头部元素的id | - | `false` |
| onBeforeShow | `() => boolean` | 在显示前触发,返回 `true` 将取消显示 | - | `false` |
| onBeforeHide | `() => boolean` | 在隐藏前触发,返回 `true` 将取消隐藏 | - | `false` |
| onItemClick | `(id: string) => void` | 点击列表项时触发,id是头部元素的id | - | `false` |

## 其他

Expand All @@ -54,7 +54,7 @@ new FluentEditor('#editor', {
new FluentEditor('#editor', {
theme: 'snow',
modules: {
'toolbar': [[{ header: [null, 1, 2, 3, 4, 5, 6] }, 'header-list'],],
'toolbar': [[{ header: [null, 1, 2, 3, 4, 5, 6] }, 'header-list']],
'header-list': {
container: document.getElementById('directory'), // 指定一个元素来接收头部列表
topOffset: () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/fluent-editor/docs/used-in-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import FluentEditor from '@opentiny/fluent-editor'
import { onMounted } from 'vue'
onMounted(() => {
// eslint-disable-next-line no-new
new FluentEditor('#editor', {
theme: 'snow',
})
Expand Down Expand Up @@ -106,7 +105,6 @@ export class AppComponent {
title = 'my-app'

ngAfterViewInit() {
// eslint-disable-next-line no-new
new FluentEditor('#editor', {
theme: 'snow',
})
Expand Down

0 comments on commit 8d91194

Please sign in to comment.