From 959be7701242a5785dac9e42ac15c35f980c9937 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 16 Apr 2023 23:26:15 +0900 Subject: [PATCH] describe updated your own backend support in readme --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 741a757..a50b2d1 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,10 @@ tui-textarea = { version = "*", default-features = false, features = ["termion"] If you're using [ratatui][] instead of [tui-rs][], you need to enable features for using ratatui crate. The following table shows feature names corresponding to the dependencies. -| | crossterm | termion | -|---------|----------------------------------|-------------------| -| tui-rs | `crossterm` (enabled by default) | `termion` | -| ratatui | `ratatui-crossterm` | `ratatui-termion` | +| | crossterm | termion | Your own backend | +|---------|----------------------------------|-------------------|------------------------| +| tui-rs | `crossterm` (enabled by default) | `termion` | `your-backend` | +| ratatui | `ratatui-crossterm` | `ratatui-termion` | `ratatui-your-backend` | For example, when you want to use the combination of [ratatui][] and [crossterm][], @@ -529,12 +529,13 @@ match read()?.into() { ### Use your own backend tui-rs allows to make your own backend by implementing [`tui::backend::Backend`][tui-backend] trait. tui-textarea also -supports it. In the case, support for neither crossterm nor termion is necessary. +supports it. In this case, please use `your-backend` feature for [tui-rs][] or `ratatui-your-backend` feature for +[ratatui][]. They avoid adding backend crates (crossterm and termion) since you're using your own backend. ```toml [dependencies] tui = { version = "*", default-features = false } -tui-textarea = { version = "*", default-features = false } +tui-textarea = { version = "*", default-features = false, features = ["your-backend"] } ``` `tui_textarea::Input` is a type for backend-agnostic key input. What you need to do is converting key event in your own