Buup - The Text Utility Belt
Buup is a versatile text transformation toolkit that provides a dependency-free core library for common text manipulations, with additional CLI and web interfaces.
| Dark Mode | Light Mode |
|---|---|
Architecture
|||
Key Features
- Zero Dependencies: The core
buuplibrary implements all transformations without external dependencies - Multiple Interfaces: CLI for terminal workflows and Web UI for interactive use
- Extensible Design: Easy to add new transformers by implementing the
Transformtrait - Strong Typing: Full type safety with comprehensive error handling
- Thread Safety: All transformers are designed to be safely used concurrently
Available Transformers
The following transformers are currently available in Buup:
|
Usage as a Library
// Add to your Cargo.toml:
// [dependencies]
// buup = { version = "0.1" }
use ;
// Option 1: Use a specific transformer struct
let encoded = Base64Encode.transform.unwrap;
println!; // SGVsbG8sIExpYnJhcnkh
// Option 2: Look up a transformer by its ID
let transformer = transformer_from_id.unwrap;
let decoded = transformer.transform.unwrap;
println!; // Hello, Library!
Interfaces
- CLI: Command-line interface for scripting and terminal workflows
- Web UI: Modern web interface built with Dioxus
Building From Source
# Clone the repository
# Build the entire workspace
# Run the CLI
# Serve the web UI (requires Dioxus CLI)
Contributing
Contributions are welcome! When adding new transformers or modifying code, please ensure:
- Zero external dependencies in the core
buuplibrary - Comprehensive tests covering functionality and edge cases
- Clear error handling using
TransformError - Run
cargo test --workspaceandcargo clippy --workspace -- -D warnings
Creating Custom Transformers
This guide shows how to create custom transformers for the buup system without modifying the core library.
Basic Structure
To create a custom transformer:
- Create a new struct that implements the
Transformtrait - Add the struct to the registry in
lib.rs
Step 1: Example Implementation
Here's a simple example of a custom transformer that reverses text:
use ;
/// Text Reverse transformer
;
Step 2: Add to Registry
In lib.rs, add your transformer to the register_builtin_transformers function:
Step 3: Export Your Transformer (Optional)
If your transformer will be used directly, add it to the exports in transformers/mod.rs:
// src/transformers/mod.rs
// ... other mods ...
// Your new module
pub use Base64Decode;
// ... other uses ...
pub use MyNewTransformer; // Your new transformer
Step 4: Add Inverse Support (Optional)
If your transformer has an inverse operation, update the inverse_transformer function in lib.rs:
Example: Creating Pairs of Transformers
If your transformer has a logical inverse (like encoding/decoding), you'll want to define both:
use ;
// Define the transformers
;
;
// Implement Transform for SnakeToCamel
// Implement Transform for CamelToSnake
// Then register both in lib.rs and define their inverse relationship
Tips for Creating Good Transformers
- Follow the naming convention of existing transformers
- Provide clear and concise descriptions
- Make sure your transformer is thread-safe (impl Sync+Send)
- Consider implementing pairs of transformers for inverse operations
- Add comprehensive tests for your transformer
Documentation Generation
To update the transformer list in this README after modifications: