-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rustne-kretser/cargo-publish
Prepare for publishing on crates.io
- Loading branch information
Showing
8 changed files
with
495 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [0.1.0] - 2022-03-14 | ||
|
||
- Initial release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
 | ||
[](https://crates.io/crates/noline) | ||
[](https://docs.rs/noline/) | ||
|
||
# noline | ||
|
||
Noline is an IO-agnostic `#[no_std]` line editor providing robust | ||
line editing for any system. The core functionality is IO-free, so | ||
it can be adapted to any system be it embedded, async, async | ||
embedded, WASM or IPoAC (IP over Avian Carriers). | ||
|
||
Features: | ||
- IO-free | ||
- Minimal dependencies | ||
- No allocation needed - Both heap-based and static buffers are provided | ||
- UTF-8 support | ||
- Emacs keybindings | ||
|
||
Possible future features: | ||
- Auto-completion and hints | ||
- Line history | ||
|
||
The API should be considered experimental and will change in the | ||
future. | ||
|
||
|
||
The core consists of a massive state machine taking bytes as input | ||
and returning an iterator over byte slices. There are, however, | ||
some convenience wrappers: | ||
- [`sync::Editor`] | ||
- [`sync::std::IO`] | ||
- [`sync::embedded::IO`] | ||
- [`no_sync::tokio::Editor`] | ||
|
||
## Example | ||
```rust | ||
use noline::sync::{std::IO, Editor}; | ||
use std::io; | ||
use std::fmt::Write; | ||
use termion::raw::IntoRawMode; | ||
|
||
fn main() { | ||
let mut stdin = io::stdin(); | ||
let mut stdout = io::stdout().into_raw_mode().unwrap(); | ||
let prompt = "> "; | ||
|
||
let mut io = IO::new(stdin, stdout); | ||
let mut editor = Editor::<Vec<u8>, _>::new(&mut io).unwrap(); | ||
|
||
loop { | ||
if let Ok(line) = editor.readline(prompt, &mut io) { | ||
write!(io, "Read: '{}'\n\r", line).unwrap(); | ||
} else { | ||
break; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
For more details, see [docs](https://docs.rs/noline/). | ||
|
||
# Usage | ||
|
||
Add this to your Cargo.toml: | ||
|
||
```toml | ||
[dependencies] | ||
noline = "0.1.0" | ||
``` | ||
|
||
# License | ||
|
||
MPL-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,17 @@ | |
name = "noline" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Eivind Alexander Bergem <[email protected]>"] | ||
license = "MPL-2.0" | ||
description = "A no_std line editor" | ||
repository = "https://github.com/rustne-kretser/noline" | ||
readme = "../README.md" | ||
categories = ["no-std", "command-line-interface"] | ||
keywords = ["no_std", "readline"] | ||
include = [ | ||
"**/*.rs", | ||
"Cargo.toml", | ||
] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
 | ||
[](https://crates.io/crates/noline) | ||
[](https://docs.rs/noline/) | ||
|
||
# {{crate}} | ||
|
||
{{readme}} | ||
|
||
For more details, see [docs](https://docs.rs/noline/). | ||
|
||
# Usage | ||
|
||
Add this to your Cargo.toml: | ||
|
||
```toml | ||
[dependencies] | ||
noline = "{{version}}" | ||
``` | ||
|
||
# License | ||
|
||
{{license}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters