Indev for quotes

This commit is contained in:
Cyrille L 2022-12-18 16:08:03 +01:00
parent a5c4db3094
commit 61a27495ea
1 changed files with 44 additions and 4 deletions

View File

@ -289,8 +289,48 @@ def wip_quotes() :
line = line.replace('_Q64', '') line = line.replace('_Q64', '')
quote = tyto.b64('Decode', line, 'Q64_', '_Q64').rsplit("\n") quote = tyto.b64('Decode', line, 'Q64_', '_Q64').rsplit("\n")
# Read the quote # Read the quote. Get parameters
author = date = lang = book = link = quote_html = ''
for qline in quote: for qline in quote:
if line.startswith('tyto.words_tags[11][0]'): if qline.startswith(tyto.words_tags[11][0]):
set_css = get_css(line) set_css = tyto.get_css(qline)
print(set_css) continue
if qline.startswith('_cite:'):
author = qline.rsplit('_cite:')[1].lstrip()
continue
if qline.startswith('_date:'):
date = qline.rsplit('_date:')[1].lstrip()
continue
if qline.startswith('_book:'):
book = qline.rsplit('_book:')[1].lstrip()
continue
if qline.startswith('_lang:'):
lang = qline.rsplit('_lang:')[1].lstrip()
continue
if qline.startswith('_link:'):
lang = qline.rsplit('_link:')[1].lstrip()
continue
# paragraphs
# Construct quote_html
if qline.startswith(tyto.words_tags[10][0]):
par_css = tyto.get_css(qline)
qline_html = '%s'%(tyto.words_tags[10][2]%par_css)
if quote_html: quote_html = '%s\n%s'%(quote_html,qline_html)
else: quote_html = qline_html
continue
if qline.startswith(tyto.words_tags[10][1]):
qline_html = tyto.words_tags[10][3]
quote_html = '%s\n%s'%(quote_html, qline_html)
continue
# End of quote
if qline.startswith(tyto.words_tags[11][1]):
continue
if quote_html: quote_html = '%s\n%s'%(quote_html,qline)
else: quote_html = qline
print('>>>>', quote_html)