{name2}
''' This is a library for formatting GPT-4chan and chat outputs as nice HTML. ''' import os import re from pathlib import Path import markdown from PIL import Image # This is to store the paths to the thumbnails of the profile pictures image_cache = {} with open(Path(__file__).resolve().parent / '../css/html_readable_style.css', 'r') as f: readable_css = f.read() with open(Path(__file__).resolve().parent / '../css/html_4chan_style.css', 'r') as css_f: _4chan_css = css_f.read() with open(Path(__file__).resolve().parent / '../css/html_cai_style.css', 'r') as f: cai_css = f.read() def generate_basic_html(s): s = '\n'.join([f'
{line}
' for line in s.split('\n')]) s = f'