Crates.io | titlecase |
lib.rs | titlecase |
version | 3.3.0 |
source | src |
created_at | 2017-06-19 10:55:41.602867 |
updated_at | 2024-07-12 09:34:03.873576 |
description | Capitalize text according to a style defined by John Gruber for Daring Fireball. |
homepage | |
repository | https://github.com/wezm/titlecase |
max_upload_size | |
id | 19494 |
size | 34,939 |
titlecase
is a small tool and library (crate) that capitalizes English text
according to a style defined by John Gruber for post titles on his
website Daring Fireball. titlecase
should run on all platforms supported
by Rust including Linux, macOS, FreeBSD, NetBSD, OpenBSD, and Windows.
titlecase
reads lines of text from stdin and prints title cased versions
to stdout.
% echo 'Being productive on linux' | titlecase
Being Productive on Linux
% echo 'Finding an alternative to Mac OS X — part 2' | titlecase
Finding an Alternative to Mac OS X — Part 2
% echo 'an example with small words and sub-phrases: "the example"' | titlecase
An Example With Small Words and Sub-Phrases: "The Example"
Pre-compiled binaries are available for some platforms, check the latest release.
If you have a stable Rust compiler toolchain installed you can
install the most recently released titlecase
with cargo:
cargo install titlecase
Minimum Supported Rust Version: 1.70.0
See the crate documentation.
wasm32-unknown-unknown
target
(rustup target add wasm32-unknown-unknown
or rust-wasm
package on Chimera Linux)wasm-bindgen
package on Arch, or cargo install wasm-bindgen-cli --version 0.2.92
)make
(GNU or BSD should work)There is a Makefile
that automates building for WebAssembly.
make
The output is put into a wasm
directory. See
https://github.com/wezm/7bit.org/tree/main/public/titlecase for an
example that uses the wasm build.
Instead of simply capitalizing each word titlecase
does the following
(amongst other things):
This tool makes use of prior work by John Gruber, Aristotle Pagaltzis, and David Gouch.