wip: HTML time tag added to quotes (when registred) + base64 in utf8

This commit is contained in:
Cyrille L 2022-12-26 11:39:14 +01:00
parent 1a14dbb2a9
commit a5601062ff
3 changed files with 25 additions and 13 deletions

View File

@ -152,6 +152,7 @@ Avec ce NOM.
# Placer dans un paragraphe pour chaque ou après "|",
# sinon, affichage les une à côté des autres
# ! Si pas d'unité pour w= et h= : défaut "px"
_image:Nom
_image:Nom c=CSS
_image:Nom c=css w=1080
@ -168,12 +169,12 @@ _brut:NOM
### Citations
Possibilité dans toute citation d'utiliser les marqueurs
optionnels _xxx:
optionnels _xxx. Pour la date, utilisez le FORMAT INTERNATIONAL
```
# Brut:
# Source
[[ CSS_TEST
_cite: echolib
_date: 2022
_date: 2022-12-28
_lang: fr
_link: https://tyto.echolib.re
_book: Référence
@ -182,24 +183,27 @@ Pfff, vraiment !
))
]]
# Sotie HTML:
# HTML:
<figure class="CSS_TEST">
<blockquote class="CSS_TEST" lang="fr" cite="https://tyto.echolib.re" title="echolib - Reference (2022)">
<blockquote class="CSS_TEST" lang="fr" cite="https://tyto.echolib.re" title="echolib - Reference (2022-12-28)">
<time datetime="2022-12-28">
<p class="tyto">
Pfff, vraiment !
</p>
</time>
</blockquote>
<figcaption class="CSS_TEST">
<a class="figc" href="https://tyto.echolib.re">echolib - Reference (2022)</a>
<a class="figc" href="https://tyto.echolib.re">echolib - Reference (2022-12-28)</a>
</figcaption>
</figure>
# Brut
# Source
[[
Une citation simple, et sans paragraphe
]]
# Sortie HTML
# HTML
<blockquote class="tyto">
Une citation simple, et sans paragraphe
</blockquote>

View File

@ -417,17 +417,17 @@ def b64(action, content, before, after):
if action == 'Encode':
global b64_content
b64_base64 = ''
content_bytes = content.encode("ascii")
content_bytes = content.encode("utf8")
base64_bytes = base64.b64encode(content_bytes)
b64_content = before + base64_bytes.decode("ascii") + after
b64_content = before + base64_bytes.decode("utf8") + after
return b64_content
elif action == 'Decode':
global src_content
src_content = ''
content_bytes = content.encode("ascii")
content_bytes = content.encode("utf8")
base64_bytes = base64.b64decode(content_bytes)
src_content = base64_bytes.decode("ascii")
src_content = base64_bytes.decode("utf8")
return src_content
else:

View File

@ -385,23 +385,31 @@ def wip_quotes() :
elif book: title_html = ' title="%s"'%(book)
elif date: title_html = ' title="(%s)"'%(date)
if date:
time_html_o = '<time datetime="%s">\n'%date
time_html_c = '</time>\n'
# Create HTML Quote with datas
if author:
quote_html = '<figure class="%s">\n'%set_css + \
' <blockquote class="%s"%s%s%s>\n'%(
set_css, lang, cite, title_html
) + \
' ' + time_html_o + \
'%s\n'%quote_html + \
' ' + time_html_c + \
' </blockquote>\n' + \
' <figcaption class="%s">\n'%set_css + \
' %s\n'%figc + \
' </figcaption>\n' + \
'</figure>'
else:
quote_html = '<blockquote class="%s"%s%s%s>\n'%(
quote_html ='<blockquote class="%s"%s%s%s>\n'%(
set_css, lang, cite, title_html
) + \
time_html_o + \
'%s\n'%quote_html + \
time_html_c + \
'</blockquote>'
# Replace line with final HTML Quote