diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-06-02 16:11:33 +1000 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-06-15 07:32:10 +0300 |
commit | a26578742c9c3addd5045606269f2e5c03dd4d1a (patch) | |
tree | f75581bb2c3e9e4670620ce326ebcdc0b197b136 /doc | |
parent | fef179cfe7d8d72a0705202e9dcfd2196932f3ac (diff) | |
download | xorg-lib-libxkbcommon-a26578742c9c3addd5045606269f2e5c03dd4d1a.tar.gz |
doc: add the rules-format file (as markdown)
Useful to have this as part of the documentation. The rendering isn't great but
at least not any worse than pure text. Markdown escapes % so explaining our use
of %S and %H would require a double % - not idea. Let's just wrap it as a code
block and done.
Includes two typo fixes too, yay.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/rules-format.md (renamed from doc/rules-format.txt) | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/rules-format.txt b/doc/rules-format.md index d97d8e8..96acbbf 100644 --- a/doc/rules-format.txt +++ b/doc/rules-format.md @@ -38,8 +38,9 @@ near the end. Grammar ------- (It might be helpful to look at a file like rules/evdev along with -this grammer. Comments, whitespace, etc. are not shown.) +this grammar. Comments, whitespace, etc. are not shown.) +``` File ::= { "!" (Include | Group | RuleSet) } Include ::= "include" <ident> @@ -58,12 +59,14 @@ Kccgst ::= "keycodes" | "symbols" | "types" | "compat" | "geometry" Rule ::= { MlvoValue } "=" { KccgstValue } "\n" MlvoValue ::= "*" | GroupName | <ident> KccgstValue ::= <ident> +``` Notes: - Include processes the rules in the file path specified in the ident, - in order. %-expanasion is performed, as follows: + in order. %-expansion is performed, as follows: +``` %%: A literal %. @@ -72,6 +75,7 @@ Notes: %S: The system-installed rules directory (usually /usr/share/X11/xkb/rules). +``` - The order of values in a Rule must be the same as the Mapping it follows. The mapping line determines the meaning of the values in @@ -80,6 +84,7 @@ Notes: - If a Rule is matched, %-expansion is performed on the KccgstValue, as follows: +``` %m, %l, %v: The model, layout or variant, if only one was given (e.g. %l for "us,il" is invalid). @@ -94,6 +99,7 @@ Notes: %(m), %(l), %(l[1]), %(v), %(v[1]): As above, but prefixed by '(' and suffixed by ')'. +``` In case the expansion is invalid, as described above, it is skipped (the rest of the string is still processed); this includes |