add_sclt.sh.
cette commande se décompose en un programme principal et des sous programmes en français et en anglais d'autres langues peuvent s'ajouter en fonction des livres de sites wikibooks autres que et 
VERSION=211006
TEXTDOMAIN=add_sclt
TEXTDOMAINDIR=/usr/share/local
export TEXDOMAINDIR
 . gettext.sh
if [ "$0" = "./add_sclt" ]; then echo "add_sclt : Version "$VERSION; fi
 if test -e ~/Add_appendix/bin/header.inc; then source ~/Add_appendix/bin/header.inc
 else echo $"$Bindir/header.inc not found. Execute sbin/cp-src2bin.sh"; exit -1
 fi
 Projectdir=$Workdir/books/$1
 PageSclt="$Projectdir/$1.sclt"
 echo $PageSclt
 if [ "$2" = "--t" ]; 
 then 
 pwd > pwd.txt; read Localdir < pwd.txt; rm pwd.txt
 if [ "$Site" = "fr.wikibooks.org" ]; then source $Localdir/fr_sclt.inc.sh
 else source $Localdir/en_sclt.inc.sh
 fi
 else
 if [ "$Site" = "fr.wikibooks.org" ]; then source $Bindir/fr_sclt.inc
 else source $Bindir/en_sclt.inc
 fi
 fi
fr_sclt.inc.
Version=210819
cd $Projectdir
echo "créer la page $Projectdir/$1.sclt"
echo "----------"
echo "= Annexe =" > "$Projectdir/$1.sclt"
echo "" » $Projectdir/$1.sclt
echo "== Références ==" » "$PageSclt"
echo "<references />" » "$PageSclt"
echo " " » "$PageSclt"
echo "" » "$PageSclt"
echo "== Contenus ==" » $PageSclt
echo "<div style=\"font-zize:85%\";>" » $PageSclt
cat $Projectdir/$1".list" | tr ' ' '_' | tr '\n' '%' | sed "s/%/\n\n/g" » $PageSclt
echo "</div>" » $PageSclt
echo "=== Source de cette édition ===" » $PageSclt
echo "<div style=\"font-zize:85%\";>" » $PageSclt
echo -n "https://" » $PageSclt
cat $Projectdir/$1.mainPage | sed "s/\\\ /_/g" » $PageSclt
echo "</div>" » $PageSclt
echo " " » $PageSclt
echo "" » $PageSclt
echo "== Sources licences et contributeurs des articles ==" » $PageSclt
echo "<span style=\"font-zize:85%\";>Les "sources" listées pour chaque article fournissent des informations de licence plus détaillées, y compris le statut des droits d'auteurs, les détenteurs de ces droits et les conditions de licence.</span>" » $PageSclt
echo " " » $PageSclt
echo "<div style=\"font-zize:72%\";>" » $PageSclt
echo "----------"
cat $Projectdir/$1.list | awk -F"/" '{ print $NF }' > $Projectdir/$1.pj
Liste=$Projectdir/$1.pj
echo "Fichier de liste : "$Liste
 while read ligne
 do 
 echo ""
 echo " ligne lue = "$ligne
 echo ""
 mkd -pws '**' "$ligne/$ligne.html" $Projectdir/$ligne/$ligne.tmp | tr ',' '\n' > $Projectdir/$ligne/$ligne.str
 echo "*** Références : articles, src, lic, contrib. "
 if [ $ligne != $1 ]
 then 
 echo ""$ligne"" » $PageSclt
 fi
 echo ""$ligne"" > $Projectdir/$ligne/$ligne.article
 cat $Projectdir/$ligne/$ligne.article
 echo -n ", "source : "https://"$Site"/w/index.php?oldid=" > $Projectdir/$ligne/$ligne.RevisionId
 cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e wgRevisionId | tr -d ':' | sed "s/\"/%/g" | cut -d'%' -f3 » $Projectdir/$ligne/$ligne.RevisionId
 if [ $ligne != $1 ]
 then 
 cat $Projectdir/$ligne/$ligne.RevisionId » $PageSclt
 fi
 cat $Projectdir/$ligne/$ligne.RevisionId
 echo -n ", "licence : "" > $Projectdir/$ligne/$ligne.license
 #T cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f4 » $Projectdir/$ligne/$ligne.license
 cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 » $Projectdir/$ligne/$ligne.license
 #T cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f2 | sed "s/\/\//https:\/\//g" » $Projectdir/$ligne/$ligne.license
 if [ $ligne != $1 ]
 then 
 cat $Projectdir/$ligne/$ligne.license » $PageSclt
 fi
 cat $Projectdir/$ligne/$ligne.license
 #P spécial pour bas de page fr ## 
 cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e footer-info-copyright | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 > $Projectdir/$ligne/$ligne.licence
 echo -n ", "auteur(s) : "" > $Projectdir/$ligne/$ligne.auteur
 cat $Projectdir/$ligne/$ligne.str | grep -n -m 1 -i -e wgRelevantUserName | sed "s/\"/%/g" | cut -d'%' -f4 > tmp
 if test -s tmp; 
 then cat tmp » $Projectdir/$ligne/$ligne.auteur; rm tmp;
 else 
 echo "Auteur non trouvé ! " » $Projectdir/$ligne/$ligne.auteur
 if wget --spider https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$ligne 2>/dev/null
 then
 echo ". éditer : https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$ligne" » $Projectdir/$ligne/$ligne.auteur
 elif wget --spider https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$Bookname/$ligne 2>/dev/null
 then 
 echo ". éditer : https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$Bookname/$ligne" » $Projectdir/$ligne/$ligne.auteur
 else echo ". éditer "contributeurs" du livre "$Bookname" historique de la page "$ligne"" » $Projectdir/$ligne/$ligne.auteur
 fi
 fi
 if [ $ligne != $1 ]
 then
 cat $Projectdir/$ligne/$ligne.auteur » $PageSclt
 cat $Projectdir/$ligne/$ligne.auteur
 fi
 echo "" » $PageSclt
 done < $Projectdir/$1.pj #< $Liste
 echo "</div>" » $PageSclt
 echo "" » $PageSclt
 if [ "$2" = "--t" ]; then more $PageSclt; fi
