import json


def hdelk_html(schm: dict, header: str = "Schematic", display_customizations: str = "") -> str:
    """
    Generates HTML with schematic using HDElk
    :param schm: schematics data in tool_render format (actually that is content for HDElk's graph variable)
    :param header: string to be written in header of file
    :return: whole HTML page content as string
    """
    result = f"""<!DOCTYPE html>
<html>
<body>

<h1>{header}</h1>

<script src="./js/hdelk/elk.bundled.js"></script>
<script src="./js/hdelk/svg.min.js"></script>
<script src="./js/hdelk/hdelk.js"></script>

<div id="simple_diagram"></div>

<script type="text/javascript">

    {display_customizations}

    var simple_graph = {json.dumps(schm, indent=2)}

    hdelk.layout( simple_graph, "simple_diagram" );
</script>

</body>
</html>"""
    return result