Recently, Wikidot has introduced strict YAML rules for Data Forms and prevented users from saving malformed YAML syntax in dataforms.
Quote from TeRq
When forgiving mode is used unpredictable things may [happen] (it also caused a lot of warnings on backend servers), so we want to force people to write proper YAML code in Data Forms. And we have just released Data Form definition validation on save.
This has triggered quite a bit of a problem within the Wikidot community. But luckily:
James Kanjo has devised a great little program that lists all the templates with Data Forms
- and I created a converter to convert the previously forgiving code to a new strict YAML format
Step 1: Finding the Data Forms (Using James' genius code!)
Abstract: James' program lists all _template pages with data forms so users can easily see and change all of them at once. You can find his original code here.
[[module CSS]]
.live-template-only .category_template {display: block !important;}
.live-template-only .no-data + .category_template {display: none !important;}
[[/module]]
[[div class="live-template-only"]]
[[module ListPages pagetype="hidden" category="* -_default -admin -system" separate="false"]]
[!----%%content{2}%%]
[[div class="no-data"]]
[[/div]]
[!----]
[[div class="category%%name%%" style="display: none; border: 2px solid #000;"]]
[[[%%fullname%%|%%fullname%%]]]
[[div class="code"]]
@<​>@%%content{2}%%
[[/div]]
[[/div]]
[[/module]]
[[/div]]
Step 2: Converting to Strict Format
To save users from having to check and fix every single line of malformed YAML, I written a quick program that does the chore for you! Copy the whole of the old forgiving YAML code and a new strict version is returned! Really simple!
If there are any problems with the program, simply report the bug below or PM me (tsangk).
Update (10th Nov 2012): Update new converter URL. Report bugs on converter.wikidot.com
Thanks Kenneth, works great an correct.
Please - remove the reminder to use the "source" button output - the edit window shows the better (correct) source code.
Question: where is the "status" box? and which error messages can I get? ( missing "field:" ? )
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
You can try the different error messages with the following codes:
No data form
No field, check for typos
More than one root pair, check indent:
Kenneth Tsang (@jxeeno)
Thanks, this makes it really clear !
Well done, Kenneth!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Also reported in the original discussion on the feedback site:
I just tried the new converter site and found a problem (the old code/site converted this just fine):
source:
hint: Be specific ($3 off a $15 order)
output:
hint: 'Be specific ( off a order)'
Does this mean we need to somehow escape dollar signs to be "compliant"?
Community Admin
@Ed Johnson: just pushed a bug fix for the dollar sign bug. I tested with the following code, and it seemed to work okay :)
Kenneth Tsang (@jxeeno)
OK, that's fixed, but I found another one:
Using a colon in the hint text tricks the converter.
Source
Output
I'm also having some strange issues with the output box. I'm not always able to select the text for copying with Firefox. In IE9, the scroll bar is acting like my text fits in the box when it doesn't (no slider and the arrows do nothing). I can still select the entire output by dragging the mouse or using CRTL+A.
Edit: Input and Output boxes seem to be working perfectly in Chrome.
Community Admin
Input and Output boxes seem to be working perfectly in Chrome.
Community Admin
Okay, I fixed the Output box. I didn't want an editable output box to avoid confusion, so I've added auto-select all when you click on the output box.
And thanks for that code, I'll take a look at it later
Kenneth Tsang (@jxeeno)
@Ed: I've now pushed a bug fix for that. Please test :)
Edit (here are some tests):
Kenneth Tsang (@jxeeno)
Thanks for the shout!
:D
I'm having trouble with this code:
λ James Kanjo
Blog | Wikidot Expert | λ and Proud
Web Developer | HTML | CSS | JavaScript
Post preview:
Close preview