]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/ikiwiki/directive/ymlfront/discussion.mdwn
e9431dc839b9fe154122a0d4b5938bf26d42b39a
[ikiwiki.git] / doc / plugins / contrib / ikiwiki / directive / ymlfront / discussion.mdwn
1 I can't seem to make this work. I have tried, in this [sandbox](http://mesh.openisp.ca/sandbox), to set values for fields and then display them with the getfield meta syntax, but it doesn't seem to be working.
2
3 The getfield, field and ymlfront plugins are enabled. I have tried with and without the following field registration:
4
5     # field plugin
6     # define the fields for the meshmtl project
7     field_register:
8     - meta
9     - hostname
10     - MAC
11     - IP
12
13 I have tried both the ymlfront directive and the YAML markup (with the
14 `---` delimiter), no luck. Any idea what I am doing wrong? --
15 [[anarcat]]
16
17 > I'm afraid I can't tell from here what the problem could be.  It's clear that ymlfront is turned on, or the ymlfront directive in your sandbox page wouldn't be processed.  The only thing I can suggest, in order to get more information about what could be going wrong, would be to do a dump of your indexdb file (see [[tips/inside dot ikiwiki]]) and see what the data for your sandbox page is.  If there is field data there, that would indicate a problem with getfield; if there isn't field data there, that would indicate a problem with field or ymlfront.
18
19 > Oh, and you only need to register "meta" with field_register; that will enable the data defined by the "meta" plugin to be read by field.  Unless "hostname", "MAC" and "IP" are plugins, you don't need to add them to field_register.  They can be taken care of by the ymlfront plugin.  Perhaps that is the problem?
20
21 > --[[KathrynAndersen]]
22
23 > > I have tried removing the other fields from the declaration, no luck. I did, however, notice the following error in the `--rebuild` output:
24 > > 
25 > >     ymlfront parse: Load of sandbox data failed: YAML Error: Stream does not end with newline character
26 > >        Code: YAML_PARSE_ERR_NO_FINAL_NEWLINE
27 > >        Line: 0
28 > >        Document: 0
29 > >      at /usr/share/perl5/YAML/Loader.pm line 38
30 > > 
31 > > Now *that* has to be related... ;) In the index.db, there is no ymlfront metadata for the sandbox page... Note that the `---` delimiter approach doesn't trigger the warning but doesn't populate the DB either...
32 > > 
33 > > Finally note that after adding debugging code, I was able to figure out that this seems to be using the `YAML::XS` library. I have also traced the data and confirmed that `$yml_str` does get properly initialized in `parse_yml`, and it is where the error is generated. So maybe there's something wrong with the YAML library? --[[anarcat]]