diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ac60a..8697067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ Tyto - Littérateur # CURRENTLY IN DEV ! +## [1.9.23] +- new quote process (HTML prepared at 'check') + ## [1.9.22] - new bcode process (html prepared for wip) - new post database management values diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 30ad4a3..9940ac8 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Version: 1.9.22 -# Updated: 2023-10-13 1697190846 +# Version: 1.9.23 +# Updated: 2023-10-14 1697274575 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn @@ -94,7 +94,8 @@ prog_files = { "show", "tools", "tyto", - "userset" + "userset", + "wip" } lang_files = { "logs_en", diff --git a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc index 1500ab5..dbce621 100644 Binary files a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc differ diff --git a/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc index 324c0db..d954315 100644 Binary files a/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc differ diff --git a/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc index 5f6e52d..aa85f8a 100644 Binary files a/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc and b/src/var/lib/tyto/program/__pycache__/tyto.cpython-311.pyc differ 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 a35d8dc..af9f6f0 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/check.py b/src/var/lib/tyto/program/check.py index 89e022c..175f827 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -812,8 +812,8 @@ def cf_update_values(): post.cf_set("STATS_TEXTS", "tyto_coms", str(post.stats_tyto_text_coms)) post.cf_set("STATS_TEXTS", "html_coms", str(post.stats_html_coms)) post.cf_set("STATS_TEXTS", "titles", str(post.stats_titles)) - #post.cf_set("STATS_TEXTS", "bcodes_lines", str(post.stats_bcodes_lines)) post.cf_set("STATS_TEXTS", "bcodes", str(post.ptags_stats["bcodes"])) + post.cf_set("STATS_TEXTS", "bcodes_lines", str(post.stats_bcodes_lines)) post.cf_set("STATS_TEXTS", "quotes", str(post.ptags_stats["quotes"])) # Founds from header tags post.cf_set("STATS_TEXTS", "links", str(post.stats_text_links)) diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py index 2079bee..08452bc 100644 --- a/src/var/lib/tyto/program/post.py +++ b/src/var/lib/tyto/program/post.py @@ -312,17 +312,11 @@ value2s_ext_uris = ("http", "ftp") # text_contents # ============= -# Start lines tags -bcodes = ("{{", "}}") -quotes = ("[[", "]]") -parags = ("((", "))") -lists = ("<<", ">>", "=", "+") - # Paired markers ptags = ( ("{{", "}}", "bcodes"), ("[[", "]]", "quotes"), - ("((", "))", "parags"), + ("((", "))", "parags", '

', "

"), ("<<", ">>", "lists" ), ) @@ -347,8 +341,7 @@ html_brline = ("|", '
') html_hrline = ("--", '
') text_comments = (";;", "" + block_time_on = block_time_off = "" + blockquote_cite = blockquote_lang = blockquote_title = "" + footer_cite = footer_book = footer_date = "" + footer = "%s%s%s" + # Metas datas + metas = post.quote_metas + cite = date = book = lang = link = "" - return lines + # Construct blockquote HTML + for ln, line in enumerate(lines): + line = line.lstrip() + + # Open Marker (Unused in HTML). Get user CSS class + if ln == 0: + css = tools.get_css(line, post.ptags[1][0]) + continue + + # Closed marker (Unused in HTML) + elif ln == len(lines) - 1: + continue + + # Meta is set. Get datas. (Unused line in HTML) + elif line.startswith(metas): + if line.startswith(metas[0]) and not cite: + try: cite = line.rsplit(metas[0])[1].lstrip() + except: cite = "" + elif line.startswith(metas[1]) and not date: + try: date = line.rsplit(metas[1])[1].lstrip() + except: date = "" + elif line.startswith(metas[2]) and not book: + try: book = line.rsplit(metas[2])[1].lstrip() + except: book = "" + elif line.startswith(metas[3]) and not lang: + try: lang = line.rsplit(metas[3])[1].lstrip() + except: lang = "" + elif line.startswith(metas[4]) and not link: + try: link = line.rsplit(metas[4])[1].lstrip() + except: link = "" + continue + + # Real content quote + else: + html_quote = "%s\n%s"%(html_quote, line) + + # Create template from datas + #
tag + if link: + blockquote_cite = ' cite="%s"'%link + cite = cite or "Source" + footer = '%s'%( + domain.css, link, footer + ) + if lang: + blockquote_lang = ' lang="%s"'%lang + + #