From fca139bd44814befebbe76b181685ac7e796e00b Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Fri, 3 Nov 2023 11:23:44 +0100 Subject: [PATCH] [1.9.31] - added empty styles.css in tyto/tpl_files --- CHANGELOG.md | 5 ++ debian/control | 2 +- src/usr/bin/tyto | 2 +- .../program/__pycache__/wip.cpython-311.pyc | Bin 20079 -> 20487 bytes src/var/lib/tyto/program/wip.py | 52 +++++++++--------- 5 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 243d6f1..48306b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ Tyto - Littérateur # CURRENTLY IN DEV (in devel branch) ! +## [1.9.31] +- Fix replacing markers starting LINE with HTML +- Added tpl_files directory +- - addes styles.css (empty with classes used) + ## [1.9.30] - 'wip' process - - About all markers done ! diff --git a/debian/control b/debian/control index 4b9580c..11f4cc1 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: tyto -Version: 1.9.30 +Version: 1.9.31 Section: custom Priority: optional Architecture: all diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index cad1efe..461195b 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Version: 1.9.30 +# Version: 1.9.31 # Updated: 2023-10-18 1697613100 # Tyto - Littérateur diff --git a/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc index 658e8010968833c716d83ea86a42efcaf90e6069..09d0da52e86b02901ba656ab5373b28fd8911910 100644 GIT binary patch delta 2079 zcmb_dUrbwN6#vfc?JXDD($dnF-j)_x3Z*N52Ff5q$_4|HDNeIwC@72~f>`lV9V53J zCMKe5V)4xEK}gUCC0R1XKB_TGV9e~Pqy|H>j0ZI)E?G%5Aw2orR?sm1J?wk<<$mYS z@BGf`m(xcx@WC8tztU*32|YP?TLvz*Eoh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jt-57#CmB`*}e#Uhu*+EtQ>Oc7r9XQ{JD_S9|?iM=T=KB2@vq*Y8I*C zFdX-dGaM!l@&SDBbFhtA<61+F@TYH(sb$Hs7P`s`@ndkYY>;sng%onYy|QPq7MlHD z&ypqk9pn7@gvFn<_!rc4~Pcd4M{obrJ@j}89NLm65>V)_GtELw) zF-c`9t|{U=AF#XYTJxEk`BbZ$yXmbvCNj4~>X?VSRh-vGGvClu8ymk9_>Qu@q9j_Q zz@P#)1e|BUya{yr!n;pj{nusPvbG@KGA>& rVD`lCl_DmOe;bZt4tr8)8-x~&N%p(24?caWg+EQ{u_lEGs7>=9U?jvi diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index c90fa8f..20ab690 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -211,33 +211,50 @@ def words_tags(): # anchors, paragraphs... # #-------------------------# def sl_tags(): - for line in html_post.rsplit("\n"): + global html_post + + for ln, line in enumerate(html_post.rsplit("\n")): css = "" # Paragraphs if line.lstrip().startswith(post.ptags[2][0]): css = tools.get_css(line, post.ptags[2][0], "?") - text_replace(line, post.ptags[2][3]%css) + html_post = \ + html_post.replace( + html_post.rsplit("\n")[ln], + post.ptags[2][3]%css + ) elif line.lstrip().startswith(post.ptags[2][1]): text_replace(line, post.ptags[2][4]) # DIVs if line.lstrip().startswith(post.ptags[4][0]): css = tools.get_css(line, post.ptags[4][0], "?") - text_replace(line, post.ptags[4][3]%css) + html_post = \ + html_post.replace( + html_post.rsplit("\n")[ln], + post.ptags[4][3]%css + ) elif line.lstrip().startswith(post.ptags[4][1]): text_replace(line, post.ptags[4][4]) #
elif line.lstrip().startswith(post.html_brline[0]): css = tools.get_css(line, post.html_brline[0][0], "?") - text_replace(line, post.html_brline[1]%css) + html_post = \ + html_post.replace( + html_post.rsplit("\n")[ln], + post.html_brline[1]%css + ) #
elif line.lstrip().startswith(post.html_hrline[0]): css = tools.get_css(line, post.html_hrline[0][0], "?") - text_replace(line, post.html_hrline[1]%css) - + html_post = \ + html_post.replace( + html_post.rsplit("\n")[ln], + post.html_hrline[1]%css + ) # Anchors elif line.lstrip().startswith(post.anchor_target[0]): @@ -245,9 +262,10 @@ def sl_tags(): text_replace(line, post.anchor_target[1]%css) -# -# -# +#========================================# +# From data, split number and string # +# return new value with px if not string # +#----------------------------------------# def split_size(size): tup_size= ( ''.join(filter(str.isdigit, size)) or "", @@ -298,7 +316,6 @@ def images(): try: width = option.rsplit("w=")[1] width = split_size(width) - print("wip: size =", width) except: pass @@ -306,7 +323,6 @@ def images(): try: height = option.rsplit("h=")[1] height = split_size(height) - print("wip: size =", height) except: pass @@ -579,17 +595,3 @@ def convert_list(markdown_str, mark_b, mark_c): work_str += " "*(cur_rank-i-1) + CLOSING[rank_stack.pop()] return work_str - - -""" -# -# Not Yet done, soon... -# -def paragraphs(): - # Paragraph is set - if line.startswith(post.ptags[2][0]): - p_css = tools.get_css(line, post.ptags[2][0]) - html_quote = "%s\n%s"%(html_quote, post.ptags[2][3]%p_css) - elif line.startswith(post.ptags[2][1]): - html_quote = "%s\n%s"%(html_quote, post.ptags[2][4]) -"""