svghmi/widget_custom.ysl2
changeset 3302 c89fc366bebd
parent 2909 0519fdce9a59
equal deleted inserted replaced
2744:577118ebd179 3302:c89fc366bebd
       
     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 /*const "mark" > =HMI=\n*/
       
    12 
       
    13 
       
    14         /* TODO re-enable
       
    15         ||
       
    16         function evaluate_js_from_descriptions() {
       
    17             var Page;
       
    18             var Input;
       
    19             var Display;
       
    20             var res = [];
       
    21         ||
       
    22         const "midmark" > \n«$mark»
       
    23         apply """//*[contains(child::svg:desc, $midmark) or \
       
    24                      starts-with(child::svg:desc, $mark)]""",2 
       
    25               mode="code_from_descs";
       
    26         ||
       
    27             return res;
       
    28         }
       
    29         ||
       
    30         */
       
    31 
       
    32     // template "*", mode="code_from_descs" {
       
    33     //     ||
       
    34     //     {
       
    35     //         var path, role, name, priv;
       
    36     //         var id = "«@id»";
       
    37     //     ||
       
    38 
       
    39     //     /* if label is used, use it as default name */
       
    40     //     if "@inkscape:label"
       
    41     //         |> name = "«@inkscape:label»";
       
    42 
       
    43     //     | /* -------------- */
       
    44 
       
    45     //     // this breaks indent, but fixing indent could break string literals
       
    46     //     value "substring-after(svg:desc, $mark)";
       
    47     //     // nobody reads generated code anyhow...
       
    48 
       
    49     //     ||
       
    50 
       
    51     //         /* -------------- */
       
    52     //         res.push({
       
    53     //             path:path,
       
    54     //             role:role,
       
    55     //             name:name,
       
    56     //             priv:priv
       
    57     //         })
       
    58     //     }
       
    59     //     ||
       
    60     // }
       
    61 
       
    62