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 658e801..09d0da5 100644 Binary files a/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/wip.cpython-311.pyc differ 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]) -"""