Skip to content

Commit

Permalink
add: readme, Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lingjieee committed May 31, 2020
1 parent 9680ea5 commit 4e14e44
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 15 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
English | [简体中文](README.zh-CN.md)

<h1 align="center">Fantasy Editor</h1>

<div align="center">

A Rich Text Editor Based On [G6](https://github.com/antvis/g6) and [React](https://github.com/facebook/react).

[![GitHub](https://img.shields.io/github/license/lingjieee/fantasy-editor)](LICENSE)
[![npm](https://img.shields.io/npm/v/fantasy-editor)](https://www.npmjs.com/package/fantasy-editor)
[![npm](https://img.shields.io/npm/dm/fantasy-editor)](https://www.npmjs.com/package/fantasy-editor)

</div>

## Installation

### npm

```bash | pure
npm install fantasy-editor --save
```

## Examples

```bash | pure
# Clone the repository
$ git clone https://github.com/lingjieee/fantasy-editor.git

# Change directory
$ cd fantasy-editor

# Install dependencies
$ yarn install

# Run examples
$ yarn start
```
37 changes: 37 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[English](README.md) | 简体中文

<h1 align="center">Fantasy Editor</h1>

<div align="center">

基于 [Slate](https://github.com/ianstormtaylor/slate)[React](https://github.com/facebook/react) 的富文本编辑器

[![GitHub](https://img.shields.io/github/license/lingjieee/fantasy-editor)](LICENSE)
[![npm](https://img.shields.io/npm/v/fantasy-editor)](https://www.npmjs.com/package/fantasy-editor)
[![npm](https://img.shields.io/npm/dm/fantasy-editor)](https://www.npmjs.com/package/fantasy-editor)

</div>

## 安装

### npm

```bash | pure
npm install fantasy-editor --save
```

## 示例

```bash | pure
# 克隆仓库
$ git clone https://github.com/lingjieee/fantasy-editor.git

# 切换目录
$ cd fantasy-editor

# 安装依赖
$ yarn install

# 运行示例
$ yarn start
```
2 changes: 1 addition & 1 deletion docs/examples/full.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: FullDemo
order: 1
group:
title: Core
order: 1
---

<code src="../../examples/full" compact/>
10 changes: 10 additions & 0 deletions docs/examples/full.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: 完整Demo
order: 1
group:
title: 核心
nav:
title: 演示
---

<code src="../../examples/full" compact/>
18 changes: 9 additions & 9 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
title: 快速上手
title: Getting Started
group:
title: 指南
title: Guide
order: 0
nav:
title: 指南
title: Guide
---

## 安装
## Installation

### npm

```bash | pure
npm install fantasy-editor --save
```

## 示例
## Examples

```bash | pure
# 克隆仓库
# Clone the repository
$ git clone https://github.com/lingjieee/fantasy-editor.git

# 切换目录
# Change directory
$ cd fantasy-editor

# 安装依赖
# Install dependencies
$ yarn install

# 运行示例
# Run examples
$ yarn start
```
32 changes: 32 additions & 0 deletions docs/guide/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: 快速上手
group:
title: 指南
order: 0
nav:
title: 指南
---

## 安装

### npm

```bash | pure
npm install fantasy-editor --save
```

## 示例

```bash | pure
# 克隆仓库
$ git clone https://github.com/lingjieee/fantasy-editor.git

# 切换目录
$ cd fantasy-editor

# 安装依赖
$ yarn install

# 运行示例
$ yarn start
```
10 changes: 10 additions & 0 deletions docs/index.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Fantasy Editor - 基于Slate和React的富文本编辑器
hero:
title: Fantasy Editor
desc: 基于Slate和React的富文本编辑器
actions:
- text: 快速上手
link: /zh-CN/guide/getting-started
footer: Open-source MIT Licensed | Copyright © 2020<br />Powered by [dumi](https://d.umijs.org)
---
4 changes: 1 addition & 3 deletions examples/full/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React, {FunctionComponent, useState} from 'react';
// @ts-ignore
import initValue from './value.json';
import {Node} from 'slate';
import FantasyEditor from "fantasy-editor";
import {Config} from "../../src";
import FantasyEditor, {Config} from "fantasy-editor";

interface OwnProps {
}
Expand Down Expand Up @@ -46,7 +45,6 @@ const FullUsage: FunctionComponent<Props> = (props) => {
};

const onChange = (value: Node[]) => {
(window as any).value = value;
setValue(value);
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"start": "npm run docs:start",
"build": "node ./scripts/build.js",
"docs:start": "dumi dev",
"docs:build": "dumi build",
"docs:build": "dumi build && echo 'fantasy-editor.jieee.dev' > dist/CNAME",
"lint": "eslint --cache --ext .ts,.tsx ./src",
"lint:fix": "npm run lint -- --fix",
"pretty-quick": "pretty-quick",
"deploy": "gh-pages -d dist"
"deploy": "gh-pages -d dist -r git@github.com:lingjieee/fantasy-editor.git"
},
"sideEffects": [
"dist/*",
Expand Down
Empty file added scripts/build-doc.js
Empty file.

0 comments on commit 4e14e44

Please sign in to comment.