decasify 0.7.6__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,9 +37,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
37
37
 
38
38
  [[package]]
39
39
  name = "anstream"
40
- version = "0.6.15"
40
+ version = "0.6.17"
41
41
  source = "registry+https://github.com/rust-lang/crates.io-index"
42
- checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
42
+ checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338"
43
43
  dependencies = [
44
44
  "anstyle",
45
45
  "anstyle-parse",
@@ -52,36 +52,36 @@ dependencies = [
52
52
 
53
53
  [[package]]
54
54
  name = "anstyle"
55
- version = "1.0.8"
55
+ version = "1.0.9"
56
56
  source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
57
+ checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56"
58
58
 
59
59
  [[package]]
60
60
  name = "anstyle-parse"
61
- version = "0.2.5"
61
+ version = "0.2.6"
62
62
  source = "registry+https://github.com/rust-lang/crates.io-index"
63
- checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
63
+ checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
64
64
  dependencies = [
65
65
  "utf8parse",
66
66
  ]
67
67
 
68
68
  [[package]]
69
69
  name = "anstyle-query"
70
- version = "1.1.1"
70
+ version = "1.1.2"
71
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
- checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
72
+ checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
73
73
  dependencies = [
74
- "windows-sys 0.52.0",
74
+ "windows-sys 0.59.0",
75
75
  ]
76
76
 
77
77
  [[package]]
78
78
  name = "anstyle-wincon"
79
- version = "3.0.4"
79
+ version = "3.0.6"
80
80
  source = "registry+https://github.com/rust-lang/crates.io-index"
81
- checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
81
+ checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125"
82
82
  dependencies = [
83
83
  "anstyle",
84
- "windows-sys 0.52.0",
84
+ "windows-sys 0.59.0",
85
85
  ]
86
86
 
87
87
  [[package]]
@@ -213,9 +213,9 @@ dependencies = [
213
213
 
214
214
  [[package]]
215
215
  name = "clap_complete"
216
- version = "4.5.33"
216
+ version = "4.5.35"
217
217
  source = "registry+https://github.com/rust-lang/crates.io-index"
218
- checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb"
218
+ checksum = "07a13ab5b8cb13dbe35e68b83f6c12f9293b2f601797b71bc9f23befdb329feb"
219
219
  dependencies = [
220
220
  "clap",
221
221
  ]
@@ -256,9 +256,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59"
256
256
 
257
257
  [[package]]
258
258
  name = "colorchoice"
259
- version = "1.0.2"
259
+ version = "1.0.3"
260
260
  source = "registry+https://github.com/rust-lang/crates.io-index"
261
- checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
261
+ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
262
262
 
263
263
  [[package]]
264
264
  name = "crc32fast"
@@ -306,7 +306,7 @@ dependencies = [
306
306
 
307
307
  [[package]]
308
308
  name = "decasify"
309
- version = "0.7.6"
309
+ version = "0.9.0"
310
310
  dependencies = [
311
311
  "anyhow",
312
312
  "assert_cmd",
@@ -317,6 +317,7 @@ dependencies = [
317
317
  "predicates",
318
318
  "pyo3",
319
319
  "regex",
320
+ "snafu",
320
321
  "strum",
321
322
  "strum_macros",
322
323
  "titlecase",
@@ -383,6 +384,12 @@ version = "1.0.5"
383
384
  source = "registry+https://github.com/rust-lang/crates.io-index"
384
385
  checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
385
386
 
387
+ [[package]]
388
+ name = "either"
389
+ version = "1.13.0"
390
+ source = "registry+https://github.com/rust-lang/crates.io-index"
391
+ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
392
+
386
393
  [[package]]
387
394
  name = "errno"
388
395
  version = "0.3.9"
@@ -1103,23 +1110,24 @@ dependencies = [
1103
1110
 
1104
1111
  [[package]]
1105
1112
  name = "mlua"
1106
- version = "0.9.9"
1113
+ version = "0.10.0"
1107
1114
  source = "registry+https://github.com/rust-lang/crates.io-index"
1108
- checksum = "d111deb18a9c9bd33e1541309f4742523bfab01d276bfa9a27519f6de9c11dc7"
1115
+ checksum = "0f6ddbd668297c46be4bdea6c599dcc1f001a129586272d53170b7ac0a62961e"
1109
1116
  dependencies = [
1110
1117
  "bstr",
1118
+ "either",
1111
1119
  "mlua-sys",
1112
1120
  "mlua_derive",
1113
1121
  "num-traits",
1114
- "once_cell",
1122
+ "parking_lot",
1115
1123
  "rustc-hash",
1116
1124
  ]
1117
1125
 
1118
1126
  [[package]]
1119
1127
  name = "mlua-sys"
1120
- version = "0.6.3"
1128
+ version = "0.6.4"
1121
1129
  source = "registry+https://github.com/rust-lang/crates.io-index"
1122
- checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8"
1130
+ checksum = "e9eebac25c35a13285456c88ee2fde93d9aee8bcfdaf03f9d6d12be3391351ec"
1123
1131
  dependencies = [
1124
1132
  "cc",
1125
1133
  "cfg-if",
@@ -1128,9 +1136,9 @@ dependencies = [
1128
1136
 
1129
1137
  [[package]]
1130
1138
  name = "mlua_derive"
1131
- version = "0.9.3"
1139
+ version = "0.10.0"
1132
1140
  source = "registry+https://github.com/rust-lang/crates.io-index"
1133
- checksum = "09697a6cec88e7f58a02c7ab5c18c611c6907c8654613df9cc0192658a4fb859"
1141
+ checksum = "2cfc5faa2e0d044b3f5f0879be2920e0a711c97744c42cf1c295cb183668933e"
1134
1142
  dependencies = [
1135
1143
  "proc-macro2",
1136
1144
  "quote",
@@ -1348,9 +1356,9 @@ dependencies = [
1348
1356
 
1349
1357
  [[package]]
1350
1358
  name = "regex"
1351
- version = "1.11.0"
1359
+ version = "1.11.1"
1352
1360
  source = "registry+https://github.com/rust-lang/crates.io-index"
1353
- checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
1361
+ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
1354
1362
  dependencies = [
1355
1363
  "aho-corasick",
1356
1364
  "memchr",
@@ -1514,6 +1522,27 @@ version = "1.13.2"
1514
1522
  source = "registry+https://github.com/rust-lang/crates.io-index"
1515
1523
  checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
1516
1524
 
1525
+ [[package]]
1526
+ name = "snafu"
1527
+ version = "0.8.5"
1528
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1529
+ checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019"
1530
+ dependencies = [
1531
+ "snafu-derive",
1532
+ ]
1533
+
1534
+ [[package]]
1535
+ name = "snafu-derive"
1536
+ version = "0.8.5"
1537
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1538
+ checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917"
1539
+ dependencies = [
1540
+ "heck",
1541
+ "proc-macro2",
1542
+ "quote",
1543
+ "syn",
1544
+ ]
1545
+
1517
1546
  [[package]]
1518
1547
  name = "strsim"
1519
1548
  version = "0.11.1"
@@ -1541,9 +1570,9 @@ dependencies = [
1541
1570
 
1542
1571
  [[package]]
1543
1572
  name = "syn"
1544
- version = "2.0.82"
1573
+ version = "2.0.85"
1545
1574
  source = "registry+https://github.com/rust-lang/crates.io-index"
1546
- checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
1575
+ checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56"
1547
1576
  dependencies = [
1548
1577
  "proc-macro2",
1549
1578
  "quote",
@@ -1662,6 +1691,15 @@ dependencies = [
1662
1691
  "regex",
1663
1692
  ]
1664
1693
 
1694
+ [[package]]
1695
+ name = "typst"
1696
+ version = "0.9.0"
1697
+ dependencies = [
1698
+ "anyhow",
1699
+ "decasify",
1700
+ "wasm-minimal-protocol",
1701
+ ]
1702
+
1665
1703
  [[package]]
1666
1704
  name = "unicode-bidi"
1667
1705
  version = "0.3.17"
@@ -1718,6 +1756,16 @@ version = "0.2.2"
1718
1756
  source = "registry+https://github.com/rust-lang/crates.io-index"
1719
1757
  checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
1720
1758
 
1759
+ [[package]]
1760
+ name = "venial"
1761
+ version = "0.5.0"
1762
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1763
+ checksum = "61584a325b16f97b5b25fcc852eb9550843a251057a5e3e5992d2376f3df4bb2"
1764
+ dependencies = [
1765
+ "proc-macro2",
1766
+ "quote",
1767
+ ]
1768
+
1721
1769
  [[package]]
1722
1770
  name = "vergen"
1723
1771
  version = "9.0.1"
@@ -1840,6 +1888,17 @@ version = "0.2.95"
1840
1888
  source = "registry+https://github.com/rust-lang/crates.io-index"
1841
1889
  checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
1842
1890
 
1891
+ [[package]]
1892
+ name = "wasm-minimal-protocol"
1893
+ version = "0.1.0"
1894
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1895
+ checksum = "264a7e0acbdd292aca03fee87eaea5a07647394c8985b19be27e950bde57930a"
1896
+ dependencies = [
1897
+ "proc-macro2",
1898
+ "quote",
1899
+ "venial",
1900
+ ]
1901
+
1843
1902
  [[package]]
1844
1903
  name = "winapi-util"
1845
1904
  version = "0.1.9"
@@ -0,0 +1,173 @@
1
+ [package]
2
+ name = "decasify"
3
+ version = "0.9.0"
4
+ description = "A CLI utility and library to cast strings to title-case according to locale specific style guides including Turkish support"
5
+ readme = "README.md"
6
+ build = "build-aux/build.rs"
7
+ include = ["*.rs"]
8
+ edition.workspace = true
9
+ rust-version.workspace = true
10
+ authors.workspace = true
11
+ homepage.workspace = true
12
+ repository.workspace = true
13
+ license.workspace = true
14
+
15
+ [workspace.package]
16
+ version = "0.9.0"
17
+ authors = ["Caleb Maclennan <caleb@alerque.com>"]
18
+ homepage = "https://github.com/alerque/decasify"
19
+ repository = "https://github.com/alerque/decasify"
20
+ license = "LGPL-3.0-only"
21
+ edition = "2021"
22
+ rust-version = "1.73.0"
23
+
24
+ [workspace]
25
+ resolver = "2"
26
+
27
+ [[bin]]
28
+ name = "decasify"
29
+ required-features = ["cli"]
30
+
31
+ [lib]
32
+ name = "decasify"
33
+ crate-type = ["rlib", "cdylib"]
34
+
35
+ [profile.release]
36
+ lto = true
37
+
38
+ [profile.typst]
39
+ inherits = "release"
40
+ opt-level = "z"
41
+ strip = true
42
+
43
+ [features]
44
+ default = []
45
+ full = ["cli", "bash", "elvish", "fish", "manpage", "powershell", "zsh"]
46
+ modules = ["luamodule", "pythonmodule", "wasm"]
47
+ completions = ["cli", "dep:clap_complete"]
48
+ cli = ["dep:clap"]
49
+ bash = ["completions"]
50
+ elvish = ["completions"]
51
+ fish = ["completions"]
52
+ manpage = ["dep:clap_mangen"]
53
+ powershell = ["completions"]
54
+ zsh = ["completions"]
55
+ luamodule = ["mlua"]
56
+ lua54 = ["luamodule", "mlua/lua54"]
57
+ lua53 = ["luamodule", "mlua/lua53"]
58
+ lua52 = ["luamodule", "mlua/lua52"]
59
+ lua51 = ["luamodule", "mlua/lua51"]
60
+ luajit = ["luamodule", "mlua/luajit"]
61
+ pythonmodule = ["dep:pyo3"]
62
+ unstable-trait = []
63
+ wasm = ["dep:wasm-bindgen"]
64
+
65
+ [workspace.dependencies.decasify]
66
+ path = "."
67
+ version = "0.9.0"
68
+
69
+ [dependencies]
70
+ regex = "1.11"
71
+ snafu = "0.8"
72
+ strum = "0.26"
73
+ strum_macros = "0.26"
74
+ unicode_titlecase = "2.4"
75
+
76
+ [dependencies.clap]
77
+ version = "4.5"
78
+ optional = true
79
+ features = ["derive", "wrap_help"]
80
+
81
+ [dependencies.mlua]
82
+ version = "0.10.0"
83
+ optional = true
84
+ features = ["module"]
85
+
86
+ [dependencies.pyo3]
87
+ version = "0.22"
88
+ optional = true
89
+ features = ["extension-module"]
90
+
91
+ [dependencies.titlecase]
92
+ version = "3.3"
93
+ features = ["perf"]
94
+
95
+ [dependencies.wasm-bindgen]
96
+ version = "0.2"
97
+ optional = true
98
+
99
+ [build-dependencies]
100
+ snafu = "0.8"
101
+ strum = "0.26"
102
+ strum_macros = "0.26"
103
+
104
+ [build-dependencies.clap_complete]
105
+ version = "4.5"
106
+ optional = true
107
+
108
+ [build-dependencies.clap_mangen]
109
+ version = "0.2"
110
+ optional = true
111
+
112
+ [build-dependencies.clap]
113
+ version = "4.5"
114
+ optional = true
115
+ features = ["derive"]
116
+
117
+ [build-dependencies.anyhow]
118
+ version = "1.0"
119
+
120
+ [build-dependencies.vergen-gix]
121
+ version = "1.0"
122
+ default-features = false
123
+ features = ["build", "cargo", "rustc"]
124
+
125
+ [dev-dependencies]
126
+ assert_cmd = "2.0"
127
+ predicates = "3.1"
128
+
129
+ [lints.rust]
130
+ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(build)'] }
131
+
132
+ [package.metadata.bacon]
133
+ default_job = "build"
134
+
135
+ [package.metadata.bacon.jobs.build]
136
+ command = ["cargo", "build", "--features", "full", "--color", "always"]
137
+
138
+ [package.metadata.bacon.jobs.build-modules]
139
+ command = [
140
+ "cargo",
141
+ "build",
142
+ "--features",
143
+ "modules,luajit",
144
+ "--color",
145
+ "always",
146
+ ]
147
+
148
+ [package.metadata.docs.rs]
149
+ features = ["luamodule", "luajit", "pythonmodule", "wasm", "unstable-trait"]
150
+ rustdoc-args = ["--cfg", "docsrs"]
151
+
152
+ [package.metadata.git-cliff.git]
153
+ protect_breaking_commits = true
154
+ commit_parsers = [
155
+ { message = "^feat", group = "<!-- 0 -->Features" },
156
+ { message = "^fix", group = "<!-- 1 -->Bug Fixes" },
157
+ { message = "^perf", group = "<!-- 2 -->Performance" },
158
+ { message = ".*", skip = true },
159
+ ]
160
+ commit_preprocessors = [
161
+ { pattern = '.*', replace_command = 'typos --quiet --write-changes -' },
162
+ ]
163
+
164
+ [package.metadata.typos.default]
165
+ locale = "en-us"
166
+ extend-ignore-identifiers-re = ["[bB][aA][zZ]"]
167
+
168
+ [package.metadata.typos.default.extend-words]
169
+ runing = "running"
170
+
171
+ [package.metadata.typos.files]
172
+ ignore-hidden = false
173
+ extend-exclude = ["/.git"]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: decasify
3
- Version: 0.7.6
3
+ Version: 0.9.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Natural Language :: English
@@ -33,7 +33,7 @@ Project-URL: Source Code, https://github.com/alerque/decasify
33
33
  [![PyPi (latest)](https://img.shields.io/pypi/v/decasify?logo=python&color=blue)](https://pypi.org/project/decasify)
34
34
  [![NPM Version](https://img.shields.io/npm/v/decasify?logo=npm&color=blue)](https://www.npmjs.com/package/decasify)
35
35
 
36
- A CLI utility, Rust crate, Lua rock, Python module, JavaScript module, Neovim plugin, and SILE package to cast strings to title-case (and other cases) according to locale specific style guides including Turkish support.
36
+ A CLI utility, Rust crate, Lua rock, Python module, JavaScript module, Neovim plugin, SILE package, and Typst package to cast strings to title-case (and other cases) according to locale specific style guides including Turkish support.
37
37
 
38
38
  This project was born out of frustration with authors and editors leaving ALL CAPS TITLES in Markdown sources.
39
39
  No tooling I could find properly supported casting these to title-cased strings (which are more versatile for typesetting purposes).
@@ -47,22 +47,13 @@ Where possible the APIs currently default to English rules and (for English) the
47
47
 
48
48
  The Turkish style follows the Turkish Language Institute's [guidelines][tdk].
49
49
 
50
- For English, three style guides are known: Associated Press (AP), Chicago Manual of Style (CMOS), and John Grubber's Daring Fireball (Gruber).
50
+ For English, three style guides are known: Associated Press (AP), Chicago Manual of Style (CMOS), and John Gruber's Daring Fireball (Gruber).
51
51
  The Gruber style is by far the most complete, being implemented by the [titlecase crate][titlecase_crate].
52
52
  The CMOS style handles a number of parts of speech but has punctuation related issues.
53
53
  The AP style is largely unimplemented.
54
54
 
55
55
  Contributions are welcome for better style guide support or further languages.
56
56
 
57
- ``` console
58
- $ decasify -l tr ILIK SU VE İTEN RÜZGARLAR
59
- Ilık Su ve İten Rüzgarlar
60
- $ echo ILIK SU VE İTEN RÜZGARLAR | decasify -l tr
61
- Ilık Su ve İten Rüzgarlar
62
- $ echo foo BAR AND baz: an alter ego | decasify -l en -s gruber
63
- Foo BAR and Baz: An Alter Ego
64
- ```
65
-
66
57
  [tdk]: https://tdk.gov.tr/icerik/yazim-kurallari/buyuk-harflerin-kullanildigi-yerler/
67
58
  [titlecase_crate]: https://crates.io/crates/titlecase
68
59
 
@@ -70,27 +61,24 @@ Foo BAR and Baz: An Alter Ego
70
61
 
71
62
  Use of the CLI is pretty simple.
72
63
  Input may be either shell arguments or STDIN.
64
+ Arguments can control the various options.
65
+ For full usage information check `decasify --help` or `man decasify`.
73
66
 
74
- ```console
75
- $ decasify --help
76
- A CLI tool to convert all-caps strings to title-case or other less aggressive tones that supports
77
- Turkish input
78
-
79
- Usage: decasify [OPTIONS] [INPUT]...
80
-
81
- Arguments:
82
- [INPUT]... Input string
83
-
84
- Options:
85
- -l, --locale <LOCALE> Locale [default: EN] [possible values: EN, TR]
86
- -c, --case <CASE> Target case [default: Title] [possible values: Lower, Sentence, Title,
87
- Upper]
88
- -s, --style <STYLE> Style Guide [possible values: ap, cmos, gruber]
89
- -h, --help Print help
90
- -V, --version Print version
67
+ ``` console
68
+ $ decasify -l tr ILIK SU VE İTEN RÜZGARLAR
69
+ Ilık Su ve İten Rüzgarlar
70
+
71
+ $ echo ILIK SU VE İTEN RÜZGARLAR | decasify -l tr
72
+ Ilık Su ve İten Rüzgarlar
73
+
74
+ $ echo foo BAR AND baz: an alter ego | decasify -l en -s gruber
75
+ Foo BAR and Baz: An Alter Ego
91
76
  ```
92
77
 
93
- First, check your distro for packages, e.g. for Arch Linux get it [from the AUR](https://aur.archlinux.org/packages/decasify).
78
+ ### Installation
79
+
80
+ <a href="https://repology.org/project/decasify/versions"><img src="https://repology.org/badge/vertical-allrepos/decasify.svg" align="right" alt="Packaging status"></a>
81
+ To install, first check your distro for packages, e.g. for [Arch Linux](https://archlinux.org/packages/extra/x86_64/decasify/) just install via `pacman -S decasify` or for [Homebrew](https://formulae.brew.sh/formula/decasify) via `brew install decasify`.
94
82
 
95
83
  Otherwise for many platforms you can run it directly or install it to a shell using Nix Flakes:
96
84
 
@@ -126,21 +114,21 @@ In your `Cargo.toml` file.
126
114
 
127
115
  ```toml
128
116
  [dependencies]
129
- decasify = "0.7"
117
+ decasify = "0.9"
130
118
  ```
131
119
 
132
120
  Then use the crate functions and types in your project something like this:
133
121
 
134
122
  ```rust
135
- use decasify::to_titlecase;
123
+ use decasify::titlecase;
136
124
  use decasify::{Locale, StyleGuide};
137
125
 
138
126
  fn demo() {
139
127
  let input = "ILIK SU VE İTEN RÜZGARLAR";
140
- let output = to_titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
128
+ let output = titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
141
129
  eprintln! {"{output}"};
142
130
  let input = "title with a twist: a colon";
143
- let output = to_titlecase(input, Locale::EN, StyleGuide::DaringFireball);
131
+ let output = titlecase(input, Locale::EN, StyleGuide::DaringFireball);
144
132
  eprintln! {"{output}"};
145
133
  }
146
134
  ```
@@ -249,6 +237,19 @@ Loading it in a SILE document uses the usual `\use[module=package.decasify]` (se
249
237
  Once loaded the package exposes a `\decasify{}` function that can take any combination of `case`, `locale`, and `style` settings and applies the appropriate transformation to the content.
250
238
  By default it will track the language of the document content.
251
239
 
240
+ ## Use as a Typst package
241
+
242
+ [Typst](https://typst.app/) has its own [package registry](https://typst.app/universe/).
243
+ The [decasify](https://typst.app/universe/package/decasify) package can be added to your project with an import line.
244
+ The exact version must be specified explicitly:
245
+
246
+ ```typst
247
+ #import "@preview/decasify:0.8.0": *
248
+ ```
249
+
250
+ Specific functions for each case should be available throughout the document.
251
+ See the Typst package [readme](typst/README.md) or the [package listing on Typst universe](https://typst.app/universe/package/decasify) for more details.
252
+
252
253
  [rock]: http://luarocks.org/modules/alerque/decasify
253
254
  [rock.sile]: http://luarocks.org/modules/alerque/decasify.sile
254
255
 
@@ -11,7 +11,7 @@
11
11
  [![PyPi (latest)](https://img.shields.io/pypi/v/decasify?logo=python&color=blue)](https://pypi.org/project/decasify)
12
12
  [![NPM Version](https://img.shields.io/npm/v/decasify?logo=npm&color=blue)](https://www.npmjs.com/package/decasify)
13
13
 
14
- A CLI utility, Rust crate, Lua rock, Python module, JavaScript module, Neovim plugin, and SILE package to cast strings to title-case (and other cases) according to locale specific style guides including Turkish support.
14
+ A CLI utility, Rust crate, Lua rock, Python module, JavaScript module, Neovim plugin, SILE package, and Typst package to cast strings to title-case (and other cases) according to locale specific style guides including Turkish support.
15
15
 
16
16
  This project was born out of frustration with authors and editors leaving ALL CAPS TITLES in Markdown sources.
17
17
  No tooling I could find properly supported casting these to title-cased strings (which are more versatile for typesetting purposes).
@@ -25,22 +25,13 @@ Where possible the APIs currently default to English rules and (for English) the
25
25
 
26
26
  The Turkish style follows the Turkish Language Institute's [guidelines][tdk].
27
27
 
28
- For English, three style guides are known: Associated Press (AP), Chicago Manual of Style (CMOS), and John Grubber's Daring Fireball (Gruber).
28
+ For English, three style guides are known: Associated Press (AP), Chicago Manual of Style (CMOS), and John Gruber's Daring Fireball (Gruber).
29
29
  The Gruber style is by far the most complete, being implemented by the [titlecase crate][titlecase_crate].
30
30
  The CMOS style handles a number of parts of speech but has punctuation related issues.
31
31
  The AP style is largely unimplemented.
32
32
 
33
33
  Contributions are welcome for better style guide support or further languages.
34
34
 
35
- ``` console
36
- $ decasify -l tr ILIK SU VE İTEN RÜZGARLAR
37
- Ilık Su ve İten Rüzgarlar
38
- $ echo ILIK SU VE İTEN RÜZGARLAR | decasify -l tr
39
- Ilık Su ve İten Rüzgarlar
40
- $ echo foo BAR AND baz: an alter ego | decasify -l en -s gruber
41
- Foo BAR and Baz: An Alter Ego
42
- ```
43
-
44
35
  [tdk]: https://tdk.gov.tr/icerik/yazim-kurallari/buyuk-harflerin-kullanildigi-yerler/
45
36
  [titlecase_crate]: https://crates.io/crates/titlecase
46
37
 
@@ -48,27 +39,24 @@ Foo BAR and Baz: An Alter Ego
48
39
 
49
40
  Use of the CLI is pretty simple.
50
41
  Input may be either shell arguments or STDIN.
42
+ Arguments can control the various options.
43
+ For full usage information check `decasify --help` or `man decasify`.
51
44
 
52
- ```console
53
- $ decasify --help
54
- A CLI tool to convert all-caps strings to title-case or other less aggressive tones that supports
55
- Turkish input
56
-
57
- Usage: decasify [OPTIONS] [INPUT]...
58
-
59
- Arguments:
60
- [INPUT]... Input string
61
-
62
- Options:
63
- -l, --locale <LOCALE> Locale [default: EN] [possible values: EN, TR]
64
- -c, --case <CASE> Target case [default: Title] [possible values: Lower, Sentence, Title,
65
- Upper]
66
- -s, --style <STYLE> Style Guide [possible values: ap, cmos, gruber]
67
- -h, --help Print help
68
- -V, --version Print version
45
+ ``` console
46
+ $ decasify -l tr ILIK SU VE İTEN RÜZGARLAR
47
+ Ilık Su ve İten Rüzgarlar
48
+
49
+ $ echo ILIK SU VE İTEN RÜZGARLAR | decasify -l tr
50
+ Ilık Su ve İten Rüzgarlar
51
+
52
+ $ echo foo BAR AND baz: an alter ego | decasify -l en -s gruber
53
+ Foo BAR and Baz: An Alter Ego
69
54
  ```
70
55
 
71
- First, check your distro for packages, e.g. for Arch Linux get it [from the AUR](https://aur.archlinux.org/packages/decasify).
56
+ ### Installation
57
+
58
+ <a href="https://repology.org/project/decasify/versions"><img src="https://repology.org/badge/vertical-allrepos/decasify.svg" align="right" alt="Packaging status"></a>
59
+ To install, first check your distro for packages, e.g. for [Arch Linux](https://archlinux.org/packages/extra/x86_64/decasify/) just install via `pacman -S decasify` or for [Homebrew](https://formulae.brew.sh/formula/decasify) via `brew install decasify`.
72
60
 
73
61
  Otherwise for many platforms you can run it directly or install it to a shell using Nix Flakes:
74
62
 
@@ -104,21 +92,21 @@ In your `Cargo.toml` file.
104
92
 
105
93
  ```toml
106
94
  [dependencies]
107
- decasify = "0.7"
95
+ decasify = "0.9"
108
96
  ```
109
97
 
110
98
  Then use the crate functions and types in your project something like this:
111
99
 
112
100
  ```rust
113
- use decasify::to_titlecase;
101
+ use decasify::titlecase;
114
102
  use decasify::{Locale, StyleGuide};
115
103
 
116
104
  fn demo() {
117
105
  let input = "ILIK SU VE İTEN RÜZGARLAR";
118
- let output = to_titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
106
+ let output = titlecase(input, Locale::TR, StyleGuide::LanguageDefault);
119
107
  eprintln! {"{output}"};
120
108
  let input = "title with a twist: a colon";
121
- let output = to_titlecase(input, Locale::EN, StyleGuide::DaringFireball);
109
+ let output = titlecase(input, Locale::EN, StyleGuide::DaringFireball);
122
110
  eprintln! {"{output}"};
123
111
  }
124
112
  ```
@@ -227,5 +215,18 @@ Loading it in a SILE document uses the usual `\use[module=package.decasify]` (se
227
215
  Once loaded the package exposes a `\decasify{}` function that can take any combination of `case`, `locale`, and `style` settings and applies the appropriate transformation to the content.
228
216
  By default it will track the language of the document content.
229
217
 
218
+ ## Use as a Typst package
219
+
220
+ [Typst](https://typst.app/) has its own [package registry](https://typst.app/universe/).
221
+ The [decasify](https://typst.app/universe/package/decasify) package can be added to your project with an import line.
222
+ The exact version must be specified explicitly:
223
+
224
+ ```typst
225
+ #import "@preview/decasify:0.8.0": *
226
+ ```
227
+
228
+ Specific functions for each case should be available throughout the document.
229
+ See the Typst package [readme](typst/README.md) or the [package listing on Typst universe](https://typst.app/universe/package/decasify) for more details.
230
+
230
231
  [rock]: http://luarocks.org/modules/alerque/decasify
231
232
  [rock.sile]: http://luarocks.org/modules/alerque/decasify.sile
@@ -36,6 +36,9 @@ fn main() -> AnyhowResult<()> {
36
36
  if let Ok(val) = env::var("VERSION_FROM_AUTOTOOLS") {
37
37
  println!("cargo:rustc-env=VERGEN_GIT_DESCRIBE={val}");
38
38
  builder.add_instructions(&RustcBuilder::all_rustc()?)?;
39
+ } else if let Ok(val) = env::var("LUA_ROCKSPEC_VERSION") {
40
+ println!("cargo:rustc-env=VERGEN_GIT_DESCRIBE=v{val}");
41
+ builder.add_instructions(&RustcBuilder::all_rustc()?)?;
39
42
  } else {
40
43
  builder.add_instructions(&GixBuilder::all_git()?)?;
41
44
  };