- Add demo page to the new mkdocs
- Set website home page to mkdocs
This commit is contained in:
unclecode
2024-06-22 20:36:01 +08:00
parent 2217904876
commit d6182bedd7
8 changed files with 332 additions and 18 deletions

View File

@@ -631,4 +631,9 @@ def wrap_text(draw, text, font, max_width):
while words and draw.textbbox((0, 0), line + words[0], font=font)[2] <= max_width:
line += (words.pop(0) + ' ')
lines.append(line)
return '\n'.join(lines)
return '\n'.join(lines)
def format_html(html_string):
soup = BeautifulSoup(html_string, 'html.parser')
return soup.prettify()