From d7242c6452ea0560a0d3ea37b0d08c5bfdb5d7b1 Mon Sep 17 00:00:00 2001
From: Cyrille LOUARN
Date: Thu, 2 Nov 2023 15:32:13 +0100
Subject: [PATCH] [1.9.30] - 'wip' about all HTML markers done
---
CHANGELOG.md | 4 +
README.md | 158 +++++++++++++++++-
debian/control | 2 +-
src/usr/bin/tyto | 2 +-
.../program/__pycache__/check.cpython-311.pyc | Bin 43875 -> 43981 bytes
.../program/__pycache__/debug.cpython-311.pyc | Bin 4028 -> 4088 bytes
.../program/__pycache__/post.cpython-311.pyc | Bin 11436 -> 11511 bytes
.../program/__pycache__/tyto.cpython-311.pyc | Bin 1447 -> 1476 bytes
.../program/__pycache__/wip.cpython-311.pyc | Bin 16455 -> 20079 bytes
src/var/lib/tyto/program/check.py | 9 +-
src/var/lib/tyto/program/debug.py | 1 +
src/var/lib/tyto/program/post.py | 6 +-
src/var/lib/tyto/program/tyto.py | 5 +-
src/var/lib/tyto/program/wip.py | 96 ++++++++++-
.../__pycache__/logs_fr.cpython-311.pyc | Bin 3268 -> 3313 bytes
src/var/lib/tyto/translations/logs_en.py | 1 +
src/var/lib/tyto/translations/logs_fr.py | 7 +-
17 files changed, 274 insertions(+), 17 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06e0f36..243d6f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@ Tyto - Littérateur
# CURRENTLY IN DEV (in devel branch) !
+## [1.9.30]
+- 'wip' process
+- - About all markers done !
+
## [1.9.29]
- Translations
- - added for logs (english)
diff --git a/README.md b/README.md
index fa9615c..b8323d5 100644
--- a/README.md
+++ b/README.md
@@ -6,13 +6,15 @@ This program can ve tested but not at all usable. Lots of work to do...
# Get commands list help
tyto
```
+# Create new domain
+- create a domain directory, line www.domain.tld
+- Go to this directory
+- type `tyto new domain`
-## ToDo next (working on)
-- added lists to post database (prepared wip)
## Working on
- 'wip' action processes
-- - images module
+- Create HTML full page from article
## ToDo
- thinking about creating an auto top article menu from titles
@@ -43,13 +45,14 @@ date: 2023-10-27
# Données unique sur UNE ligne optionnelle
# Si non définit, le logo du domaine est utilisé
# Ne sera affiché qu'avec _image:logo
-logo: post-logo.png
+logo: logo.png
# Données multiples sur 3 lignes
# [TAG]: Nom
# LIEN
# Text alternatif
+# Reprendre dans l'article : __cliquer sur ce lien
link: cliquer sur ce Lien
https://
Text alternatif
@@ -58,21 +61,29 @@ link: Réservez ici
https://
Billets
+# Reprendre dans l'article : --télécharger ce fichier
file: télécharger ce fichier
@/PDFs/hello.pdf
Un PDF !
+# Reprendre dans l'article : _code:codetest
code: codetest
@RAWS/test.py
Exemple d'un code Python
+# Reprendre dans l'article : _image:mypic
+image: mypic
+ @hello.png
+ Text Alt
+
# Les abréviations :
# 2eme ligne: Texte alternatif
# 3ème ligne: valeur affichée dans l'article à la place du Nom
abbr: HTML
HuperText Markup Langage
HTML
-
+
+# Reprendre dans l'article : ;;css
abbr: css
Cascading Stylesheet
CSS
@@ -215,4 +226,141 @@ abbr: css
#2 Un block code depuis un fichier
_code:codetest
+# Afficher une image (1 tag par ligne)
+# ------------------------------------
+#2 Les images
+# Placer le logo de l'article
+_image:logo
+
+# Marqueur avec options
+# ! Les images dans cet exemple sont affichées à la suite
+# Placer "|", ou mettez une image dans un paragraphe "((...))"
+# ou appliquer un style css de type display:block
+# les options des marqueurs:
+# - c=CLASS < Sinon la classe est celle du domaine
+# - w=WIDTH < longueur (si pas d'unité : défaut "px")
+# - h=HEIGHT < Comme w=
+# - f=Ma légende sous l'image (ajoute )
+# - - Recommandé d'utiliser cette option en dernier
+((
+ _image:mypic
+ _image:mypic c=MYCSS
+ _image:mypic c=PIC w=60em h=30% f=echolib sur une chaise
+))
+
+```
+
+## Output HTML
+```
+
+
+
+
+Go to uniq1 anchor
+
+Titre en h2
+
+ Un long paragraphe...
+
+
+
+ Il faut cliquer sur ce Lien , Réservez ici et télécharger ce fichier
+ ou encore faire une CSS pour du beau rendu HTML
+
+
+ Un court paragraphe de 1984 pour de vrai faux en gras
+ Il faut le souligner et Très Gras
+
+ <ol>, <ul>
+ {_Afficher un icode brut_}
+
+Block Code
+
+1 # Un commentaire et du code
+2 def hello(world):
+3 world and print(world) or print("NoMore")
+
+Marqueurs de mots
+
+ Même si, il est possible d'écrire directement des balises (HTML), Tyto
+ propose de les simplifier, en entourant les mots avec des marqueurs. La
+ classe CSS du domaine est utilisée pour chaque marqueur.
+
+
+1 *_Très Gras_* > <strong>
+2 +_En Gras_+ > <b>
+3 [_Citer un texte_] > <q>
+4 :_Citer une référence_: > <cite>
+5 ~_Texte barré_~ > <del>
+6 ._Text souligné_. > <u>
+7 /_En italique_/ > <em>
+8 ;_En italique_; > <i>
+9
+10 # Marques multiples, ajouter "&"
+11 *_&._Très gras et souligné_.&_*
+
+
+Citation
+
+
+
+
+
+
+ mycite
+Here, i am
+
+
+
+
+
+Une liste mixée <ol>, <ul>
+
+
+ numeric o: item 1
+
+ numeric ol sub-Item 1
+
+ numeric ol sub-sub-item 1
+
+
+
+
+
+
+Un block code depuis un fichier
+
+
+1 #================================#
+2 # Searching options in arguments #
+3 #--------------------------------#
+4 def get_options():
+5 global dlogs, force, erron
+6
+7 dlogs = force = erron = False
+8 for arg in range(1, len(sys.argv)):
+9 dlogs = sys.argv[arg] in tyto.debug_options
+10 force = sys.argv[arg] in tyto.force_options
+11 erron = sys.argv[arg] in tyto.debug_errors
+12
+13 print("<li>my 'cafe !</li>")
+14
+
+
+Les images
+
+
+
+
+echolib sur une chaise
+
```
diff --git a/debian/control b/debian/control
index 4b3cb0b..4b9580c 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,5 @@
Package: tyto
-Version: 1.9.29
+Version: 1.9.30
Section: custom
Priority: optional
Architecture: all
diff --git a/src/usr/bin/tyto b/src/usr/bin/tyto
index 0b9734a..cad1efe 100755
--- a/src/usr/bin/tyto
+++ b/src/usr/bin/tyto
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Version: 1.9.29
+# Version: 1.9.30
# Updated: 2023-10-18 1697613100
# Tyto - Littérateur
diff --git a/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/check.cpython-311.pyc
index 78955bbcf7708cf1644347d407d50688349820ff..0e09008d0fea17adc67891e620ff29afe9831a73 100644
GIT binary patch
delta 995
zcmYjPZ%k8H6z_SjeZ^uYR(K6nvC?O&2t!>E1Y^S=MK{C{%e2+hf2A1-0eyC6A>~gY
zlEoB*9urHH1eP+(vMi2^23_VffoL?wh=SNT`LIPI`vTd%%xT;`&o8^l`@M61=XcIM
z=idAKl<@GGV7_8Dn{<3VJyBlQ{-gQ*MpG*HME?D?lgXRLB=`ph+?iOvdnq$)SqgAK
zb2k)QpbN{3Upd2KAS;wYB|fY`R#+r1kQFpFOFCVPu}5h9g_79kB|{Rt87{jaKq;}_P|GOF2r3DNQ9kZ~
z8CHD!wZW9e8SUI&Vcx03P{z)ldSHMl<_ime?JbHBO2ON9yAa6YUN$k(hcm)Q2QuIm
z-fHSEjfhQ3br6z#|=Yc!3=qXW%B9J6(ckz|Eb7DSpsb!Gg|@Uv}n$j}3Mn1K5U(
zPFF(_?ms;Z3U2H=S=Im9we%6&Xz9qxX?b~{=d!o|#N~sDf@{i1&S=d@-gx?$?Oy2^
z1!J}IM!nOzpwr9N1!Iay{#(ako?t<WZ2-U{EaGu>tpe#KZ%H6MDm=TpfJT)!F%&t)4FZcd>8+>9ZITS-=S
zew_rXupzb;{>7o#hAk7k_8YJ_3%PcWs&HqA`i{2K9>G~|t+S|3s&|aoDgrA(5-q)o
zpaA~XWR)Bw$idp)ui+2&viFh+#;`eF1bxWjxvASI8l)sQ&c!QX3O5aAudgJQ#!H$)
zbzg-JHPkoOom6$i9wn{zh=$3!i*17*C}2+qe-@;1V&?E-La}9#)I?NvNS6n<%29Ag;dsrtjtQC8s+5EBt(lTX2e$N
zk#Z)X=(J&$dI^z==s^TM$iQ+&7W5$dC#C-BL3Z!gKV7)Ld(Q9t?z!jO^Yj(>{w1gB
z)o4^Qx=t8U3T=a$*)^D;2!`$L0aWSBaaJ=S1^?Xn9VIG7t|G^LbpO(2<>)ALY=2F$FbMM=oS}=fE?J
zIuIwcGo}km4>ZFdfjq}N7{y|zP5pxLVGKI3&1sy=bQ8kX%{#WF?xy;C&ecMIMSJn?
zDg!6pz>qS%dWbRU3_FSLC>vdJ5>RDBx^;tihMnl0AR)l*G71O#V!kU
zq1zP+ZFtLNTTm5J<}9zsJL)WQnoEuyDk>B&;un`40+?JY3Vrkiu^)$P&F~t>YtO<6
z=GWP{uX1$P#RlbqJQHSQx%jv)5^~6|x_p2{%&XrHv3RY194y#yx;*Z=b^XBcH+o~s
zk&gK-$9(qgy#vslJCHi9;FlR@WW3%mqg1N&-(?i08O%tQ4$s#wB>Ngt74Qi=-D$My
z&+cTk^rcg*tS=btSqp#A;aLfj*zB=_7Kc3v&`G{~G(1co*R-8BoYk~VSPE2c#?Gct
zg@u}<_^9cvBAi+Qa0Km*vUoV&@t%SAB%|$;3hv{F?l@@2CB6uCB8xiMog}pT
z(qRnSeW5GU7|XhwP*oJ3pc5%6Ei4yjnd~rw6b6F~9^#bG4(mu#&uvb4z?dlnztyN?
r8Enj#3X(2J102I-zg=LR)1th78|)!>{Vkv^0tlIw{fGOpsL$~i=yWg-
diff --git a/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/debug.cpython-311.pyc
index a0d444670459e0abb27e2ae01d7e8a0b375ec9e1..4395ed23685ae8a4d41554b7f2564d505e522fd4 100644
GIT binary patch
delta 881
zcmZwFyKfUg5C`Dh;Cpb%oe6;i@Y(mW4SAdr6CgaCh$OrMQhGqaLb;$Q0VkY|Xs}$-
zL4j666o?KXN)$>uN+h7*51^%+B1niTJ8Lv{!ASel?x#8J?cILz{&@B~+qRgj`TD}z
zmlt-e&ow^OziDDc_rIf6A{<9J(F3ChV?8jAFhNj)7-5QOX6HmcR1n%HNg|j=IYm%_(+Fn>
z0+>NKOW?sdg!4Uc0ij9|!Ysl?PEvq*j4v)tB7IG6TO8@zHrYen;NKbQ)t4125-$mZmu0mhsoD
ZKG;eg-CvtanT)*e}yk@eMOQ>-mv+-VQTR3raW
zJ#d2jk1v{rZS~R_ljECP&br)OcBiGgs(C{9XIrY>|F)IptnWGNb?w#2H@8HV{v=yi
zb_W8=1004D?F6_CMd}9(Fht}5e1?z;fL#m`?FQ^I(89U_?S<^)l9=`b28EUHY@|vD
z00$W&Is_PEh^YuDF;pl3lo=8V0TDw$aoW;SVX07pk}5+&HGn`IX06f@z|kHU28{H;
zC?I91(J{cdu$;~xMKl3uO|m3(0&+8Dg3OoM8y*EZ|%ZOao>Z%5)JhD_JUZ
zNrEmLS~M3Q(-mV^yJZnwGjzR63EeO>*QJo=4J~vjrkjRDsy6(R`s@!4-uef6RdbR%
zL~h{MvLgS*=pFqMvq{8p1Rm!Hkv+w@p<~-Q|75lP{PD_6mZ^7zsra^(K8gRQnf4dX
C^yjYt
diff --git a/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc b/src/var/lib/tyto/program/__pycache__/post.cpython-311.pyc
index 0bb6fd422dc6b5954f5affe6a636c5cf8b118fd3..e417c3e1138ce9735270df12c94913bb170d1925 100644
GIT binary patch
delta 526
zcmZ1z`8|?vIWI340}!k$a7tA)*vR)mj46t7vZH{AP6-Q090IbLL39yQ3R5CO3S%O3
z2?taHNENG=a7{kRtiT0PR4h;;F!`c@NJt7(HWOGEGf)?Eo_vWYLQfVqj9mg&1K}at
zxC|)18ZMW}478P}L<-p+9*8~lMJzz`c~TgH8F1Ku@PUIt
zNW8)NE*sBOj!SG37uY0jh)6VKKj0DEyjQ}PiM0Tz>dj_;>0U<0+{trgblFOP0*s8C
zFUaUIGnP&MFR#v6JXu}AgtZAM&bK*1;XM;$+vEV{86wR`vZH_qOR;JR%j5=bv6w6tkOC0MW(JYP
z0wrKAAT|R-78`_SU`S!gW&*K`m{XV%8S>;y_+c_YRU9yOi4cs%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HJ7%f
z`)Z_D0q%Lny)zP3yI#P^e@mGGdCVBU$jO#cT(pOD{%Y_SJU2-wCWW)4QIy+1;0KE4
z5l~0k5APrCGltQ`izDs;6}>Jx4$ocaNO2o<8GbsN)YrI4_~VR#fBe(VeWdfA^bZ_|
O>*KG;CkQ+-G5I(1{6Cif
diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py
index 53efbfa..b9f8534 100644
--- a/src/var/lib/tyto/program/check.py
+++ b/src/var/lib/tyto/program/check.py
@@ -459,8 +459,8 @@ def ml_tag_values(ln, tag, stats):
post.stats_text_images += post.text_contents.count(tyto_value)
post.cf_set("STATS_TEXTS", "images", str(post.stats_text_images))
html_value = tyto.image_link%(
- value2, "%%s image", "%%s",
- value3, value3, "%%s"
+ value2, "%%s image", value3,
+ "%%s", value2, "%%s", value3, value3, "%%s", "%%s"
)
# raw: (content file converted to base64)
@@ -893,8 +893,9 @@ def sl_stags():
"IMAGES",
"html_%s"%(post.ml_tags_stats["image:"] + 1),
tyto.image_link%(
- post.logo[1], "post_logo image", "%%s",
- post.title[1], post.title[1], "%%s"
+ post.logo[1], "%%s image", post.title[1],
+ "%%s", post.logo[1], "%%s", post.title[1], post.title[1],
+ "%%s", "%%s"
)
)
diff --git a/src/var/lib/tyto/program/debug.py b/src/var/lib/tyto/program/debug.py
index b7faf0a..90c9b44 100644
--- a/src/var/lib/tyto/program/debug.py
+++ b/src/var/lib/tyto/program/debug.py
@@ -103,6 +103,7 @@ def out(nbr, var, val, show, color, stop):
103 : langs.logs.website_lang,
104 : langs.logs.domains_no,
105 : langs.logs.domain_off,
+ 106 : langs.logs.warn_post_chk,
# Great (200-255)
200 : langs.logs.load_file,
201 : langs.logs.lang_logs_sys,
diff --git a/src/var/lib/tyto/program/post.py b/src/var/lib/tyto/program/post.py
index 5c6f552..678bd99 100644
--- a/src/var/lib/tyto/program/post.py
+++ b/src/var/lib/tyto/program/post.py
@@ -201,9 +201,13 @@ def cf_datas():
# Used to do processes (mainly) #
#-------------------------------#
def compare_datas():
- global do_chk, do_wip
+ global do_chk, do_wip, has_changed
# check can be done ?
+ has_changed = False
+ if wrk_id != chk_hash:
+ has_changed = True
+
do_chk = False
if chk_errors or \
chk_static != domain.static or \
diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py
index 5d36756..603fe75 100644
--- a/src/var/lib/tyto/program/tyto.py
+++ b/src/var/lib/tyto/program/tyto.py
@@ -106,10 +106,13 @@ code_line = '' + \
'%s ' +\
'
'
-image_link = '%s '
+image_link = '' + \
+ '%s ' + \
+ '%s '
a_link = '%s '
quote = """%s
%s%s
%s
"""
+
diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py
index 0a00833..c90fa8f 100644
--- a/src/var/lib/tyto/program/wip.py
+++ b/src/var/lib/tyto/program/wip.py
@@ -84,7 +84,7 @@ def is_article(target):
if targets: return
else: sys.exit(post.error)
- print("> wip:", target)
+ print("\n> wip:", target)
print(html_post)
@@ -105,6 +105,10 @@ def convert(target):
post.error = debug.out(10, "'check'", post.uri, True, 2, False)
return False
+ if post.has_changed and not args.force:
+ post.error = debug.out(106, "'check'", post.uri, True, 1,False)
+ return False
+
# Get raw post from database
raw_post = tools.b64_convert("decode", post.cf.get("TEXTS", "post"))
@@ -119,6 +123,7 @@ def convert(target):
words_tags()
sl_tags()
+ images()
value_replace("COMMENTS", False, False)
value_replace("ABBRS", False, False)
@@ -240,6 +245,95 @@ def sl_tags():
text_replace(line, post.anchor_target[1]%css)
+#
+#
+#
+def split_size(size):
+ tup_size= (
+ ''.join(filter(str.isdigit, size)) or "",
+ ''.join(c for c in size if not c.isdigit()) or "px"
+ )
+
+ if not tup_size[0]:
+ return ""
+
+ return tup_size[0] + tup_size[1]
+
+#=============================#
+# Convert images tags to HTML #
+#-----------------------------#
+def images():
+ global html_post
+
+ for key, val in post.cf.items("IMAGES"):
+ if key.startswith("html"):
+ continue
+
+ # Get target value by replacing key with html
+ html_key = key.replace("image", "html")
+ html_val = post.cf.get("IMAGES", html_key)
+
+ # Search tag from val in html_post
+ for ln, line in enumerate(html_post.rsplit("\n")):
+ if line.lstrip().startswith(val):
+ css = domain.css
+ width = height = figure = figcap_o = figcap_c = style = ""
+ options = line.split()
+ markers = ('c=', 'w=', 'h=','f=')
+
+ # Specific CSS class for _image:logo
+ if options[0].rsplit(":")[1] == "logo":
+ css = "post_logo"
+
+ for option in options:
+ # was activated with f=
+ if figure and not option.startswith(markers):
+ figure = "%s %s"%(figure, option)
+
+ # CSS (default domain css)
+ try: css = option.rsplit("c=")[1]
+ except: pass
+
+ # >idth:
+ try:
+ width = option.rsplit("w=")[1]
+ width = split_size(width)
+ print("wip: size =", width)
+ except:
+ pass
+
+ # Height
+ try:
+ height = option.rsplit("h=")[1]
+ height = split_size(height)
+ print("wip: size =", height)
+ except:
+ pass
+
+ try: figure = option.rsplit("f=")[1]
+ except: pass
+
+ # i`B9Q@IWI340}wdoIi*SnPUMqdyf#sN7OQHMY6{21Vj3%2;a2#gj<1J4t%8M_^FD{8s&dA=}#l_Fa
tWewEC2*ky5lNWPu6Bg8L;JzWC+Q4-~K&yfChJaE7@8oozNES<=5&)sDD;xj-
delta 102
zcmew;c|?+LIWI340}$}XIi!9Rn8+u=cxj^gELM&v)fCl<$4pp)88nSIGckT=+RVpt
ziG|U4^FxlqjGH%e@iB5)0kts#ak1p&)7;zm1T-4BZ}6)$aNXe7Y~Y+cg(s550w@ar
Dqw^aV
diff --git a/src/var/lib/tyto/translations/logs_en.py b/src/var/lib/tyto/translations/logs_en.py
index e65e301..2c76636 100644
--- a/src/var/lib/tyto/translations/logs_en.py
+++ b/src/var/lib/tyto/translations/logs_en.py
@@ -76,6 +76,7 @@ err_post_global = "Article Error"
warn_no_dom = "Domain not configured"
domain_off = "Domain deactivated"
reset_dom = "RESET domain"
+warn_post_chk = "Article changed"
# infos
load_file = "File loaded"
diff --git a/src/var/lib/tyto/translations/logs_fr.py b/src/var/lib/tyto/translations/logs_fr.py
index 061786e..3c0fd33 100644
--- a/src/var/lib/tyto/translations/logs_fr.py
+++ b/src/var/lib/tyto/translations/logs_fr.py
@@ -73,9 +73,10 @@ err_post_id_yet = "Identité déjà utilisée"
err_post_global = "Article erronné"
# Warnings
-warn_no_dom = "Domaine non configuré"
-domain_off = "Domaine désactivé"
-reset_dom = "RÉINITIALISE le domaine"
+warn_no_dom = "Domaine non configuré"
+domain_off = "Domaine désactivé"
+reset_dom = "RÉINITIALISE le domaine"
+warn_post_chk = "Article modifié"
# infos
load_file = "Fichier chargé"