"""Converts a KDL tree in stdin into a HTML file using kdlj2's renderer."""

from sys import stdin

from kdl import parse

from .render import render_document


def main() -> None:
    """Execute the kdl-to-html entry point."""
    node = parse(stdin.read()).get(None)

    if node is None:
        exit(1)

    print(render_document(node))
