261111.8 0e37187be6a98f3b8d5ec64064ce8aae3e390708 JSON, YAML and keyval files switch between the three formats
commit time warp
A code page for a .json, .yaml, .yml or .kv file names the three formats at the left end of its view row, beside gron. The file's own format is plain text; ?json, ?yaml and ?keyval show the same document in another.
kv converts, so go.mod takes github.com/unixfile/kv, gopkg.in/yaml.v3 and go 1.26. A converted view is a reading aid: a line above it says that keys are sorted, an empty list becomes an empty map and YAML loses comments and aliases. A file that does not convert shows as written under kv's error.
A first view costs about a second per MB, so a file over 1 MB is not converted, and the server keeps a converted page by the file's hash.
go 1.26's vet rejects %q for a map of strings in a test message, so semantic_test.go prints it with %v.
Changes to go.sum. All files
go.sum
@@ -8,5 +8,10 @@ github.com/dlclark/regexp2/v2 v2.2.1 h1:mf4KkFUj0gJuarK8P+LgiS+Lit7m9N1yAwEfPbee github.com/dlclark/regexp2/v2 v2.2.1/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=+github.com/unixfile/kv v0.4.1-0.20261111053906-04904010070f h1:Zl+fI95sUooDMS+aIxucSO4k/9N6GPqkjNNPRzpRUkk=+github.com/unixfile/kv v0.4.1-0.20261111053906-04904010070f/go.mod h1:s57h3FC/1lJlLKvE/OM7LNm3vMOhwRy7MAJGEShL5Oc= github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4= github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=