Open rokups opened 8 years ago
I reviewed using yaml before writing the custom parser that is in TB, but didn't like it. I couldn't find any implementation that would fit well either. Maybe things has changed on the implementation front since then (haven't checked).
Another option could be the use of JSON files. All editors have excellent tools and (small and effective) C/C++ parser implementations abound.
--R
I think if you use yaml (or json for that matter) you'd have to add an additonal children
tag to add children elements in layouts for example, which would just be yet another line of syntax. (I guess you could still see class names as children elements, but still)
As for editing, I have made and published a Sublime Text plugin for TB node syntax on Package Control: https://github.com/nimbletools/turbobadger-sublime
I would happily write one more line in order to get editor support. As for json - it was not created to be readable so something like yaml would still be better for writing by hand. Besides curlies=extra lines. Though honestly... Json still better than custom format imho.
@angelog great plugin. Too bad I don't use Sublime. Today I'm converging all my code on Visual Studio Code.
@rokups I admit my sheer ignorance on YAML (always skipped it thinking it was yet another markup --and I hate markups) but it shows some nice points, so I'll have a look adopting it in some other project (JS/TS based -- VSC seems to have interesting plugins as well)
I agree that JSON is maybe less readable, but today it is everywhere and well supported by libs and tools.
--R
@RobertoMalatesta You should be able to use the tmLanguage file on VSCode (Atom) too: https://code.visualstudio.com/docs/customization/colorizer
Please also note that yaml has a pretty large specification. In addition, it is fairly easy to replace /adapt the current format with/to yaml in application code.
What do you think about using yaml instead of custom file format for UI?
Pros:
Cons:
Reason i am suggesting this is because existing format is already close to yaml which is great. If we could use format that is already widely supported by other tools it would only benefit users of library.