-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add README for pim CLI tool documentation
- Loading branch information
1 parent
235165e
commit 8d3f1e7
Showing
1 changed file
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<div align="center"> | ||
<samp> | ||
|
||
# pim | ||
|
||
## a lightweight and extensible CLI tool for converting between various CSS-related units (e.g., "px", "em", "rem"). | ||
|
||
</samp> | ||
</div> | ||
|
||
![Rust](https://img.shields.io/badge/Rust-1.72.0-orange) | ||
![License](https://img.shields.io/badge/license-MIT-blue.svg) | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
### Build from Source | ||
|
||
1. **Clone the repository**: | ||
```bash | ||
git clone https://github.com/airRnot1106/pim.git | ||
cd pim | ||
``` | ||
|
||
2. **Build the binary**: | ||
```bash | ||
cargo build --release | ||
``` | ||
|
||
3. **Run the tool**: | ||
```bash | ||
./target/release/pim --help | ||
``` | ||
|
||
### Using `nix` | ||
|
||
If you have `nix` installed: | ||
```bash | ||
nix run . -- --help | ||
``` | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
### Basic Usage | ||
|
||
To convert `24px` to other unit: | ||
```bash | ||
pim 24 px | ||
``` | ||
|
||
**Output**: | ||
``` | ||
px: 24px | ||
em: 1.5em | ||
rem: 1.5rem | ||
``` | ||
|
||
### Custom Root Font Size | ||
|
||
Specify a custom root font size using the `-r` option: | ||
```bash | ||
pim 24 px -r 10 | ||
``` | ||
|
||
**Output**: | ||
``` | ||
px: 24px | ||
em: 2.4em | ||
rem: 2.4rem | ||
``` | ||
|
||
## Tests | ||
|
||
Run all tests: | ||
```bash | ||
cargo test | ||
``` | ||
|
||
--- | ||
|
||
## License | ||
|
||
`pim` is licensed under the [MIT License](https://github.com/airRnot1106/pim/blob/main/LICENSE). |