jj/cli
Yuya Nishihara 009284736d templater: add pad/truncate functions
As I said in the preceding patch, I settled on separate pad/truncate functions
instead of a function taking multiple optional parameters. It's less efficient
to process truncation and padding independently, but I don't think that would
matter.

The order of arguments follows the current f(..., content) convention. We can
also add a method syntax, but I'm not sure if it's useful. In order to call a
method of Template type, we'll need to coerce printable object to Template:

  concat(author.email()).truncate_end(10).pad_end(10)
  ^^^^^^
  String -> Template

FWIW, String type could provide more efficient truncate/pad methods.

Closes #3183
2024-10-21 08:47:08 +09:00
..
examples revset: allow iterators to return evaluation errors 2024-10-18 17:09:35 -04:00
src templater: add pad/truncate functions 2024-10-21 08:47:08 +09:00
testing style: inline variables into format strings 2024-10-04 22:29:13 +02:00
tests templates: Timestamp: add after, before methods 2024-10-16 13:46:06 +08:00
build.rs style: inline variables into format strings 2024-10-04 22:29:13 +02:00
Cargo.toml cargo: inherit lints configuration from workspace 2024-10-04 22:29:13 +02:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00