Blockly Demo: Headless

# Blockly > Demos > Headless

This is a simple demo of generating Python code from XML with no graphics. This might be useful for server-side code generation.

<xml id="startBlocks" style="display: none"> <block type="controls_if" inline="false" x="20" y="20"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" inline="true"> <field name="OP">EQ</field> <value name="A"> <block type="math_arithmetic" inline="true"> <field name="OP">MULTIPLY</field> <value name="A"> <block type="math_number"> <field name="NUM">6</field> </block> </value> <value name="B"> <block type="math_number"> <field name="NUM">7</field> </block> </value> </block> </value> <value name="B"> <block type="math_number"> <field name="NUM">42</field> </block> </value> </block> </value> <statement name="DO0"> <block type="text_print" inline="false"> <value name="TEXT"> <block type="text"> <field name="TEXT">Don't panic</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="text_print" inline="false"> <value name="TEXT"> <block type="text"> <field name="TEXT">Panic</field> </block> </value> </block> </statement> </block> </xml> |  |