Quotes: working, but missing HTML time tag

This commit is contained in:
Cyrille L 2022-12-19 17:41:57 +01:00
parent b1e250a3cf
commit cacad4565d
1 changed files with 51 additions and 23 deletions

View File

@ -302,8 +302,9 @@ def wip_quotes() :
# Read the quote. Get parameters
author = date = lang = book = link = quote_html = ''
cite = ''
cite = figc = ''
tab_p = tab_c = 2 # Init 2 tabs after <blockquote>
auth_html = title_html = ''
for qline in quote:
# Begin marker quote [11]
@ -319,11 +320,9 @@ def wip_quotes() :
if qline.startswith(tyto.words_tags[10][0]):
par_css = tyto.get_css(qline)
if author:
tab_p = tab_p + 2
tab_c = tab_c + 4
else:
tab_c = tab_c + 2
# Set tabulation for paragraphs and content
if author: tab_p = tab_p + 2 ; tab_c = tab_c + 4
else: tab_c = tab_c + 2
# Replace opened paragrph with html line
qline_html = '%s%s'%(
@ -349,33 +348,62 @@ def wip_quotes() :
continue
# Add other lines
if quote_html:
quote_html = '%s\n%s%s'%(quote_html, int(tab_c) * ' ', qline)
if quote_html: quote_html = '%s\n%s%s'%(
quote_html, int(tab_c) * ' ', qline
)
else: quote_html = '%s%s'%(tab_c * ' ', qline)
# New quote set, then, repare datas
if link: cite = ' cite="%s"'%(link)
if lang: lang = ' lang="%s"'%lang
# Preparing title="" tag and author reference
if author:
if book and date:
title_html = ' title="%s - %s (%s)"'%(
author, book, date
)
auth_html = '%s - %s (%s)'%(
author, book, date
)
elif book:
title_html = ' title="%s - %s"'%(author, book)
auth_html = '%s - %s'%(author, book)
elif date:
title_html = ' title="%s (%s)"'%(author, date)
auth_html = '%s (%s)'%(author, date)
else:
quote_html = '%s%s'%(tab_c * ' ', qline)
if link:
cite = ' cite="%s"'%(link)
if lang:
lang = ' lang="%s"'%lang
title_html = ' title="%s"'%author
auth_html = '%s'%author
if link: figc= '<a class="figc" href="%s">%s</a>'%(
link, auth_html
)
else:
if book and date: title_html = ' title="%s (%s)"'%(
book, date
)
elif book: title_html = ' title="%s"'%(book)
elif date: title_html = ' title="(%s)"'%(date)
# Create HTML Quote with datas
if author:
quote_html = '<figure class="%s">\n'%set_css + \
' <blockquote class="%s"%s%s>\n'%(
set_css, lang, cite
' <blockquote class="%s"%s%s%s>\n'%(
set_css, lang, cite, title_html
) + \
'%s\n'%quote_html + \
' </blockquote>\n' + \
' <figcaption class="%s">\n'%set_css + \
' %s\n'%figc + \
' </figcaption>\n' + \
'</figure>'
else:
quote_html = '<blockquote class="%s"%s%s>\n'%(
set_css, lang, cite
quote_html = '<blockquote class="%s"%s%s%s>\n'%(
set_css, lang, cite, title_html
) + \
'%s\n'%quote_html + \
'</blockquote>'
print('> quote:')
print(quote_html)
# Replace line with final HTML Quote
article_bottom = article_bottom.replace('Q64_%s_Q64'%line, quote_html)