exit 0
en_sclt.inc.
Version pour l'internatioalistion avec gettext
. gettext.sh
Version=211006
TEXTDOMAIN=en_sclt.inc
TEXTDOMAINDIR=/usr/share/locale
cd $Projectdir
echo "$Projectdir/$1.sclt creation"
echo "----------"
echo "$(gettext '= Appendix = ')" > "$Projectdir/$1.sclt"
echo » $Projectdir/$1.sclt
echo "$(gettext '== References == ')" » "$PageSclt"
echo "$(gettext '<references /> ')" » "$PageSclt"
echo » "$PageSclt"
echo "$(gettext ' ')" » "$PageSclt"
echo "$(gettext '== Contents == ')" » $PageSclt
echo "<div style="font-zize:85%">" » $PageSclt
cat $Projectdir/$1".list" | tr ' ' '_' | tr '\n' '%' | sed "s/%/\n\n/g" » $PageSclt
echo "</div>" » $PageSclt
echo "$(gettext '=== Source for this edition === ')" » $PageSclt
echo "<div style="font-zize:85%";>" » $PageSclt
echo -n "https://" » $PageSclt
cat $Projectdir/$1.mainPage | sed "s/\\\ /_/g" » $PageSclt
echo "</div>" » $PageSclt
echo " " » $PageSclt
echo "$(gettext ' ')" » $PageSclt
echo "$(gettext '== Articles Sources, and contributors == ')" » $PageSclt
echo -n "<span style="font-zize:85%";>" » $PageSclt
echo "$(gettext 'The "sources" listed for each article provide more detailled licencing information including the copyright status, the copyleft owner and the license conditions..</span> ')" » $PageSclt
echo " " » $PageSclt
echo "<div style="font-zize:72%";>" » $PageSclt
echo "----------"
cat $Projectdir/$1.list | awk -F"/" '{ print $NF }' > $Projectdir/$1.pj
Pjlist=$Projectdir/$1.pj
echo "Pjlist : "$PjList
 while read line
 do 
 echo
 echo "$(gettext ' line read = ')"$line
 echo
 mkd -pws '**' "$line/$line.html" $Projectdir/$line/$line.tmp | tr ',' '\n' > $Projectdir/$line/$line.str
 echo "*** References : articles, src, lic, contrib. "
 if [ $line != $1 ]
 then 
 echo "$line" » $PageSclt
 fi
 echo ""$line"" > $Projectdir/$line/$line.article
 cat $Projectdir/$line/$line.article
 echo -n ""$(gettext ', source : ')"https://"$Site"/w/index.php?oldid=" > $Projectdir/$line/$line.RevisionId
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRevisionId | tr -d ':' | sed "s/\"/%/g" | cut -d'%' -f3 » $Projectdir/$line/$line.RevisionId
 if [ "$line" != "$1" ]
 then 
 cat $Projectdir/$line/$line.RevisionId » $PageSclt
 fi
 cat $Projectdir/$line/$line.RevisionId
 echo -n ""$(gettext ', license : ')"" > $Projectdir/$line/$line.license
 #T cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f4 » $Projectdir/$line/$line.license
 cat $Projectdir/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 » $Projectdir/$line/$line.license
 #T cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f2 | sed "s/\/\//https:\/\//g" » $Projectdir/$line/$line.license
 if [ $line != $1 ]
 then 
 cat $Projectdir/$line/$line.license » $PageSclt
 fi
 cat $Projectdir/$line/$line.license
 #P spécial pour bas de page fr ## 
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e footer-info-copyright | sed "s/\"\//%\//g" | tr '"' '%' | cut -d'%' -f4 > $Projectdir/$line/$line.license
 echo -n "$(gettext ', "author(s) : " ')" > $Projectdir/$line/$line.author
 cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRelevantUserName | sed "s/\"/%/g" | cut -d'%' -f4 > tmp
 if test -s tmp; 
 then cat tmp » $Projectdir/$line/$line.author; rm tmp;
 else 
 echo "Author not found ! " » $Projectdir/$line/$line.author
 if wget --spider https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$line 2>/dev/null
 then
 echo "$(gettext '. see :') https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$line" » $Projectdir/$line/$line.author
 elif wget --spider https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$Bookname/$line 2>/dev/null
 then 
 echo "$(gettext '. see :') https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/$Bookname/$line" » $Projectdir/$line/$line.author
 else echo "$(gettext '. see "contributors" in book "$Bookname" history page of "$line" ')" » $Projectdir/$line/$line.author
 fi
 fi
 #https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/Guide_to_Unix/Introduction
 if [ $line != $1 ]
 then
 cat $Projectdir/$line/$line.author » $PageSclt
 cat $Projectdir/$line/$line.author
 fi
 echo » $PageSclt
 done < $Pjlist
 echo "</div>" » $PageSclt
 ## echo "$(gettext ' ')" » $PageSclt
 <div style="page-break-before:always"></div>
 if [ "$2" = "--t" ]; then more $PageSclt; fi
