Merge pull request #3395 from lousyd/next
clarify JSON standard non-compliance
This commit is contained in:
commit
484854d52f
|
@ -219,13 +219,15 @@ the window which matches any of the criteria. As an example:
|
||||||
|
|
||||||
A layout file as generated by +i3-save-tree(1)+ is not strictly valid JSON:
|
A layout file as generated by +i3-save-tree(1)+ is not strictly valid JSON:
|
||||||
|
|
||||||
1. Layout files contain multiple “JSON documents” on the top level, whereas the
|
1. Layout files contain multiple “JSON texts” at the top level. The JSON
|
||||||
JSON standard only allows precisely one “document” (array or hash).
|
standard doesn't prohibit this, but in practice most JSON parsers only
|
||||||
|
allow precisely one “text” per document/file, and will mark multiple texts
|
||||||
|
as invalid JSON.
|
||||||
|
|
||||||
2. Layout files contain comments which are not standardized, but understood by
|
2. Layout files contain comments which are not allowed by the JSON standard,
|
||||||
many parsers.
|
but are understood by many parsers.
|
||||||
|
|
||||||
Both deviations from the JSON standard are to make manual editing by humans
|
Both of these deviations from the norm are to make manual editing by humans
|
||||||
easier. In case you are writing a more elaborate tool for manipulating these
|
easier. In case you are writing a more elaborate tool for manipulating these
|
||||||
layouts, you can either use a JSON parser that supports these deviations (for
|
layouts, you can either use a JSON parser that supports these deviations (for
|
||||||
example libyajl), transform the layout file to a JSON-conforming file, or
|
example libyajl), transform the layout file to a JSON-conforming file, or
|
||||||
|
|
Loading…
Reference in New Issue