1
0
Fork 0

Support <marker> and <page> tags in the conversion of checklists to tutorials.

This commit is contained in:
Stuart Buchanan 2013-02-27 22:46:37 +00:00
parent 5491f952ca
commit 82f2de2fbc

View file

@ -26,7 +26,17 @@ var convert_checklists = func {
# Now go through each of the checklist items and generate a tutorial step
# for each.
foreach (var item; ch.getChildren("item")) {
# Checklist may consist of one or more pages.
var pages = ch.getChildren("page");
if (size(pages) == 0) {
# Or no pages at all, in which case we need to create a checklist of one page
append(pages, ch);
}
foreach (var page; pages) {
foreach (var item; page.getChildren("item")) {
step = tutorial.getNode("step["~ size(tutorial.getChildren("step")) ~ "]", 1);
var msg = item.getNode("name", 1).getValue();
@ -43,7 +53,14 @@ var convert_checklists = func {
if (item.getNode("condition") != nil) {
var cond = step.getNode("exit", 1).getNode("condition", 1);
props.copy(item.getNode("condition", 1), cond);
props.copy(item.getNode("condition"), cond);
}
if (item.getNode("marker") != nil) {
var marker= step.getNode("marker", 1);
props.copy(item.getNode("marker"), marker);
}
}
}