-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON/YAML/etc. configuration files? #326
Comments
Hi! I support this idea. We will need to implement the format converter used by vtm to JSON/YAML/etc and vice versa. Perhaps in the future one of these formats will be more convenient than the one used in vtm now. The use of vtm in its own format is due to the need to inline attribute records (for brevity) while not losing the algorithmic simplicity of merging two such configurations <background>
<fgc>whitedk</fgc>
<bgc>blacklt</bgc>
<tile>"# \n "</tile>
</background> the same but shorter <background fgc=whitedk bgc=blacklt tile="# \n "/> To convert to other serialization formats, we can translate the vtm format into some canonical form that is compatible with other formats. To do this, we need to introduce a new parameter for each attribute - Canonical form <background>
<_value_>""<_value_>
<fgc>
<_value_>"whitedk"<_value_>
</fgc>
<bgc>
<_value_>"blacklt"<_value_>
</bgc>
<tile>
<_value_>"# \n "<_value_>
</tile>
</background> JSON {
"background": {
"_value_": "",
"fgc": {
"_value_": "whitedk",
},
"bgc": {
"_value_": "blacklt",
},
"tile": {
"_value_": "# \n ",
},
},
} YAML - background
- _value_: ""
- fgc
- _value_: "whitedk"
- bgc
- _value_: "blacklt"
- tile
- _value_: "# \n " |
Adding an asterisk to the end of the name solves this problem for all formats. |
Since xml supports multiple keys with the same name the childs would need to be stored as arrays. Something like this would be possible: <background >
<fgc>whitedk</fgc>
<bgc>blacklt</bgc>
<tile>"# \n "</tile>
</background> {
"type": "backgroud",
"values": [
{
"type": "fgc",
"value": "whitedk"
},
{
"type": "bgc",
"value": "blacklt"
},
{
"type": "tile",
"value": "# \n "
}
]
} This would also make the special syntax a bit easier. <item* /> {
"type": "item",
"template": true
} |
What do you think of adding a JSON/YAML/etc. configuration format?
I think it would make it way easier to introduce to new users.
The text was updated successfully, but these errors were encountered: