mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-26 20:16:33 +00:00
improvements from PR review
fix documentation about syntax mappings
This commit is contained in:
1 parent
c6e661d80b
commit
3767f15c2a
1 file changed
+11
-4
@@ -20,12 +20,10 @@ syntax mappings defined by all TOML files, and embed them into the binary.
|
|||||||
|
|
||||||
## File syntax
|
## File syntax
|
||||||
|
|
||||||
Each TOML file should contain a single section named `mappings` and/or a single
|
Each TOML file should contain a single section named `mappings`, with each of its keys being a language
|
||||||
section named `case_sensitive_mappings`, with each of its keys being a language
|
|
||||||
identifier (first column of `bat -L`; also referred to as "target").
|
identifier (first column of `bat -L`; also referred to as "target").
|
||||||
|
|
||||||
The value of each key should be an array of strings, with each item being a glob
|
The value of each key should be an array of "rules". The rules are expected to be objects with a `glob` string and a `case_sensitive` boolean. For simplification, a rule can be just a glob string, which is shorthand for the default case insensitive mode.
|
||||||
matcher. We will call each of these items a "rule".
|
|
||||||
|
|
||||||
For example, if `foo-application` uses both TOML and YAML configuration files,
|
For example, if `foo-application` uses both TOML and YAML configuration files,
|
||||||
we could write something like this:
|
we could write something like this:
|
||||||
@@ -98,6 +96,15 @@ like this:
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Case sensitivity
|
||||||
|
|
||||||
|
By default, all glob patterns are matched case-insensitively. To match a pattern case-sensitively, use the object form of the rule with the `case_sensitive` option:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[mappings]
|
||||||
|
"Python" = [{ glob = "BUILD", case_sensitive = true }]
|
||||||
|
```
|
||||||
|
|
||||||
## Ordering
|
## Ordering
|
||||||
|
|
||||||
At compile time, all TOML files applicable to the target are processed in
|
At compile time, all TOML files applicable to the target are processed in
|
||||||
|
|||||||
Reference in new issue
Block a user