svghmi/gen_index_xhtml.ysl2
branchsvghmi
changeset 2880 9da4ac0c9add
parent 2879 58e6a91dc37f
child 2881 3bb49f93d48c
equal deleted inserted replaced
2879:58e6a91dc37f 2880:9da4ac0c9add
    15 };
    15 };
    16 
    16 
    17 in xsl decl svgtmpl(match, xmlns="http://www.w3.org/2000/svg") alias template;
    17 in xsl decl svgtmpl(match, xmlns="http://www.w3.org/2000/svg") alias template;
    18 in xsl decl svgfunc(name, xmlns="http://www.w3.org/2000/svg") alias template;
    18 in xsl decl svgfunc(name, xmlns="http://www.w3.org/2000/svg") alias template;
    19 
    19 
    20 !debug_output_calls = []
    20 !!
       
    21 debug_output_calls = []
       
    22 def gen_debug_calls():
       
    23     # '&bug' is a workaround for pyPEG that choke on
       
    24     # yml2 python results not parsing down into a single yml2 call
       
    25     return ("&bug {"+
       
    26         "\n".join(["""
       
    27             comment {
       
    28                 |
       
    29                 | %s:
       
    30                 call "%s";
       
    31                 | 
       
    32             }"""%(n,n) for n in debug_output_calls])+
       
    33         "}")
       
    34 !!
    21 
    35 
    22 istylesheet
    36 istylesheet
    23             /* From Inkscape */
    37             /* From Inkscape */
    24             xmlns:dc="http://purl.org/dc/elements/1.1/"
    38             xmlns:dc="http://purl.org/dc/elements/1.1/"
    25             xmlns:cc="http://creativecommons.org/ns#"
    39             xmlns:cc="http://creativecommons.org/ns#"
    48 
    62 
    49     template "/" {
    63     template "/" {
    50         comment > Made with SVGHMI. https://beremiz.org
    64         comment > Made with SVGHMI. https://beremiz.org
    51 
    65 
    52         // use python to call all debug output from included definitions
    66         // use python to call all debug output from included definitions
    53         // '&bug' is a workaround for pyPEG that choke on yml2 python results not parsing to a single call
    67         python gen_debug_calls;
    54         !"&bug {"+"\n".join(["comment {\n| \n| %s:\n call \"%s\";\n| \n}"%(n,n) for n in debug_output_calls]) +"}"!
       
    55 
    68 
    56         html xmlns="http://www.w3.org/1999/xhtml"
    69         html xmlns="http://www.w3.org/1999/xhtml"
    57              xmlns:svg="http://www.w3.org/2000/svg"
    70              xmlns:svg="http://www.w3.org/2000/svg"
    58              xmlns:xlink="http://www.w3.org/1999/xlink" {
    71              xmlns:xlink="http://www.w3.org/1999/xlink" {
    59             head;
    72             head;