Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
159 lines (148 loc) · 5.88 KB
/
Copy pathCargo.toml
File metadata and controls
159 lines (148 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
[package]
name = "kiri-the-reader"
version = "0.2.1"
edition = "2024"
description = "Markdown reader for the kitty terminal"
repository = "https://github.com/toravasaari/kiri"
readme = "README.md"
license = "MIT"
publish = false
[workspace]
members = ["crates/kiri-tr-image-utils", "crates/kiri-tr-notices"]
[lib]
name = "kiri"
[[bin]]
name = "kiri"
path = "src/main.rs"
[lints.clippy]
too_many_lines = "warn"
# Release binaries carry no symbols, which makes them about a fifth smaller.
# A backtrace of a release build then shows no function names.
[profile.release]
strip = true
# Where cargo-binstall finds the release archives. They are named after the
# package, not after the binary, and keep the files in a directory of the
# same name (see scripts/package-release.sh).
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ target }/{ bin }{ binary-ext }"
# Optional parts of kiri; `full` turns them all on. Without them, kiri
# shows PNG, JPEG, GIF, WebP and SVG images, draws formulas, and draws
# Mermaid diagrams only with an external program such as mermaid-cli's
# mmdc. `full` adds the image formats the `image` crate decodes cheaply
# (BMP, ICO, TIFF, QOI, PNM and TGA), and Mermaid diagrams drawn by kiri
# itself.
[features]
default = ["full"]
full = [
"image/bmp",
"image/ico",
"image/tiff",
"image/qoi",
"image/pnm",
"image/tga",
"mermaid",
]
# Mermaid diagrams drawn by kiri itself, through merman with its default
# features: every diagram type, the Cytoscape and ELK layouts and math.
# Its png, native-fonts and system-fonts features would bring in a second
# resvg.
mermaid = ["dep:merman"]
[dependencies]
base64 = "0.23.1"
color_quant = "1.1.0"
clap = { version = "4.6", features = ["derive", "wrap_help"] }
clap_complete = "4.6.11"
clap_complete_nushell = "4.6.2"
comrak = { version = "0.59", default-features = false, features = ["shortcodes"] }
csv = "1.4.0"
emojis = "0.9.1"
flate2 = "1.1.10"
image = { version = "0.25.10", default-features = false, features = ["png", "jpeg", "gif", "webp", "color_quant"] }
kiri-tr-image-utils = { version = "0.1.0", path = "crates/kiri-tr-image-utils" }
libc = "0.2.191"
merman = { version = "0.9.3", optional = true }
# Reading mode's text layout. Without its `system` feature, which would
# link libfontconfig: the fonts come from the fontdb that resvg loads.
parley = { version = "0.12.0", default-features = false, features = ["std"] }
# Only for its `logging` feature: without it, a debug build prints on
# standard error each time parley's segmenter has no model for a script,
# such as Thai or Japanese. With it, the messages go to the `log` crate,
# for which kiri sets no logger.
icu_provider = { version = "2.4.0", features = ["logging"] }
# Formulas, drawn as SVG with the glyphs of KaTeX's fonts as paths, so
# that no fonts are needed to show them. The versions merman uses.
ratex-layout = "0.1.15"
ratex-parser = "0.1.15"
ratex-svg = { version = "0.1.15", features = ["embed-fonts"] }
ratex-types = "0.1.15"
resvg = "0.49.0"
rustix = { version = "1.1.6", features = ["termios", "event", "process", "fs", "system"] }
# The glyphs of reading mode's text, in the version resvg uses.
skrifa = "0.44.0"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = { version = "1.0.154", features = ["preserve_order"] }
signal-hook = "0.4.6"
syntect = { version = "5.3.0", default-features = false, features = ["default-fancy"] }
two-face = { version = "0.5.2", default-features = false, features = ["syntect-fancy"] }
toml = { version = "1.1.8", features = ["preserve_order"] }
unicode-segmentation = "1.13.3"
unicode-width = "0.2.3"
yaml-rust2 = { version = "0.13", default-features = false }
[dev-dependencies]
insta = "1.49"
# Pseudo-terminals for testing capability detection, and sessions
# without a controlling terminal for testing --doctor.
rustix = { version = "1.1.6", features = ["pty", "process"] }
# Decoding images without optimisation is slow: a 4845 × 2980 JPEG takes
# about 3 s instead of 0.07 s. Debug builds optimise the image decoders, the
# SVG parser and renderer, the fonts and text shaping for SVG text and the
# layout of reading mode's text, and keep kiri's own code easy to debug. An
# SVG with 400 lines of text takes 0.7 s instead of 1.2 s. The fern as an LZW TIFF takes 0.36 s instead of
# 0.64 s. flate2, moxcms and the TIFF decoder's fax and half made no
# measurable difference.
# Generic code is compiled in the crate that uses it. kiri-tr-image-utils is
# optimised for that reason: it decodes raster images, whose BMP, TGA and
# QOI decoders are generic, and scales them with fast_image_resize, most
# of which is generic. The fern as a BMP takes 0.23 s instead of 1.8 s.
[profile.dev.package]
zune-jpeg.opt-level = 3
zune-core.opt-level = 3
image.opt-level = 3
image-webp.opt-level = 3
png.opt-level = 3
gif.opt-level = 3
tiff.opt-level = 3
weezl.opt-level = 3
fdeflate.opt-level = 3
miniz_oxide.opt-level = 3
simd-adler32.opt-level = 3
crc32fast.opt-level = 3
resvg.opt-level = 3
tiny-skia.opt-level = 3
tiny-skia-path.opt-level = 3
usvg.opt-level = 3
roxmltree.opt-level = 3
svgtypes.opt-level = 3
simplecss.opt-level = 3
kurbo.opt-level = 3
fontdb.opt-level = 3
harfrust.opt-level = 3
skrifa.opt-level = 3
read-fonts.opt-level = 3
font-types.opt-level = 3
parley.opt-level = 3
parley_engine.opt-level = 3
fontique.opt-level = 3
icu_segmenter.opt-level = 3
fast_image_resize.opt-level = 3
kiri-tr-image-utils.opt-level = 3
# Dependencies get line tables only: a backtrace still shows their file and
# line, but a debugger cannot show their variables. Debugging them has been
# rare; when it is needed, a rebuild with this line removed is worth its
# price. Measured with mold on the maintainer's host, a rebuild after a
# library change took 17 to 31 s instead of 29 to 53 s, and target/ was
# 12 GB instead of 21 GB.
[profile.dev.package."*"]
debug = "line-tables-only"