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
[]
= "cindermark"
= "0.2.0"
= "2021"
= "High-performance incremental Markdown parser with UTF-16 offsets, built for native text editors on Apple platforms"
= ["Rene DeAnda <rene@deanda.org>"]
= "MIT"
= "https://github.com/renedeanda/cindermark"
= "https://embernotes.app"
= "README.md"
= ["markdown", "parser", "incremental", "commonmark", "uniffi"]
= ["parser-implementations", "text-processing"]
# Build docs with the FFI surface enabled so the full API (including the Swift
# binding types) is documented on docs.rs, even though `ffi` is off by default.
[]
= ["ffi"]
[]
= ["staticlib", "cdylib", "lib"]
= "cindermark"
[]
# Pure-Rust parser by default. `cargo add cindermark` pulls exactly three
# crates — memchr, rustc-hash, unicode-segmentation — and no build-script
# codegen. Everything UniFFI-related is opt-in below.
= []
# `ffi`: UniFFI scaffolding for the generated Swift / Apple bindings. Enabled
# automatically by build-apple.sh and the release workflow; Rust-only
# consumers never need it.
= ["dep:uniffi"]
# `bindgen`: the `uniffi-bindgen` CLI that (re)generates the Swift bindings
# from cindermark.udl. Only the bundled `uniffi-bindgen` binary requires it,
# so the CLI toolchain (clap, goblin, …) never reaches a library consumer's
# dependency graph.
= ["ffi", "uniffi/cli"]
# `wasm`: wasm-bindgen surface for the browser demo (independent of `ffi`).
= ["dep:wasm-bindgen"]
[]
# Optional and off by default — pulled in only by the `ffi` feature. The `cli`
# machinery lives behind `bindgen` (see above), keeping consumer builds lean.
= { = "0.28", = true }
= { = "0.2", = true }
= "2"
= "2"
= "1"
[]
= { = "0.5", = ["html_reports"] }
= "1"
[]
= { = "0.28", = ["build"] }
[]
# Production-grade tuning — this profile is what ships inside host apps
# (e.g. Ember Notes' App Store builds). Cargo's default release profile is
# opt-level=3 / codegen-units=16 / no LTO. These overrides take the parser
# the rest of the way:
# - lto = "fat": full link-time optimization across crates. ~10-20%
# runtime win on tight parser hot loops; produces a
# single inlined .a, smaller and faster.
# - codegen-units = 1: single codegen unit. Slower archive (~30s → ~2-3min
# for parser slice), tighter optimization, smaller
# binary. Acceptable since archives are infrequent.
# - strip = true: drop debug symbols. ~50% smaller .a (27 MB → ~12 MB),
# keeps the app binary slim. Crash logs lose Rust
# frame symbols; disable if you symbolicate them.
# - panic = "unwind": DELIBERATELY kept as the default. Skipping
# `panic = "abort"` preserves UniFFI's contract for
# converting Rust panics into Swift errors via
# `FfiConverterRustBuffer`. `abort` would terminate
# the host app on any parser panic instead of
# surfacing a recoverable Swift throw.
= "fat"
= 1
= true
[]
= "release"
= 1
= true
# Opt the local-dev profile OUT of the heavy release tuning so iterative
# `./build-apple.sh dev` rebuilds stay snappy. Without these overrides, the
# inheritance from `release` would also drag in LTO + codegen-units = 1
# and turn every local parser change into a 2-3 minute wait.
= false
= 16
= false
[[]]
= "parser_bench"
= false
[[]]
= "uniffi-bindgen"
= "uniffi-bindgen.rs"
# The binding generator needs the UniFFI CLI toolchain; `bindgen` pulls it in
# (and implies `ffi`). Library consumers never build this target.
= ["bindgen"]
# wasm-pack's bundled wasm-opt crashes on this crate's output; rustc's own
# release profile (fat LTO, codegen-units=1) already does the heavy lifting.
[]
= false