diff options
Diffstat (limited to 'blog_experiment/blog/html.py')
| -rw-r--r-- | blog_experiment/blog/html.py | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/blog_experiment/blog/html.py b/blog_experiment/blog/html.py index a114318a..6c3b0099 100644 --- a/blog_experiment/blog/html.py +++ b/blog_experiment/blog/html.py @@ -1,30 +1,17 @@ -import subprocess - +import bs4 import htmlgenerator as h -def tidy(s): - p = subprocess.run( - ["tidy", "--indent", "yes", "-q", "-wrap", "160"], - input=s, - stdout=subprocess.PIPE, - encoding="UTF8", - ) - return p.stdout - - def html_template(*content): - return tidy( - h.render( - h.HTML( - h.HEAD(h.TITLE("El blog es mío")), - h.BODY( - h.H1("El blog es mío"), - h.H2("Hay otros como él, pero este es el mío"), - *content, - ), - doctype="html", + return bs4.BeautifulSoup(h.render( + h.HTML( + h.HEAD(h.TITLE("El blog es mío")), + h.BODY( + h.H1("El blog es mío"), + h.H2("Hay otros como él, pero este es el mío"), + *content, ), - {}, - ) - ) + doctype="html", + ), + {}, + ), features="html.parser").prettify() |
