diff -r ac08a5d15c15 -r 8e3d130399b0 svghmi/widget_custom.ysl2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/svghmi/widget_custom.ysl2 Wed Mar 18 09:16:14 2020 +0100 @@ -0,0 +1,60 @@ +// widget_custom.ysl2 +// +// widget entierely defined from JS code in Inkscape description field + +// TODO + +// a preliminary implementation was initially attempted but disabled +// code collected around before code refactoring + + + + /* TODO re-enable + || + function evaluate_js_from_descriptions() { + var Page; + var Input; + var Display; + var res = []; + || + const "midmark" > \n«$mark» + apply """//*[contains(child::svg:desc, $midmark) or \ + starts-with(child::svg:desc, $mark)]""",2 + mode="code_from_descs"; + || + return res; + } + || + */ + + // template "*", mode="code_from_descs" { + // || + // { + // var path, role, name, priv; + // var id = "«@id»"; + // || + + // /* if label is used, use it as default name */ + // if "@inkscape:label" + // |> name = "«@inkscape:label»"; + + // | /* -------------- */ + + // // this breaks indent, but fixing indent could break string literals + // value "substring-after(svg:desc, $mark)"; + // // nobody reads generated code anyhow... + + // || + + // /* -------------- */ + // res.push({ + // path:path, + // role:role, + // name:name, + // priv:priv + // }) + // } + // || + // } + +