exit 0
tests_add_sclt.bash.
VERSION=210528
 clear
 pwd > pwd.txt
 if cat pwd.txt | grep ~/Annexer; then Workdir=~/Annexer; elif cat pwd.txt | grep ~/Add_appendix; \
 then Workdir=~/Add_appendix; else echo "Workind directory not found"; exit -1;fi
 rm pwd.txt 
 source $Workdir/vars/installdir.var
 echo " tests_add_sclt.bash version = $VERSION"
 sleep 2
 echo -e "\033[1;33m Control add_sclt.sh in the local test directory \033[0m" > text-control.txt 
 echo -e "\033[1;33m Please check that the comment line does not contain an command \033[0m" » text-control.txt
 echo -e "\033[1;33m ---- \033[0m"
 echo -e "\033[1;33m### add_sclt.sh ###\033[0m" » text-control.txt
 grep -n -e "#T\|#O\|#P" add_sclt.sh » text-control.txt
 echo -e "\033[1;33m###### en_sclt.inc ###\033[0m" » text-control.txt
 grep -n -e "#T\|#O\|#P" en_sclt.inc » text-control.txt 
 echo -e "\033[1;33m###### fr_sclt.inc ###\033[0m" » text-control.txt
 grep -n -e "#T\|#O\|#P" fr_sclt.inc » text-control.txt 
 more text-control.txt
 echo; echo -e "\033[47m\033[1;30m Continue ? \033[0m"
 read -s -e -n 1 -t 60 -p "y/n ? : " Inkey;echo
 if [ "$Inkey" != 'y' ]; then echo " Inkey is not yes, or time out after 60 sec, exit from $0"; exit 0;fi
 #O Test with first param empty
 echo "Command ./add_sclt.sh without parameter"
 ./add_sclt.sh
 echo;echo " wait for 2 sec"
 sleep 2; echo "----"
 echo " All tests whith parameter --t" 
 Inkey=1
 for i in 'seq 1 9'
 do 
 cat $Workdir/tests/sitelist.txt; echo
 echo -e "\033[47m\033[1;30m Choose the site number to test \033[0m"
 read -s -n1 -p "inkey number 1 to 9 : " Inkey; echo;
 if [ "$Inkey" = "1" ]; then ./add_sclt.sh LivreTest --t
 elif [ "$Inkey" = "2" ]; then ./add_sclt.sh Hélices_de_navires_à_déplacement --t
 elif [ "$Inkey" = "3" ]; then ./add_sclt.sh TestBook --t
 elif [ "$Inkey" = "4" ]; then ./add_sclt.sh Mkd_\(Extracteur_de_documents\) --t
 elif [ "$Inkey" = "5" ]; then ./add_sclt.sh Faire_fleurir_le_sel --t
 elif [ "$Inkey" = "6" ]; then ./add_sclt.sh Faire_sa_fleur_de_sel --t 
 elif [ "$Inkey" = "7" ]; then ./add_sclt.sh Guide_to_Unix --t
 elif [ "$Inkey" = "8" ]; then ./add_sclt.sh Tests_de_la_capacité_des_batteries_d%27accumulateurs --t
 elif [ "$Inkey" = "9" ]; then ./add_sclt.sh LivreTest --t
 else echo "$inkey local url of site not found"; exit 0
 fi
 done
See results.
LivreTest.
LivreTest.sclt
TestBook.
TestBook.sclt