svghmi/widget_custom.ysl2
branchsvghmi
changeset 2883 8e3d130399b0
parent 2882 ac08a5d15c15
child 2909 0519fdce9a59
equal deleted inserted replaced
2882:ac08a5d15c15 2883:8e3d130399b0
       
     1 // widget_custom.ysl2
       
     2 //
       
     3 // widget entierely defined from JS code in Inkscape description field
       
     4 
       
     5 // TODO
       
     6 
       
     7 // a preliminary implementation was initially attempted but disabled
       
     8 // code collected around before code refactoring
       
     9 
       
    10 
       
    11 
       
    12         /* TODO re-enable
       
    13         ||
       
    14         function evaluate_js_from_descriptions() {
       
    15             var Page;
       
    16             var Input;
       
    17             var Display;
       
    18             var res = [];
       
    19         ||
       
    20         const "midmark" > \n«$mark»
       
    21         apply """//*[contains(child::svg:desc, $midmark) or \
       
    22                      starts-with(child::svg:desc, $mark)]""",2 
       
    23               mode="code_from_descs";
       
    24         ||
       
    25             return res;
       
    26         }
       
    27         ||
       
    28         */
       
    29 
       
    30     // template "*", mode="code_from_descs" {
       
    31     //     ||
       
    32     //     {
       
    33     //         var path, role, name, priv;
       
    34     //         var id = "«@id»";
       
    35     //     ||
       
    36 
       
    37     //     /* if label is used, use it as default name */
       
    38     //     if "@inkscape:label"
       
    39     //         |> name = "«@inkscape:label»";
       
    40 
       
    41     //     | /* -------------- */
       
    42 
       
    43     //     // this breaks indent, but fixing indent could break string literals
       
    44     //     value "substring-after(svg:desc, $mark)";
       
    45     //     // nobody reads generated code anyhow...
       
    46 
       
    47     //     ||
       
    48 
       
    49     //         /* -------------- */
       
    50     //         res.push({
       
    51     //             path:path,
       
    52     //             role:role,
       
    53     //             name:name,
       
    54     //             priv:priv
       
    55     //         })
       
    56     //     }
       
    57     //     ||
       
    58     // }
       
    59 
       
    60