-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added array containing all
blocks
#3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
Unicode Blocks | ||
==================== | ||
# `unicode-blocks` | ||
|
||
[![CI](https://github.com/magiclen/unicode-blocks/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/unicode-blocks/actions/workflows/ci.yml) | ||
[![Documentation](https://docs.rs/unicode-blocks/badge.svg)](https://docs.rs/unicode-blocks) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not used to using this badge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Most users are though. If you look at the average popular crate updated in the last two years on The latter two are for people coming to/accrorss the crate via the repo and not via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, I will think about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if shields.io is trustworthy. Displaying their badges might be promoting their services. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. |
||
[![Crate](https://img.shields.io/crates/v/unicode-blocks.svg)](https://crates.io/crates/unicode-blocks) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not used to using this badge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
|
||
This crate contains a list of all unicode blocks and provides some functions to search across them. | ||
|
||
## Features | ||
|
||
* `all` – Include an array that contains references to all unicode blocks. | ||
|
||
As this takes quite a bit of memory (approx 2.6k on a 64bit system) this is | ||
turned off by default. | ||
|
||
## Examples | ||
|
||
#### Given a character, determine what unicode block contains it. | ||
|
||
```rust | ||
assert_eq!(unicode_blocks::BASIC_LATIN, unicode_blocks::find_unicode_block('A').unwrap()); | ||
assert_eq!( | ||
unicode_blocks::BASIC_LATIN, | ||
unicode_blocks::find_unicode_block('A').unwrap() | ||
); | ||
``` | ||
|
||
#### Given a unicode block, determine whether it is used in CJK. | ||
|
||
```rust | ||
assert!(unicode_blocks::is_cjk_block(unicode_blocks::CJK_UNIFIED_IDEOGRAPHS)); | ||
assert!( | ||
unicode_blocks::is_cjk_block(unicode_blocks::CJK_UNIFIED_IDEOGRAPHS) | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to use line breaks? |
||
``` | ||
|
||
#### Given a character, determine whether it is in CJK. | ||
|
@@ -25,14 +38,6 @@ assert!(unicode_blocks::is_cjk_block(unicode_blocks::CJK_UNIFIED_IDEOGRAPHS)); | |
assert!(unicode_blocks::is_cjk('。')); | ||
``` | ||
|
||
## Crates.io | ||
|
||
https://crates.io/crates/unicode-blocks | ||
|
||
## Documentation | ||
|
||
https://docs.rs/unicode-blocks | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All my crates on crates.io have them in |
||
## License | ||
|
||
[MIT](LICENSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed.