Skip to content

Commit b1d202b

Browse files
committed
strs_tools : better readme
1 parent 451c5c7 commit b1d202b

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

module/core/strs_tools/Readme.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<!-- {{# generate.module_header{} #}} -->
21

2+
<!-- {{# generate.module_header{} #}} -->
33
# Module :: `strs_tools`
44
<!--{ generate.module_header.start() }-->
55
[![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_strs_tools_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_strs_tools_push.yml) [![docs.rs](https://img.shields.io/docsrs/strs_tools?color=e3e8f0&logo=docs.rs)](https://docs.rs/strs_tools) [![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fstrs_tools%2Fexamples%2Fstrs_tools_trivial.rs,RUN_POSTFIX=--example%20module%2Fcore%2Fstrs_tools%2Fexamples%2Fstrs_tools_trivial.rs/https://github.com/Wandalen/wTools) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
@@ -12,7 +12,7 @@ Tools to manipulate strings.
1212
<!-- {{# generate.module{} #}} -->
1313

1414
```rust
15-
#[ cfg( all( feature = "split", not( feature = "no_std" ) ) ) ]
15+
#[ cfg( all( feature = "string_split", not( feature = "no_std" ) ) ) ]
1616
{
1717
/* delimeter exists */
1818
let src = "abc def";
@@ -21,7 +21,7 @@ Tools to manipulate strings.
2121
.delimeter( " " )
2222
.stripping( false )
2323
.perform();
24-
let iterated = iter.map( | e | String::from( e ) ).collect::< Vec< _ > >();
24+
let iterated = iter.map( | e | String::from( e.string ) ).collect::< Vec< _ > >();
2525
assert_eq!( iterated, vec![ "abc", " ", "def" ] );
2626

2727
/* delimeter not exists */
@@ -30,7 +30,7 @@ Tools to manipulate strings.
3030
.src( src )
3131
.delimeter( "g" )
3232
.perform();
33-
let iterated = iter.map( | e | String::from( e ) ).collect::< Vec< _ > >();
33+
let iterated = iter.map( | e | String::from( e.string ) ).collect::< Vec< _ > >();
3434
assert_eq!( iterated, vec![ "abc def" ] );
3535
}
3636
```
@@ -41,17 +41,28 @@ Tools to manipulate strings.
4141
cargo add strs_tools
4242
```
4343

44+
### Features
45+
46+
This crate uses a feature-based system to allow you to include only the functionality you need. Key features include:
47+
48+
* `string_indentation`: Tools for adding indentation to lines of text.
49+
* `string_isolate`: Functions to isolate parts of a string based on delimiters.
50+
* `string_parse_request`: Utilities for parsing command-like strings with subjects and key-value parameters.
51+
* `string_parse_number`: Functions for parsing numerical values from strings.
52+
* `string_split`: Advanced string splitting capabilities with various options for delimiters, quoting, and segment preservation.
53+
54+
You can enable features in your `Cargo.toml` file, for example:
55+
```toml
56+
[dependencies.strs_tools]
57+
version = "0.18.0" # Or your desired version
58+
features = [ "string_split", "string_indentation" ]
59+
```
60+
The `default` feature enables a common set of functionalities. The `full` feature enables all available string utilities. Refer to the `Cargo.toml` for a complete list of features and their dependencies.
61+
4462
### Try out from the repository
4563

4664
```sh
4765
git clone https://github.com/Wandalen/wTools
48-
cd wTools
49-
cd examples/wstring_tools_trivial
50-
cargo run
66+
cd wTools/module/core/strs_tools
67+
cargo run --example strs_tools_trivial
5168
```
52-
53-
# Sample
54-
55-
[![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
56-
[![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=eee)](https://gitpod.io/#RUN_PATH=sample%2Frust%2Fstrs_tools_trivial,SAMPLE_FILE=.%2Fsrc%2Fmain.rs/https://github.com/Wandalen/wTools)
57-
[![docs.rs](https://raster.shields.io/static/v1?label=docs&message=online&color=eee&logo=docsdotrs&logoColor=eee)](https://docs.rs/strs_tools)

0 commit comments

Comments
 (0)