From c841c6321854abfa53a07ffe30571ade8192edd9 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Sat, 19 Nov 2022 18:02:47 +0100 Subject: [PATCH] wip: in-dev for HTML tabulations from final result --- src/var/lib/tyto/program/wip.py | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 5a059b7..9085cfa 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -106,6 +106,9 @@ def manage_wip(file_post, Force): print('> Article HTML:') print(wip_html) + + tab_article(wip_html.rsplit('\n')) + #============================# @@ -575,3 +578,37 @@ def convert_from_b64(post_content): base64_bytes = base64.b64decode(content_bytes) src_content = base64_bytes.decode("utf8") + +#=======================# +# Tabulations formating # +#-----------------------# +def tab_article(article): + global wip_html + + wip_tmp = '' + tab = 0 + + for line in article: + if len(line) == 0: continue + + print(line) + if line.startswith('