diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-06-04 21:33:27 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-06-05 10:56:36 +0300 |
commit | 3e31c46a74c56156156572b10eb5c2f4feda36c7 (patch) | |
tree | 9775126695531380578b75039271bf06bdc8cf45 /Cargo.toml | |
parent | ef0f269fbf2fc2b2a275b65e66b15d250c41d358 (diff) |
Add "regexp" feature, format text with regexps
`regexp` feature uses the pcre2 library to enable the user to define
regular expressions for matching text and applying text formatting to
the matches. An example from the theme configuration I used to test
this:
[terminal.themes.win95.text_format_regexps]
"listing.subject" = { "\\[[^\\]]*\\]" = { attrs = "Bold" } }
"listing.from" = { "\\<[^\\>]*\\>(?:(?:\\s*$)|(?=,))" = { attrs = "Italics" } }
[terminal.themes.win95.text_format_regexps."pager.envelope.body"]
"^>.*$" = { attrs = "Italics" }
"\\d+\\s?(?:(?:[KkMmTtGg]?[Bb])|(?:[KkMmTtGg][Bb]?)(?=\\s))" = { attrs = "Bold | Underline" }
Diffstat (limited to 'Cargo.toml')
-rw-r--r-- | Cargo.toml | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -49,7 +49,7 @@ rmpv = { version = "^0.4.2", features=["with-serde",] } rmp-serde = "^0.14.0" smallvec = { version = "1.1.0", features = ["serde", ] } bitflags = "1.0" - +pcre2 = { version = "0.2.3", optional = true } [profile.release] lto = true @@ -60,10 +60,11 @@ debug = false members = ["melib", "testing", ] [features] -default = ["sqlite3", "notmuch"] +default = ["sqlite3", "notmuch", "regexp"] notmuch = ["melib/notmuch_backend", ] jmap = ["melib/jmap_backend",] sqlite3 = ["melib/sqlite3"] +regexp = ["pcre2"] cli-docs = [] # Print tracing logs as meli runs in stderr |