-
Notifications
You must be signed in to change notification settings - Fork 955
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
TOML is not very friendly for non-technical users #317
Comments
It's also worth noting that of the five most popular static generators (as per https://www.staticgen.com/) that use page front-matter like Gutenberg, all five support YAML front-matter, while only two of them support TOML:
Cobalt also only supports YAML. So I'm guessing I'm far from the only one to have a usage scenario where YAML seems like a better fit for the content editors of a statically generated website. |
(And of course supporting YAML would make it easier to migrate from these other static generators to Gutenberg.) |
I believe this might be a duplicate of #189 (I'm not a maintainer but I follow the project) |
Hmm, I guess so, but the reason given for closing that issue (YAML "not being human readable") seems completely at odds with the example given above. My non-technical users certainly feel very strongly that it's 100% the other way around. |
Although also it's primarily the authoring issues (listed above) rather than readability that are the problem. |
So I kind of agree that TOML is not that great (I must have been missing the Obvious part from the name, even started working on another language to fix some of my issues with it: https://github.com/Keats/scl) but I find YAML to be very easy to make mistakes in compared to TOML, granted the kind of YAML file I was trying to debug at the time of #189 were more like https://github.com/Keats/gutenberg/blob/master/sublime_syntaxes/TypeScript.sublime-syntax . I spent a good 2 hours before realising one line was missing one level of indent and had other various indentation issues while using Ansible. I can totally see how TOML would be confusing for non-programmers though but adding it would also mean allowing a |
Yes, I share this concern. The lack of delimiter characters might make YAML feel much nicer to author for some users, but it also means the parser is less able to point you to the location of any mistakes (unless you use a schema?). It certainly doesn't seem suitable for very large files (like TypeScript.sublime-syntax) where spotting indentation issues will be a huge pain. For smaller sets of structured data like you'd find in Gutenberg's config files and front-matter I'm hopeful that in practice mistakes are less likely/easier to spot, and therefore the trade-off is a worthwhile one. Mostly it's the fact that the other static generators heavily favor YAML that gives me that hope, since otherwise they'd presumably have moved to favor something else. (Even the generators that support other formats favor YAML in their docs.) |
If someone is willing to add YAML as an alternative to toml i would probably take it now but it needs to cover every single use of toml (date/datetime types, config file, merging of themes and config etc) |
I've seen this article yesterday https://arp242.net/weblog/yaml_probably_not_so_great_after_all.html that kind of sums up my thoughts about YAML and even taught me that yes/no an a few other strings were automatically parsed as boolean for some reason...? |
Yes, that's the top "stupid feature" on the StrictYAML FAQ which also lists a bunch of other things (a very interesting doc). I filed an issue in rust-yaml to consider adding an option to restrict parsing to the StrictYAML variant, and someone there commented that at least the yes/no thing is no longer supported in YAML 1.2 which is what rust-yaml aims to implement. |
Any YAML support would probably need to use serde though, in order to keep things simple |
Sure. (serde_yaml uses yaml-rust under the hood though, so yaml-rust would still be the place to implement StrictYAML support if that was desirable.) |
Some thoughts on this:
|
You still need to merge configs if the user is using a theme. I like the
I've never used pandoc, what does this mean? Just having |
You mean Regarding |
I'd like to suggest a different way of selecting the front-matter language. Why not use a Markdown code block with a language indicator? A TOML front-matter would then be wrapped in
YAML would be
One of the big upsides of this syntax would be that it renders much more pleasingly in a preview. And parsing should be as simple as grabbing the first code block from the post (although this does mean a post cannot skip the front-matter and start with a code block). What do you think? |
On Sunday, 9 September 2018 22:45:39 EAT Jonas Matser wrote:
One of the big upsides of this syntax would be that it renders much more
pleasingly in a preview. And parsing should be as simple as grabbing the
first code block from the post (although this does mean a post cannot skip
the front-matter and start with a code block).
What do you think?
I think that the `---` and `+++` blocks for metadata are already pretty well
established. In fact they are around for such a long time that I think, if
the preview bothers you, the viewer should be taught about them instead.
|
Might zola (gutenberg) switch to scl? I'm about to start using it, so it'd be great to see another app with it. |
It might be possible in the future but SCL is still in flux imo and shouldn't be used that much yet |
well -- i' personally don't like TOML and somehow got used to YAML, because it's used for so many really useful tools... but in this particular case, matters of individual taste shouldn't be decisive. it's more a serious question of compatibility. i have used serde for some projects and would see it as one of the best multiformat parsers available. |
although it's more related to #498, there is now a patched version of gutenberg available, which supports YAML at least in the front matter for compatibility reasons: https://gitlab.com/mash-graz/gutenberg/commit/1c6b8addb8ac4497aa25639a6a542ee356cd971 i hope, it will find it's way into the upstream version. |
My 2 cents…
|
@jwatt my suggestion would be pick a format that works for you and your content authors and then script converting that to TOML front matter during a pre-build script. I'd argue any flavor of "edit text files" is generally considered unfriendly to non-technical users and that's why we have WYSIWYG content management systems. zola is not that. I would definitely vote to not add YAML support to zola. I think YAML is very much out of harmony with the rust ecosystem, and for good reasons around correctness, consistency, robustness, automagic, and security. The line between a static site generator plus blog engine and a CMS or special-purpose site starts to get slippery quickly. |
Hi, maintainers! We are currently rewriting the Tildeverse RFC website and we would love to use Zola. However for historical reasons we would like to keep our content with a I understand there are concerns with YAML. I also understand Zola would highly recommend to use TOML. But couldn't we have YAML-frontmatter support for just pages & sections on a best-effort basis? The docs and Github issue template could mention potential issues with YAML and instruct to try a TOML equivalent before filing an issue. Also @mash-graz has already implemented YAML support on their side showing a YAML integration is not too complicated via the excellent Thanks! |
it's completely up to the maintainers of the project to accept this kind of user requests and suggested patches. we simply have to accept it resp. can not change it. but the way, how this issue got handled by the zola developers at least opened my eyes! :( i really like the idea of "free" software! software, where users are able and wellcome to express and satisfy their needs by writing feature requests or more or less trivial code contributions. but rigid dictatorship and zero tolerance against deviating opinions, like zolas stupid YAML-hostility, simply isn't compatible with this idea of freedom and shared open software development! therefore i stopped using this software after this frustrating experience and utilize other (non-rust based) static site generators again. |
I'm not a big fan of having to mix 2 configurations languages in the same project so I would rather have the YAML being available everywhere (config & theme). On the other hand, the less YAML the better so limiting it to front-matter is better but hard to argue against extending it.
I would rather have that coming in a fresh PR, that patch is too old.
I think you completely misunderstand the concept of free software then. It has nothing to do with accepting every single feature request just because someone wrote a patch for it. Opinionated software is good, I don't want to deal with 200 options as a user and even less as support/maintainer. It's done on my free time and I am completely free to accept or reject any features. Something could make the point as you on why it's "stupid" to be against JSON front-matter. Or UCL. Or HCL. Or Hocon. Or SCL. Yet it is still free software.
Great! |
I've been trying to teach some older non-technical users how to use TOML front-matter for a simple recipe site that I'm putting together. This front-matter might look something like this:
I've had quite a lot of trouble getting them to feel comfortable with this, so I tried them with YAML instead, which for comparison would be:
There are a bunch of issues with the TOML (demonstrate in the TOML example above) that when taken together are making them really unhappy:
They find the YAML considerably cleaner/less confusing/more intuitive, and now that I've shown them that they simply can't understand why anyone would use TOML. (Which, for our schema and usage scenario, seems valid.)
YAML of course isn't without issues. Specifically I'd be worried about the potential for them to mess up the (semantically significant) indentation. However, they're pretty adamant that if that's the only thing they'd need to worry about then they could get that right, and that YAML would be by far the better choice for them. (In fact - if I'm going to ask them to enter their recipes in a text format - they think the indentation would be a good thing, since it makes things more readable.)
The text was updated successfully, but these errors were encountered: