-
Notifications
You must be signed in to change notification settings - Fork 245
Nue's simplicity is great! But then why YAML over JSON? #536
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
Comments
I personally think |
Shortly: YAML is for humans, JSON for machines. And many of the issues listed on your link (like the Norway problem) no longer exist — at least on the js-yaml implementation we use. If something, we could think of implementing our custom YAML parser without any of the listed problems. I feel JSON would make Nue configuration more complex, not simpler. |
I agree that Nue deservers something better than the current YAML specification — particularly because Nue gets unwarranted bad rap because of that choice. For that reason I have seriously thought about writing a YAML parser, which only takes the good parts of it and addresses the issues listed in noyaml.com. Should be quite small/straightforward project. Does anyone want to help here? |
I guess that would be best thing would love help |
this sounds like a super interesting idea can i jump in too |
@AIABHISHEK @chan27-2 I asked Claude to write a parser to parse the specific subset of YAML it seems Nue uses. Here's what it came up with: https://claude.ai/share/b7e555e6-1628-4feb-8634-6cd6364aa2ae |
Glad to see excitement around this! For the syntax I primarly wish flexible string handling:
The above would remove all my personal glitches with YAML. I don't really have any other complaitnts about YAML — I actually like it. For the project itself, I'd like to see minimalistic source code. Claude gave a a good starting point, but there's always room for improvement. The code should follow our rules and perhaps the most important: a super broad test suite would be awesome where one could see how the syntax works. |
Is your feature request or improvement related to a problem?
The problem of complexity, yes! YAML is not like JSON, it's a complexity disaster: https://noyaml.com/ .
Solution you'd like
How about using site.json instead of site.yaml? Same for blog/blog.yaml, etc; let's use .json files, not .yaml.
Alternatives you've considered
.toml might be a decent choice! It'd be great for simple config, but once you need to nest data structures a bit (like simple-blog's site.yaml does with navigation.header and navigation.footer), it seems like JSON would be a better fit.
Additional context
Seriously, check out https://noyaml.com/ ! FYI the YAML spec is 5-10x the size of the JSON spec. Given the brilliant simplicity of Nue, it deserves so much better than YAML!
The text was updated successfully, but these errors were encountered: