This commit is contained in:
Cyrille L 2023-12-30 18:52:52 +01:00
parent 1a32732534
commit 42bf32c640
7 changed files with 88 additions and 146 deletions

View File

@ -10,6 +10,11 @@ Tyto - Littérateur
# CURRENTLY IN DEV (in devel branch) ! # CURRENTLY IN DEV (in devel branch) !
## [1.9.53]
- Imroving output HTML
- TOC is now <nav aria-labelledby="navigation-0">
- update (work in progress) tpl_files/styles.css default doc references
## [1.9.52] ## [1.9.52]
- fix toc_N in HTML ID titles - fix toc_N in HTML ID titles
- fix navbar, when getting article title - fix navbar, when getting article title

View File

@ -1,4 +1,4 @@
# Very early IN dev code # This software needs tests !
This program can be tested and should mainly work. Please report any problems This program can be tested and should mainly work. Please report any problems
Tyto - Littérateur is translated in french and english. Tyto - Littérateur is translated in french and english.

2
debian/control vendored
View File

@ -1,5 +1,5 @@
Package: tyto Package: tyto
Version: 1.9.52 Version: 1.9.53
Section: custom Section: custom
Priority: optional Priority: optional
Architecture: all Architecture: all

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# version: 1.9.52 # version: 1.9.53
# Tyto - Littérateur # Tyto - Littérateur
# Copyright (C) 2023 Cyrille Louarn <echolib+tyto@a-lec.org> # Copyright (C) 2023 Cyrille Louarn <echolib+tyto@a-lec.org>

View File

@ -264,7 +264,9 @@ def set_footer_raw(mod):
# ---------------------------------- " # ---------------------------------- "
footer_menu = "<!-- Links from domain configuration [WEBSITE_FOOTER] -->" footer_menu = "<!-- Links from domain configuration [WEBSITE_FOOTER] -->"
footer_link = \ footer_link = \
'\n<li class="footer_item"><a href="%s" title="%s %s">%s</a></li>' '\n<li class="footer_item">' + \
'<a class="footer_item_link" href="%s" title="%s %s">%s</a>' + \
'</li>'
for key, value in domain.cf.items("WEBSITE_FOOTER"): for key, value in domain.cf.items("WEBSITE_FOOTER"):
try: try:
@ -297,10 +299,10 @@ def set_footer_raw(mod):
tyto_site_link = "https://tyto.echolib.re/" tyto_site_link = "https://tyto.echolib.re/"
tyto_code_link = "https://forge.a-lec.org/echolib/tyto-litterateur" tyto_code_link = "https://forge.a-lec.org/echolib/tyto-litterateur"
footer_tyto = \ footer_tyto = \
'%s <a class="footer_item_link" href="%s" title="%s">'%( '%s <a class="footer_cr_link" href="%s" title="%s">'%(
langs.site.tyto_credit, tyto_site_link, langs.site.off_website) + \ langs.site.tyto_credit, tyto_site_link, langs.site.off_website) + \
'Tyto - Littérateur' + \ 'Tyto - Littérateur' + \
'</a> [<a href="%s" title="Tyto - Littérateur">'%tyto_code_link + \ '</a> [<a class="footer_cr_link" href="%s" title="Tyto - Littérateur">'%tyto_code_link + \
'%s'%langs.site.source_code + \ '%s'%langs.site.source_code + \
'</a>]' '</a>]'
@ -584,7 +586,7 @@ sidebar_html = """
sidebar_item = """<li class="sidebar_item"> sidebar_item = """<li class="sidebar_item">
<h3 class="sidebar_post_title"><a class="sidebar_post_link" href="%s">%s</a></h3> <h3 class="sidebar_post_title"><a class="sidebar_post_link" href="%s">%s</a></h3>
<div class="sidebar_post_about"> <div class="sidebar_post_about">
<p title="%s -- %s, %s">%s</p> <p class="sidebar_post_about_p" title="%s -- %s, %s">%s</p>
</div> </div>
</li>""" </li>"""
@ -596,7 +598,7 @@ footer_raw = """
<h2 id="footer_title">%s %s</h2> <h2 id="footer_title">%s %s</h2>
<div id="footer_about_menu"> <div id="footer_about_menu">
<div id="footer_about"> <div id="footer_about">
<p id="footer_about">%s</p> <p id="footer_about_p">%s</p>
</div> </div>
<nav id="footer_menu" aria-labelledby="navigation-3"> <nav id="footer_menu" aria-labelledby="navigation-3">
<ul id="footer_items"> <ul id="footer_items">

View File

