From 1a32732534d84270306e65ec6e5ff57a3844e314 Mon Sep 17 00:00:00 2001 From: Cyrille LOUARN Date: Sat, 30 Dec 2023 11:42:57 +0100 Subject: [PATCH] [1.9.52] --- CHANGELOG.md | 8 ++++++- README.md | 3 ++- debian/control | 2 +- src/usr/bin/tyto | 2 +- src/var/lib/tyto/program/debug.py | 1 + src/var/lib/tyto/program/modules.py | 17 ++++++++++++--- src/var/lib/tyto/program/wip.py | 2 +- src/var/lib/tyto/tpl_files/styles.css | 27 ++++++++++++------------ src/var/lib/tyto/translations/logs_en.py | 4 ++-- src/var/lib/tyto/translations/logs_fr.py | 6 +++--- 10 files changed, 45 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70830c5..a574322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,18 @@ Tyto - Littérateur # CURRENTLY IN DEV (in devel branch) ! +## [1.9.52] +- fix toc_N in HTML ID titles +- fix navbar, when getting article title +- update (work in progress) tpl_files/styles.css default doc references +- add logs (verbose) when adding an item in navbar, sidebar module + ## [1.9.51] - Translated english logs - Some commands cannot be used if domain is not activated - New [action] "show": show files contents [multiple targets] - fix typo in metas module -## [1.9.51] +## [1.9.50] - Complete new code diff --git a/README.md b/README.md index ae2b319..135a7fd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ This program can be tested and should mainly work. Please report any problems Tyto - Littérateur is translated in french and english. +Official website not yet udpated for this new version. # Commands ``` @@ -20,7 +21,7 @@ tyto help words anchor - Go to this directory - type `tyto new domain` - type `tyto check domain` and PLEASE, CHECK configuration file -- create in new directory domain ".../articles/", an article (see help) +- create in new directory domain ".../articles/", an articl file [myfile].tyto (see help) - type `wip myfile.tyto` diff --git a/debian/control b/debian/control index 52dfd19..ced8131 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: tyto -Version: 1.9.51 +Version: 1.9.52 Section: custom Priority: optional Architecture: all diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto index 2754186..1e32e0e 100755 --- a/src/usr/bin/tyto +++ b/src/usr/bin/tyto @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# version: 1.9.51 +# version: 1.9.52 # Tyto - Littérateur # Copyright (C) 2023 Cyrille Louarn diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py index 4160488..9eb4c03 100644 --- a/src/var/lib/tyto/program/debug.py +++ b/src/var/lib/tyto/program/debug.py @@ -76,6 +76,7 @@ def set_messages(): 205 : langs.logs.inf_file_create, 206 : langs.logs.inf_file_upd, 207 : langs.logs.inf_dir_create, + 208 : langs.logs.inf_add_item, 210 : langs.logs.inf_check_post, 211 : langs.logs.inf_wip_process, 212 : langs.logs.inf_mod_process, diff --git a/src/var/lib/tyto/program/modules.py b/src/var/lib/tyto/program/modules.py index f320ac6..3d0f28d 100644 --- a/src/var/lib/tyto/program/modules.py +++ b/src/var/lib/tyto/program/modules.py @@ -366,7 +366,7 @@ def create_navbar_html(html_file): continue # Item has a "title" set with # as separator - set_dir = line.rstrip() + set_dir = line.rstrip() # Set_dir begins with "/" ; apply correction @@ -389,13 +389,21 @@ def create_navbar_html(html_file): if cf_load(ln, set_dir + "/index.tyto", "navbar"): try: set_title = cf.get("ARTICLE", "title") except: continue + else: + continue # Check and inform if not index.html exists srv_index_html = domain.wip + "/index.html" if not os.path.exists(srv_index_html): debug.out(11, "%s. navbar (404) wip/%s/index.html"%( ln, set_dir - ), files["navbar"]["wrk"], True, 1, False) + ), files["navbar"]["wrk"], True, 1, False) + continue + + debug.out(208, "navbar. %s"%( + cf.get("ARTICLE", "title") + ), files["navbar"]["wip"], False, 0, False + ) # Create menu links if not menu_links: @@ -448,7 +456,10 @@ def create_sidebar_html(html_file): continue items += 1 - print("> -",items, cf.get("ARTICLE", "title")) + debug.out(208, "sidebar. %s. %s"%( + items, cf.get("ARTICLE", "title") + ), files["sidebar"]["wip"], False, 0, False + ) if not html_items: html_items = sidebar_item%( diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index f6debdb..d09c672 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -192,7 +192,7 @@ def titles(): for title in sorted_titles: line = HTMLs["title"]%( (int(title[1]) + 1), # #"1" = h"2"... - nbr, domain.web["css"], # nbr fot toc_X CSS ID + titles[title], domain.web["css"], # nbr fot toc_X CSS ID title[3:], # title without marker (int(title[1]) + 1) # ) diff --git a/src/var/lib/tyto/tpl_files/styles.css b/src/var/lib/tyto/tpl_files/styles.css index 13e9ade..31fd6ab 100644 --- a/src/var/lib/tyto/tpl_files/styles.css +++ b/src/var/lib/tyto/tpl_files/styles.css @@ -14,25 +14,24 @@ div#site_container {} /* ---------------------------------------------------------------------------- * Header (Wensite Logo, Description) */ -header#site_header {} -/* Website Logo */ -div#site_logo {} -a#site_logo_link {} -img#site_logo_image {} -/* Website about*/ -div#site_infos {} -p#site_infos_title {} -p#site_infos_text {} +a#site_link {} +header#header {} +div#header_logo {} +img#header_logo_image {} +div#header_abouts {} +p#header_title {} +p#header_about {} + /* ---------------------------------------------------------------------------- * Menu navbar (Website) */ -nav#site_menu {} -menu#site_menu_items {} -li.site_menu_item {} -/* also a.tyto {} */ -a.site_menu_link {} +nav#menu {} +menu#menu_items {} +li.menu_item {} +a.menu_link {} + /* div contains
and