From: MrHeadwar Date: Wed, 29 Dec 2021 18:04:24 +0000 (+0100) Subject: PDF : correct content hierarchy on the fly X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6008f32194b55fe5b686b22901c3aef1726d24c4;p=ardour-manual PDF : correct content hierarchy on the fly --- diff --git a/build.py b/build.py index 775e3f8..d7753fe 100755 --- a/build.py +++ b/build.py @@ -208,16 +208,22 @@ def GetParent(fs, pos): # -# Change the hierarchy of titles : h1->hn, h2->hn+1, etc... n being delta-1 -# -def reheader(txt, delta): - for i in range(6, 0, -1): - txt = txt.replace('->,

->, so that the +# highest hyerarchy level is maxlevel +# +def remapheader(txt, maxlevel): + maxlvl=1 + # find the highest hierarchy level in the content + while maxlvl < 7 and txt.find('' + header['title'] + '\n';