wezm / titlecase

A tool and Rust crate for transforming text into Title Case.
https://7bit.org/titlecase/
Other
88 stars 3 forks source link

Why only stdin #25

Closed bluedogtwo closed 2 days ago

bluedogtwo commented 1 week ago

Why not from argument. titlecase 'Being productive on linux'

wezm commented 1 week ago

Why not from argument.

stdin was the use case I had when I built the tool originally: to select text in vim and filter it through titlecase and no one has requested otherwise.

alerque commented 1 week ago

@bluedogtwo You can use my decasify create as a CLI four that usage. It handles either STDIN or arguments. The default English title casing is powerd by this crate so you should get the same output (with options for other languages, style guides, and other cases too).

bluedogtwo commented 1 week ago

@alerque aha, didn't know about that, thanks.

alerque commented 1 week ago

@wezm If your use case is VIM you might be interested in decasify too, but not the Rust crate version. It's also a LuaRock that exports the Rust casing functions to a Lua API. It's just a require() away if you install via luarocks. That would be really easy to integrate into VIM without needing to shell out. At least on NeoVIM this is trivial, although I'm considering also making a plugin specific to using it. The plugin would probably be NeoVIM only though. For VIM there is Lua support but it isn't first class and the plugin would need to be laid out a bit different.

wezm commented 1 week ago

That's quite neat. My requirements are pretty basic though, I just like to format headings and titles of blog posts so I just do V:!titlecase as needed.

alerque commented 1 week ago

Fair enough. And thanks again for this crate; as quite useful as a library to cover at least Daring Firefall's approach to English title casing.