Allow dots in parameter key names
[ikiwiki] / doc / plugins / contrib / ymlfront / discussion.mdwn
1 Now that I have implemented a \[[!ymlfront ...]] directive, I would like to remove support for the old "---" delimited format, because
2
3 * it is fragile (easily breakable)
4 * it is non-standard
5
6 Any objections?
7
8 > Well, I don't have much standing since I have been too lame to integrate
9 > ymlfront into ikiwiki yet. Buy, my opinion is, I liked the old
10 > format of putting the YAML literally at the front of the file. It
11 > seemed to allow parsing the file as YAML, using any arbitrary YAML
12 > processer. And it was nice how it avoided boilerplate. --[[Joey]] 
13
14 >> The old delimited format also has the advantage of being remarkably similar to the
15 >> [MultiMarkDown](http://fletcherpenney.net/multimarkdown/users_guide/multimarkdown_syntax_guide/)
16 >> way of including metadata in documents. The only difference is that MMD doesn't expect the
17 >> triple-dash separators, but I'm thinking about submitting a patch to MMD to actually support
18 >> that syntax. --GB
19
20 >>> Yes, the idea was to allow the file to be parsed as YAML, you're right.  I just found that I tended to have problems when people used "---" for horizontal rules.  However, I have also found that trying to keep it solely as an IkiWiki directive doesn't work either, since sometimes the meta-data I need also contained "]]" which broke the parsing of the directive.
21 >>> So I have decided to go for a compromise, and make the delimiter configurable, rather than hardcoded as "---"; the triple-dash is the default, but it can be configured to be something else instead.  I haven't pushed the change yet, but I have written it, and it seems to work. -- [[KathrynAndersen]]
22
23 >>>> I'm not sure about what kind of problems you're meeting with "---" being used
24 >>>> for horizontal rules: isn't it sufficient to just check that (1) the triple-dash
25 >>>> is the first thing in the page and (2) there are only YAML-style assignments
26 >>>> (and no blank lines) between the two markers? Check #2 would also be enough to
27 >>>> support MMD-style metadata, which means (a) no start marker and (b) empty line
28 >>>> to mark the end of the metadata block. Would this be supported by the plugin?
29 >>>> --GB
30
31 >>>>> Since I allow all legal YAML, the only way to check if it is legal YAML is to use the YAML parser, by which time one is already parsing the YAML, so it seems a bit pointless to check before one does so. -- KA