@ -254,9 +254,12 @@ def toc():
else: tyto_list = "%s\n%s"%(tyto_list, line) else: tyto_list = "%s\n%s"%(tyto_list, line)
l = convert_list(tyto_list, mark_ul, mark_ol) l = convert_list(tyto_list, mark_ul, mark_ol)
l = l.replace(">", ' class="toc">', 1) l = l.replace(">", ' class="toc_items">', 1) # First ul> or ol>
l = l.replace("<li>", ' <li class="toc">') l = l.replace("<li>", ' <li class="toc_item">')
l = '<h2 class="toc">%s</h2>\n%s'%(langs.site.toc, l) l = '<h2 class="toc_title">%s</h2>\n'%langs.site.toc + \
'<nav class="toc" aria-labelledby="navigation-0">\n' + \
'%s'%l + \
'</nav>'
replace_article("! TOC", l) replace_article("! TOC", l)
@ -785,7 +788,7 @@ HTMLs = {
"file" : '<a class="%s file" href="%s" title="%s">%s</a>', "file" : '<a class="%s file" href="%s" title="%s">%s</a>',
"abbr" : '<abbr class="%s" title="%s" lang="%s">%s</abbr>', "abbr" : '<abbr class="%s" title="%s" lang="%s">%s</abbr>',
"title" : '<h%s id="toc_%s" class="%s">%s</h%s>', "title" : '<h%s id="toc_%s" class="%s">%s</h%s>',
"toc" : '%s <a class="toc %s" href="#toc_%s">%s</a>', "toc" : '%s <a class="toc_item_link %s" href="#toc_%s">%s</a>',
"strongs" : ('<strong class="%s">', "</strong>"), "strongs" : ('<strong class="%s">', "</strong>"),
"bolds" : ('<b class="%s">', "</b>"), "bolds" : ('<b class="%s">', "</b>"),
"underlines" : ('<u class="%s">', "</u>"), "underlines" : ('<u class="%s">', "</u>"),

View File

@ -10,6 +10,48 @@
/* Contains all website, after <body> */ /* Contains all website, after <body> */
div#site_container {} div#site_container {}
/* div contains <article> and <aside> */
main#article_aside {}
/* ----------------------------------------------------------------------------
* Article contents styles
*/
article#article {}
header#article_header {}
h1#article_title {}
a#article_title_link {}
div#article_refs {}
a#post_code {}
/* ! TOC */
h2.toc_title {}
nav.toc {}
ul.toc_items {}
li.toc_item {}
/*Also css from DOMAIN*/
a.toc_item_link {}
/* TITLES
* ------
* Order title show id="toc_1", id="toc_2".... for h2 to h6
* h2 to h6 class set to css DOMAIN (default "tyto")
*/
h2.tyto {}
h3.tyto {}
h4.tyto {}
h5.tyto {}
h6.tyto {}
/* Misc in <article>
* -----------------
* "tyto" is default css DOMAIN.
* Class can be set for these markers
*/
p.tyto {}
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* Header (Wensite Logo, Description) * Header (Wensite Logo, Description)
@ -33,145 +75,35 @@ li.menu_item {}
a.menu_link {} a.menu_link {}
/* div contains <article> and <aside> */
main#site_article_aside {}
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* Article contents styles * Sidebar navbar (Website)
*/ */
/* Template article */ aside#sidebar {}
article#site_article {} h2#sidebar_title {}
header#site_article_header {} nav#sidebar_menu {}
h1#site_article_title {} ul#sidebar_items {}
a#main_title {} li.sidebar_item {}
footer#site_article_footer {} h3.sidebar_post_title {}
/* In <footer> for <article> */ a.sidebar_post_link {}
p#post_metas {} div.sidebar_post_about {}
a#post_code {} p.sidebar_post_about_p {}
/* Generic for all links <a class="tyto" */
a.tyto {}
/* Specific link for target file <a class="tyto file"> */
a.file {}
/* Specific link for non target file <a class="tyto link" */
a.link {}
/* anchor link to target anchor <a class="tyto anchor_link" */
a.anchor_link {}
/* a#YOURCSS {} */
/* Generic for all target anchors*/
a.anchor_target {}
/* hr and br */
hr.tyto {}
br.tyto {}
/* Titles */
h2.tyto, h3.tyto, h4.tyto, h5.tyto, h6.tyto {}
/* Paragraphs */
p.tyto {}
/* abbr */
abbr.tyto {}
/* Words tags (strong, em, u...)*/
strong.tyto {}
b.tyto {}
em.tyto {}
u.tyto {}
i.tyto {}
cite.tyto {}
q.tyto {}
del.tyto {}
/* code for blockquote */
code.tyto {}
code.bcode {}
/* A line contains */
p.bcode {}
span.ln {}
span.line {}
/* Generic class for both ln, line*/
span.bcode {}
/* When using _code:NAME */
/* ! No class a.tyto */
footer.bcode {}
a.bcode {}
/* div when using markers [[ ... ]] */
div.tyto {}
/* Blockquote */
blockquote.tyto {}
footer.quote()
p.quote {}
/* has also a.tyto */
a.quote {}
/* Lists ol, ul, li */
/* ! sub ol and sub li have NO class */
ol.tyto {}
ul.tyto {}
li.tyto {}
/* Images */
/* Generic image link */
a.image {}
/* Logo */
a.post_logo {}
img.post_logo {}
/* Legacy image link has also a.tyto OR a.MYCUSTOMCSS */
img.tyto {}
/*
* ----------------
* Sitemaps article
*/
p.sitemap {}
ul.sitemap-items {}
li.sitemap-item {}
/* Also a.tyto */
a.sitemap {}
/* ----------------------------------------------------------------------------
* Sidebar (Website)
*/
aside#site_sidebar {}
nav#site_sidebar_menu {}
ul#site_sidebar_items {}
li.site_sidebar_item {}
/* Around div.site_sidebar_block */
a.site_sidebar_link {}
div.site_sidebar_block {}
header.site_sidebar_header {}
p.site_sidebar_title {}
footer.site_sidebar_footer {}
img.site_sidebar_image {}
p.site_sidebar_about {}
/* ============================================================================ /* ============================================================================
* Footer (Website) * Footer (Website)
*/ */
footer#site_footer {} footer#footer {}
div#site_footer_infos {} h2#footer_title {}
p#site_footer_title {} div#footer_about_menu {}
p#site_footer_about {} div#footer_about {}
nav#site_footer_menu {} p#footer_about_p {}
ul#site_footer_items {} nav#footer_menu {}
li.site_footer_item {} ul#footer_items {}
/* Also a.tyto */ li.footer_item {}
a.site_footer_item_link {} a.footer_item_link {}
p#site_footer_copyright {} div#footer_credit {}
p#footer_copyright {}
p#footer_tyto {}
a.footer_cr_link {}
/* After footer, TYto, credential */
div#Tyto_links {}
a.generator {}