turbobadger icon indicating copy to clipboard operation
turbobadger copied to clipboard

yaml instead of tb.txt

Open rokups opened this issue 9 years ago • 8 comments

What do you think about using yaml instead of custom file format for UI?

Pros:

  • Familiar to way more people than tb.txt is
  • Ability to use existing third party tools for editing
  • Maintenance of parser is done by someone else

Cons:

  • One more dependency
  • Existing resources would need converting (although can be automated)

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.

rokups avatar Sep 19 '16 13:09 rokups

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).

fruxo avatar Sep 19 '16 16:09 fruxo

Another option could be the use of JSON files. All editors have excellent tools and (small and effective) C/C++ parser implementations abound.

--R

RobertoMalatesta avatar Sep 19 '16 16:09 RobertoMalatesta

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

codecat avatar Sep 19 '16 16:09 codecat

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.

rokups avatar Sep 19 '16 16:09 rokups

@angelog great plugin. Too bad I don't use Sublime. Today I'm converging all my code on Visual Studio Code.

RobertoMalatesta avatar Sep 19 '16 16:09 RobertoMalatesta

@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 avatar Sep 19 '16 16:09 RobertoMalatesta

@RobertoMalatesta You should be able to use the tmLanguage file on VSCode (Atom) too: https://code.visualstudio.com/docs/customization/colorizer

codecat avatar Sep 19 '16 16:09 codecat

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.

jeduden avatar Oct 17 '16 05:10 jeduden