Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MegatronKing committed Feb 5, 2024
1 parent 16eb68a commit a1f3462
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"version": "0.2.0",
"configurations": [
{
"name": "reqable-editor",
"name": "re-editor",
"request": "launch",
"type": "dart"
},
{
"name": "reqable-editor (profile mode)",
"name": "re-editor (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "reqable-editor (release mode)",
"name": "re-editor (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1

* First Release Version

## 0.0.2

* Update pubspec.yaml and README
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[中文版本](./README_CN.md)

`Re-Editor` is a powerful lightweight code editor component and a module in the [Reqable](https://reqable.com) project. It can be used as a simple text component or to develop a code editor with complex functions. Unlike Flutter's default `TextField` component, `Re-Editor` is specifically tailored for the display and input of multi-line text and offers the following features:
`Re-Editor` is a powerful lightweight text and code editor widget and a module in the [Reqable](https://reqable.com) project. It can be used as a simple text area or to develop a code editor with complex functions. Unlike Flutter's default `TextField` component, `Re-Editor` is specifically tailored for the display and input of multi-line text and offers the following features:

- Two-way horizontal and vertical scrolling.
- Text syntax highlighting.
Expand All @@ -21,19 +21,15 @@

`Re-Editor` offers a high degree of freedom. For example, developers can control whether to enable horizontal scrolling (word wrap), enable read-only mode, display line numbers, display content folding, define custom shortcut keys, and specify text syntax highlighting.

`Re-Editor` has been extensively practiced in the [Reqable](https://reqable.com) project. You are welcome to download [Reqable](https://reqable.com/download) to experience it.

![](arts/art01.png)

You can also run the `example` project to experience it.
You can run the `example` project to experience it.

## Getting Started

Add the followings in `pubspec.yaml`.

```yaml
dependencies:
re_editor: ^0.0.1
re_editor: ^0.0.2
```
Like `TextField`, `Re-Editor` uses `CodeLineEditingController` as the controller. The following sample code creates the simplest editor component, which is not much different from `TextField`.
Expand All @@ -48,7 +44,7 @@ Widget build(BuildContext context) {

### Text Syntax Highlighting

The text highlighting of `Re-Editor` is based on [Re-Highlight](https://github.com/reqable/reqable-highlight) and supports nearly a hundred languages ​​and theme styles. Developers can freely choose and configure the code Highlight. The following code specifies the `JSON` syntax highlighting rules and applies the `Atom One Light` code coloring.
The text highlighting of `Re-Editor` is based on [Re-Highlight](https://github.com/reqable/re-highlight) and supports nearly a hundred languages ​​and theme styles. Developers can freely choose and configure the code Highlight. The following code specifies the `JSON` syntax highlighting rules and applies the `Atom One Light` code coloring.

```dart
CodeEditor(
Expand Down Expand Up @@ -186,6 +182,12 @@ CodeAutocomplete(

Note that `Re-Editor` is only a lightweight editor and does not have the IDE dynamic syntax analysis, so the code prompts and completion have many limitations. You can refer to the code in `example` to implement a simple code prompt and completion.

## Used By

`Re-Editor` has been extensively practiced in the Reqable project. You are welcome to download [Reqable](https://reqable.com/download) to experience it.

![](arts/art01.png)

## License

MIT License
Expand Down
18 changes: 10 additions & 8 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![latest version](https://img.shields.io/pub/v/re_editor.svg?color=blue)](https://pub.dev/packages/re_editor)

`Re-Editor`是一个强大的轻量级代码编辑器组件,是[Reqable](https://reqable.com)项目中的一个模块。`Re-Editor`既可以作为一个简单文本组件,也可以用来开发一个功能复杂的代码编辑器。和Flutter官方默认的`TextField`组件不一样的是,`Re-Editor`是专为多行文本的显示和输入量身定制,具备下面这些特性:
`Re-Editor`是一个强大的轻量级文本和代码编辑器组件,是[Reqable](https://reqable.com)项目中的一个模块。`Re-Editor`既可以作为一个简单文本输入组件,也可以用来开发一个功能复杂的代码编辑器。和Flutter官方默认的`TextField`组件不一样的是,`Re-Editor`是专为多行文本的显示和输入量身定制,具备下面这些特性:

- 横向和纵向双向滚动。
- 文本语法高亮。
Expand All @@ -19,21 +19,17 @@

`Re-Editor`提供了非常大的自由度,例如开发者可以控制是否横行滚动(Word Wrap),是否只读,是否显示行号,是否显示分析内容折叠,自定义快捷键,指定文本高亮语法等等。

## 实现范例

`Re-Editor`[Reqable](https://reqable.com) 项目中有着深度实践,欢迎下载 [Reqable](https://reqable.com/download) 进行体验。
您可以运行`example`项目进行体验各项功能。

![](arts/art01.png)

您也可以运行`example`项目进行体验。

## 开始使用

添加依赖到 `pubspec.yaml`.

```yaml
dependencies:
re_editor: ^0.0.1
re_editor: ^0.0.2
```
`TextField`一样,`Re-Editor`使用`CodeLineEditingController`作为控制器,下面的示例代码创建了一个最简单的编辑器组件,在显示样式上和`TextField`并没有什么太大的区别。
Expand All @@ -47,7 +43,7 @@ Widget build(BuildContext context) {

### 文本高亮

`Re-Editor`的文本高亮是基于[Re-Highlight](https://github.com/reqable/reqable-highlight)实现,支持近百种语言和主题样式,开发者可以自由选择并配置代码高亮。下面的代码就指定了`JSON`语法高亮规则以及应用了`Atom One Light`代码配色。
`Re-Editor`的文本高亮是基于[Re-Highlight](https://github.com/reqable/re-highlight)实现,支持近百种语言和主题样式,开发者可以自由选择并配置代码高亮。下面的代码就指定了`JSON`语法高亮规则以及应用了`Atom One Light`代码配色。
```dart
CodeEditor(
style: CodeEditorStyle(
Expand Down Expand Up @@ -182,6 +178,12 @@ CodeAutocomplete(

注意,`Re-Editor`只是一个轻量级的编辑器,不具备IDE动态语法分析功能,因此代码提示和补全功能存在较多的局限性。您可以参考`example`中的代码实现一个简单的代码提示和补全功能。

## 实现范例

`Re-Editor`在Reqable项目中有着深度实践,欢迎下载 [Reqable](https://reqable.com/download) 进行体验。

![](arts/art01.png)

## 许可证

MIT License
Expand Down
2 changes: 1 addition & 1 deletion lib/src/code_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of re_editor;
/// Re-Highlight provides some built-in syntax highlighting rules for dozens of programming languages,
/// and many theme styles.
///
/// Please see [Re-Highlight](https://reqable/reqable-highlight).
/// Please see [Re-Highlight](https://reqable/re-highlight).
class CodeHighlightTheme {

const CodeHighlightTheme({
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: re_editor
description: Re-Editor is a powerful lightweight text and code editor component.
version: 0.0.1
description: Re-Editor is a powerful lightweight text and code editor widget.
version: 0.0.2
homepage: https://reqable.com
repository: https://github.com/reqable/reqable-editor
repository: https://github.com/reqable/re-editor

environment:
sdk: ">=2.17.3 <4.0.0"
Expand Down

0 comments on commit a1f3462

Please sign in to comment.