From 8b00709200b7d6d258f2cbbb3476b76d3a6b5a39 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Tue, 17 Jan 2023 16:20:43 +0100 Subject: [PATCH] Better HTML tabulations --- src/var/lib/tyto/program/wip.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index feaff94..52c5ccd 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -628,34 +628,44 @@ def wip_raws(target): def wip_tabs(): global article_bottom article_temp = '' - tab = tab_start = 2 # From
tag + tab = tab_start = 6 # From
tag indiv = False + tabs_hX = { + '1' : '6', + '2' : '8', + '3' : '10', + '4' : '12', + '5' : '14', + '6' : '16' + } + for line in article_bottom.rsplit('\n'): # Titles if line.startswith(''): tab = int(tab) - 2 - article_temp = '%s\n%s%s'%(article_temp, tab * ' ', line) + article_temp = '%s\n%s%s'%(article_temp, int(tab) * ' ', line) indiv = False continue # Other contents - else: - article_temp = '%s\n%s%s'%(article_temp, tab * ' ', line) + else: + if not article_temp: article_temp = '%s%s'%(int(tab) * ' ', line) + else: article_temp = '%s\n%s%s'%(article_temp, int(tab) * ' ', line) article_bottom = article_temp