# coding: utf-8 # [Pix2Text](https://github.com/breezedeus/pix2text): an Open-Source Alternative to Mathpix. # Copyright (C) 2022-2024, [Breezedeus](https://www.breezedeus.com). COLOR_MAPPING = { 'general': '#009933', 'english': '#3399ff', 'formula': '#ff8000', 'hybrid': '#009999', 'text': '#3399ff', 'isolated': '#ff8000', 'text-embed': '#009999', } def render_html(newest_fp, image_type, text, out_html_fp): html_str = """

Pix2Text: a free tool like Mathpix

Screenshot

""" html_str += fr'' + '\n
' html_str += """

Results

""" html_str += r'Image Type: ' \ fr'
' \ fr'{image_type}
' + '\n' if image_type in ('formula', 'hybrid'): html_str += '
' html_str += """
""" html_str += '\n' html_str += """
""" with open(out_html_fp, 'w', encoding='utf-8') as f: f.writelines(html_str)