Auto-éditer un wikilivre/addappendix

En travauxlink={{{link}}}

Cette page est en travaux. Tant que cet avis n'aura pas disparu, veuillez en considérer le plan et le contenu encore incomplets, temporaires et sujets à caution. Si vous souhaitez participer, il vous est recommandé de consulter sa page de discussion au préalable, où des informations peuvent être données sur l'avancement des travaux.










Logiciel addappendix
imprimable

 

 

Préambule modifier

Ce livre technique fait suite à une série d'articles dont le sujet est la création de la page "Annexe" des livres de Wikibooks.

La pandémie de COVID-19 a libéré du temps, a créé de la frustration avec le désir de s'occuper pendant le confinement. De cette liberté restreinte est née l'envie d'écrire et, pourquoi pas, promouvoir la programmation en langage shell bash qui est à la portée de tout le mondeEnfin .... presque. Ce langage est près du processeur, il est rapide, on l'apprend facilement.

Les livres compilés pour Pedia-Press ont certes belle allure, les livres sont de qualité mais leur compilation ne permet pas toujours la présentation voulue par l'auteur.
De plus, le créateur de collection d'articles Créer une compilation dans le menu Imprimer / exploiter de la page wikibooks, il se trouve généralement à gauche de votre navigateur, ne donne plus ce qu'il promet: les livres aux formats PDF et ODF. Le logiciel est-il obsolète ?

Alors autant s'amuser tout en apprenant les algorithmes de programmation: Écrire un logiciel qui crée la page annexe de nos livres ..

Un historique de ce divertissement est décrit dans le livre technique: Annexes de wikibooks[1].

On peut étudier les scripts de faisabilité et de la version française imprimable: Annexer (Version orignale)[2].

 

 

Table des matières modifier

À faire... 

À la fin, après copie du TOC ajouter les numéros des pages puis supprimer le TOC ou créer la table des matières avec OpenOffice.

 

 



Documents et directives modifier

  vβ 220109 Éditer





Généralités modifier

  • Les messages et les manuels doivent être écrits en anglais puis traduits dans d'autres langues.

Directives libres de programmation modifier

Directive de programmation établie par Goelette Cardabela et J Clara . Janvier 2022
y-a-t-il une contradiction entre directive et libre ?
  1. Le langage de programmation est le shell BASH non compilé afin d'être accessible à la compréhension.
  2. L'indentation des lignes de scripts est à la discrétion des programmeurs.
  3. Les fichiers de commandes pour sbin/ pourront éventuellement être compilés avec shc sans l'extension .sh.x
  4. Les fichiers sources bash auront l'extension .sh
  5. Les fichiers exécutables seront obtenus par extraction du code shell et les messages seront extraits en fichiers .pot
  6. Les fichiers .pot devront rester à la disposition des mainteneurs et des utilisateurs pour assurer les traductions dans d'autres langues sans qu'il soit nécessaire de mettre le paquet à jour. Ces fichiers .pot seront disponibles dans le répertoire /usr/share/doc/addapendix
  7. Les scripts doivent être largement documentés en anglais pour assurer la maintenance universelle.
  8. Les organigrammes commencent par #O en première colonne.
  9. Les commentaires pour les programmeurs commencent par #P en première colonne.
  10. Les points particulier d'attention commencent par #w en première colonne
  11. Les entêtes commencent par #H en première colonne

Convention d'entêtes :

#!/bin/bash
#H Header doc
#H -------------------------------
#H File : <source>/<file>.sh
#H Syntax : <executable> [ ?  | -v ]
#H Created : AAMMDD by <wikibooks user>
#H Updated : AAMMDD by ... for
#O Organizational chart
#O -------------------------------
#P Programmers notes
#P -------------------------------
VERSION=AAMMDD
TEXTDOMAIN=<executable>
TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAINDIR
#P . gettext for translation
. gettext.sh
#O Script begin here
....
#O Script end
Encodage du programme principal
Directive d'encodage établie par J Clara . Janvier 2022
  1. Le logiciel addappendix n'aura qu'un seul programme principal contrairement aux logiciels Annexer et Add_appendix qui disposent de plusieurs points d'entrée dont la principale est annex.
  2. La ligne de commandes contiendra uniquement le lien vers le livre compilé et les deux options « ? » et « -v » la commande sera détaillée dans le manuel.
  3. Le script addappendix.sh pourra être constitué de parties des scripts déjà éprouvés du logiciel Add_appendix.
  4. Les fichiers qui ne contiennent pas de texte traductible avec gettext pourront être inclus dans le script addappendix.sh avec la directive « source » ou « . ». Ces scripts devront être accessibles dans la librairie addappendix.lib (/usr/lib/addappendix.lib ou /usr/local/lib/addapendix.lib) selon la directive d'installation du paquet.
  5. Les scripts seront éprouvés dans le répertoire des tests puis assemblés progressivement en un seul. Noter que les scripts ont déjà été éprouves avec Add_apendix.

Documents pour l'utilisateur modifier

manuel wiki modifier

  • Ce manuel est commun à la série des logiciels Add_appendix (annexer, annex, add_appendix, addappendix)
français: Manuels Wiki pour les logiciels Add_appendix
anglais: Wiki manuals for Add_appendix softwares

manuel traditionnel modifier

code du manuel pour annex (Dec 2021) modifier

Attention : modification en cours ! 

Un contributeur est en train de retravailler en profondeur cette page. Vous êtes prié(e) d'éviter de le modifier pour limiter les risques de conflit de versions jusqu'à disparition de cet avertissement. Merci.

  • Le code comprimé addappendix.1.gz en anglais doit être placé dans le répertoire par défaut /usr/share/man/man1/.
  • Le code comprimé addappendix.1.gz traduit en français doit être placé dans /usr/share/man/fr.UTF-8/man1/.
.\" Création par Utilisateur:Goelette_Cardabela pour wikilivres le 26 juin 2020
.\" Vérifications UTF-8 par Clara le 6 novembre 2012
.\" Mise à jour par GC le 28 août 2021 pour Add_appendix
.\" Mise à jour par GC le 14 décembre 2021 Retouches
.\" .
.\" FILE manuel annex_fr.1 to edit in UTF-8 format

.TH annex 1 "14 Décembre 2021"

.SH NOM
annex \- Crée la page Annexe des livres de wikilivres.

.SH RÉSUMÉ
\fBannex\fP  < \fBnom du livre  |  ? \fP >   [ -v ]  [ -pb | -pc ]

.SH DESCRIPTION
\fBannex\fP permet de créer les pages \fIAnnexe\fP des livres de Wikilivres.

.SH PRÉ-REQUIS
Les répertoires de l'application doivent  être créés grâce à la commande users_install_annex.sh 
.TP
Le logiciel mkd doit être installé: https://en.wikipedia.org/wiki/Mkd_(software)
.TP
Le répertoire du livre doit être créé et contenir les wikicodes de la compilation ou du sommaire ou encore du contenu du livre. \
Pour les livres de wikibooks anglais et français ce travail peut être simplifié grâce à la commande pre-annex <url> complète du livre ou de la compilation. \
\fIannexer\fP et \fIaddappendix\fP sont aussi des commandes simplifiées

.SS Options
.TP
\fB ?\fR
Affiche la syntaxe de la commande.
.TP
\fB-v\fR
Mode bavard (Verbose mode)
.TP
\fB-pb\fR
Crée une version personnalisée du classement des images avec les données du serveur Mediawiki  \fIWikilivres\fP.
.TP
\fB-pc\fR
Crée une version personnalisée du classement des images avec les données du serveur Mediawiki \fICommons\fP

.SH "EXIT STATUS"
L'application renvoie normalement la valeur 0 et une valeur différente en cas d'erreur

.SH ERREURS
Les erreurs les plus fréquentes peuvent être causées par des débordement de la capacité de la ligne de commandes. \
Il peut être intéressant, à titre exceptionnel, de créer une page à la racine du serveur et de créer une redirection \
vers une page plus longue, afin de débloquer la ligne de commande. Il serait plus judicieux de renommer le nom de\
la page trop longue vers la racine du site Wikibooks avec un nom plus court.

.SH FICHIERS
Il existe de nombreux fichiers dont les versions peuvent changer lorsque des améliorations sont souhaitées. \
Reportez votre attention, pour cette version française vers la section 19 :\
\fIhttps://fr.wikibooks.org/w/index.php?title=Auto-éditer_un_wikilivre/Annexer_(Version_internationalisée)&section=19\fP

.SH VERSIONS
Les versions sont notée AAMMJJ - AA pour année, MM pour mois, JJ pour jour, de la dernière modification.

.SH HISTOIRE
.PP
2020 - Début de l'histoire avec les confinements au domicile à cause du virus COVID-19 : 
\fIhttps://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre\fP
2021 - Internationalisation des codes et des messages avec les versions \fIAdd_appendix\fP et \fIAnnexer\fP
 
.SH TELECHARGEMENTS
.PP
https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Annexer_(Version_internationalisée)#src.orig_en_français

.SH AUTEURS
.PP
Manuel créé par le wikipédien  : Goelette Cardabela

.SH NOTES
.PP
La  version 211214 de Add_appendix est une version bêta

.SH BUGS
.PP
Il est possible de créer une discussion sur l'ensemble du projet et également pour chaque article de ce logiciel, \
il suffit se connecter sur wikibooks : https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Annexer_(Version_internationalisée) \
et de consulter la page de discussion de l'article concerné.

.SH EXEMPLES
Exécuter dans le répertoire Add_appendix/bin :
.TP
"./pre-annex https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel"
.TP 
"./annex Faire_sa_fleur_de_sel -pb"
.TP
Consulter le fichier "Faire_sa_fleur_de_sel.appendix"

.SH VOIR AUSSI
https://fr.wikibooks.org/wiki/Goélette_Cardabela/Référencement_manuel

aperçu du manuel annex (Dec 2021) modifier

annex(1)                   General Commands Manual                   annex(1)

NOM
       annex - Crée la page Annexe des livres de wikilivres.

RÉSUMÉ
       annex  < nom du livre  |  ?  >   [ -v ]  [ -pb | -pc ]

DESCRIPTION
       annex permet de créer les pages Annexe des livres de Wikilivres.

PRÉ-REQUIS
       Les  répertoires  de l'application doivent  être créés grâce à la com‐
       mande users_install_annex.sh

       Le        logiciel        mkd        doit        être        installé:
       https://en.wikipedia.org/wiki/Mkd_(software)

       Le  répertoire du livre doit être créé et contenir les wikicodes de la
       compilation ou du sommaire ou encore du contenu  du  livre.  Pour  les
       livres de wikibooks anglais et français ce travail peut être simplifié
       grâce à la commande pre-annex <url> complète du livre ou de la  compi‐
       lation. annexer et addappendix sont aussi des commandes simplifiées

   Options
        ?     Affiche la syntaxe de la commande.

       -v     Mode bavard (Verbose mode)

       -pb    Crée  une  version  personnalisée du classement des images avec
              les données du serveur Mediawiki  Wikilivres.

       -pc    Crée une version personnalisée du classement  des  images  avec
              les données du serveur Mediawiki Commons

EXIT STATUS
       L'application renvoie normalement la valeur 0 et une valeur différente
       en cas d'erreur

ERREURS
       Les erreurs les plus fréquentes peuvent être causées par des  déborde‐
       ment   de  la  capacité  de  la  ligne  de  commandes.  Il  peut  être
       intéressant, à titre exceptionnel, de créer une page à  la  racine  du
       serveur et de créer une redirection vers une page plus longue, afin de
       débloquer la ligne de commande. Il serait plus judicieux  de  renommer
       le  nom dela page trop longue vers la racine du site Wikibooks avec un
       nom plus court.

FICHIERS
       Il existe de nombreux  fichiers  dont  les  versions  peuvent  changer
       lorsque  des  améliorations sont souhaitées. Reportez votre attention,
       pour cette version française  vers  la  section  19  :https://fr.wiki‐
       books.org/w/index.php?title=Auto-éditer_un_wikilivre/Annexer_(Ver‐
       sion_internationalisée)&section=19

VERSIONS
       Les versions sont notée AAMMJJ - AA pour année, MM pour mois, JJ  pour
       jour, de la dernière modification.

HISTOIRE
       2020  -  Début de l'histoire avec les confinements au domicile à cause
       du virus COVID-19 :  https://fr.wikibooks.org/wiki/Auto-éditer_un_wik‐
       ilivre  2021 - Internationalisation des codes et des messages avec les
       versions Add_appendix et Annexer

TELECHARGEMENTS
       https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Annexer_(Ver‐
       sion_internationalisée)#src.orig_en_français

AUTEURS
       Manuel créé par le wikipédien  : Goelette Cardabela

NOTES
       La  version 211214 de Add_appendix est une version bêta

BUGS
       Il  est  possible  de créer une discussion sur l'ensemble du projet et
       également pour chaque article de ce logiciel, il suffit  se  connecter
       sur   wikibooks   :  https://fr.wikibooks.org/wiki/Auto-éditer_un_wik‐
       ilivre/Annexer_(Version_internationalisée) et de consulter la page  de
       discussion de l'article concerné.

EXEMPLES
       Exécuter dans le répertoire Add_appendix/bin :

       "./pre-annex         https://fr.wikibooks.org/wiki/Wikilivres:Compila‐
       tions/Faire_sa_fleur_de_sel"

       "./annex Faire_sa_fleur_de_sel -pb"

       Consulter le fichier "Faire_sa_fleur_de_sel.appendix"

VOIR AUSSI
       https://fr.wikibooks.org/wiki/Goélette_Cardabela/Référencement_manuel

                               14 Décembre 2021                      annex(1)

manuels texte modifier

Ces manuels se trouvent dans /usr/share/doc/addappendix/
addapendix_de.txt, addappendix_en.txt, addappendix_fr.txt
Si le manuel existe dans d'autres langues on peut les créer par la commande:
man addappendix > addappendix_<lang>.txt

manuel html modifier

Ces manuels se trouvent dans /usr/share/doc/addappendix/html/
addappendix_de.html, addappendix_en.html, addappendix_fr.html
Ces manuels sont généralement accessibles par un fichier d'index ou par un alias (voir: comment créer un alias)
Si le manuel existe dans d'autres langues on peut utiliser la commande man2html (voir le manuel: man man2html)

 



Construction et tests du script addappendix modifier

  vβ 220113 Éditer





Attention : modification en cours ! 

Un contributeur est en train de retravailler en profondeur cette page. Vous êtes prié(e) d'éviter de le modifier pour limiter les risques de conflit de versions jusqu'à disparition de cet avertissement. Merci.

  • Cette page concerne le logiciel addappendix mis en paquet

preinstall-usr-local.bash modifier

#!/bin/bash
#H Header doc
#H -------------------------------
#H File : tests/preinstall-usr-local.bash
#H Syntax : ./preinstall-usr-local.bash./ [ ?  | -v ]
#H Created : 220118 by <wikibooks user>
#H Updated : 220118 by ... for
#O Organizational chart
#O -------------------------------
#P Programmers notes
#P -------------------------------
VERSION=220313

#O Script begin here
sudo install -d /usr/local/datas
#P sudo cp /home/cardabela/addappendix-211219/datas/*.dat /usr/local/datas/.
sudo cp ~/Add_appendix /datas/*.dat /usr/local/datas/.
ls /usr/local/datas
#O Script end

script addapendix.sh 22/03/10 modifier

#!/bin/bash
#H Header doc
#H -------------------------------
#H File : ~/Add_appendix/tests/13-(pkg)-addappendix.sh/addapendix.sh
#H Syntax : addapendix [ ?  | --v ]
#H Created : 220113 by GC
#H Updated : 220221 by GC for page ScliC
#O Organizational chart
#O -------------------------------
#P Programmers notes
#P -------------------------------

VERSION=220310
TEXTDOMAIN=addappendix
TEXTDOMAINDIR="/usr/share/locale"
#TEXTDOMAINDIR="~/Add_appendix/share/locale"
export TEXTDOMAINDIR

#P . gettext for translation
. gettext.sh

#O Script begin here
#O If parameters is empty
    if test -z $1
#O Then print the short syntax ant exit -1
    then 
	  echo -n -e "\033[31m"
      echo -n $"No parameter. addappendix [ full URL of book | ? | --v ]"
	  echo -e "\033[0m"
	  exit -1
	fi

#O If firt parameter is '?'
	if [ "$1" = "?" ]
#O Then print syntax whih examples and exit 0
    then 
	  echo -n -e "\033[32m"
	  echo $"Syntax: addappendix [ full URL of book | ? | --v ]"
	  echo $"  Example 1 : addappendix https://en.wikibooks.org/wiki/Wikibooks:Collections/Guide_to_Unix"
	  echo $"  Example 2 : addappendix https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel"	  
	  echo -e "\033[0m"
      exit 0
	fi
#O IF first parameter is "--v"
    if [ "$1" = "--v" ]
#O Then print addapendix version
	then
	  echo -n -e "\033[32m"
	  echo -n $"addapendix version : $VERSION"
	  echo -e "\033[0m"
	  exit 0
	fi
	
#O *** First parameter analysis ***
#T    echo "$1"
#O Test if the first parameter points to wikibooks.org/wiki
    if echo $1 | grep wikibooks.org/wiki 
	then 
	  echo -n -e "\033[32m"	
	  echo -n $"  is a wiki-book"
	  echo -e "\033[0m"
    else
	  echo -n -e "\033[31m"	
	  echo -n $"$1 is not a wiki-book on wikibooks.org"
	  echo -e "\033[0m"
      exit -1
    fi
#O Check if $1 file exist
    if wget --spider $1 2>/dev/null; then
	  echo -n -e "\033[32m"		
      echo -n $"File $1 is found"
	  echo -e "\033[0m"	  
    else
	  echo -n -e "\033[31m"		
      echo -n $"File $1 is not found"
	  echo -e "\033[0m"
      exit -1
    fi

#O Find the bookname
    echo $1 | awk -F"/" ' { print $NF }' > bookname.txt
	read Bookname<bookname.txt
	echo; echo -n -e "\033[1;32m"		
	echo -n $"Book name : $Bookname"
	echo -e "\033[0m"
    
    echo $1 | awk -F"/" ' { print $3 }' > site.txt
    read Site<site.txt
	echo; echo -n -e "\033[1;32m"		
	echo -n $"Site name : $Site"
	echo -e "\033[0m"
    
    echo $1 | awk -F"/" ' { print $5 }' > compilations.txt
	read Compilations<compilations.txt
	echo -n -e "\033[1;32m"		
	echo -n $"Compilations name: $Compilations"
	echo -e "\033[0m"
	if [ "$Compilations" = "Wikilivres:Compilations" ]; then Suffix=compiled; fi
	if [ "$Compilations" = "Wikibooks:Collections" ]; then Suffix=compiled; fi
    if test -z $Suffix; then Suffix=compiled; fi
    echo -n -e "\033[1;32m"		
	echo "Suffix = $Suffix"
	echo -e "\033[0m"

#O Create Bookname directory
    install -d ~/Add_appendix/books/$Bookname
	Projectdir=~/Add_appendix/books/$Bookname
#O Create temp directory in Workdir
	Workdir=~/Add_appendix
	mkdir -p $Workdir/temp
#O ============================================================================
##O Create the file bookname.suffix
#T ***********************
#O Create $Projectdir/resources/TMP to download
    mkdir -p $Projectdir/resources/TMP
#O Download $1
    cd $Projectdir/resources/TMP
    rm -Rf $Projectdir/resources/TMP/* 2> /dev/null
    wget -N $1 -o $Workdir/temp/wget-log-télécharger.txt
    ls -1 > ../filename.txt
    read Filename<../filename.txt
    if [ "$Filename" = "filename.txt" ]; then echo $"line 113: \$Filename = filename.txt error, exit -1"; exit -1; fi
    rm ../filename.txt
#O go up in the directory resources and rename 'TMP' '$Filename'
    cd ..
    if test -e $Filename; then rm -R $Filename; fi
    if test -d $Filename 2>/dev/null
	then rm -R $Filename 2>/dev/null
    fi 
    mv TMP $Filename
    cd $Filename
#T  ls -al 
    cat $Filename|grep "<li><a href=">extract-li
    cat extract-li | sed "s/title=\"/\n[[/g" | grep -v "<li><a href=" |sed "s/\">/]]\n/g"|grep -v "</a>\|Cat\|<div" >extract-li1
    cat $Filename|grep "<dd><a href=">extract-dd
    cat extract-dd | sed "s/title=\"/\n[[/g" | grep -v "<dd><a href=" |sed "s/\">/]]\n/g"|grep -v "</a>" >extract-dd1
    cat extract-dd1 > $Bookname.$Suffix
    cat extract-li1 >> $Bookname.$Suffix
#T    echo "$Bookname.$Suffix = "
    cp $Bookname.$Suffix $Projectdir/$Bookname.$Suffix
#T ***********************
    if test -e $Projectdir/$Bookname.$Suffix
    then
	  echo -n -e "\033[1;32m"		
      echo -n "$Bookname.$Suffix : "
	  echo -e "\033[0m"
      cat $Projectdir/$Bookname.$Suffix
    fi
#O ============================================================================	
#O Download the book in html form
#O Télécharger le site récursivement avec une profondeur infinie ( -linf ), \
#O convertit les liens pour une consultation en local ( -k ), \
#O rapatrie tous les fichiers nécessaires à l'affichage convenable d'une page HTML ( -p ) \
#O et renomme toutes les pages HTML avec l'extension .html ( -E ) 
    echo; echo "Dowload $1"
    wget -r -linf -k -p -E "$1" -o $Workdir/temp/wget-log-télécharger.txt

# Create lists
   if test -e /usr/local/datas/content_cleaner.dat; then Datasdir=/usr/local/datas
   else
     echo -n -e "\033[12;31m"
     echo -n $"content_cleaner.dat not found in /usr/local/datas"
     echo -e "\33[0m"
     exit -1
   fi

   if test -e "$Projectdir/$Bookname.compiled"
   then 
   {
     echo $" Found Compiled page : $Projectdir/$Bookname.compiled"; echo
     echo " Create $Projectdir/$Bookname.list with :"; echo "    $Projectdir/$Bookname.compiled"; echo
     cat "$Projectdir/$Bookname.compiled" | sed -f $Datasdir/content_cleaner.dat > $Projectdir/$Bookname.compiled.cleaned
     cat "$Projectdir/$Bookname.compiled.cleaned" | grep -v '=' | sed "s/\[\[/https:\/\/$Site\/wiki\//g" | sed "s/\]\]//g" | grep "wiki" | tr ' ' '_' | cut -d '|' -f1 > $Projectdir/$Bookname.list
     cat "$Projectdir/$Bookname.compiled.cleaned" | grep -v '=' | sed "s/\[\[//g" | sed "s/\]\]//g" | cut -d '|' -f1 > $Projectdir/$Bookname.prj
   }
   fi
#T Print $Projectdir/$Bookname.prj
    cat $Projectdir/$Bookname.prj

#O Download the complete book structure in project directory
    cd $Projectdir
    echo $"download all sub-directories of the book '$Bookname'"
    wget -r -linf -k -p -E  -i $Bookname.list -o $Workdir/temp/wget-log-download.txt
    echo "----------"
#T Testspoint    exit 0
#O Move the html pages into working sub-directories to document the pages and sub pages
#O   create a local list to the downloaded directories $ Projectdir/$1.locale.list
      echo "create the complete concatenated hierarchy of the directories of the book '$Bookname'"
      cat $Projectdir/$Bookname.list | sed "s/https:\/\///g" | sed "s/\ /\\\ /g" | tr '\n' ',' > $Projectdir/$Bookname.locale.list
      echo "   Concatenated local list $Projectdir/$Bookname.locale.list :"
      echo ""
      cat $Projectdir/$Bookname.locale.list
      echo "----------"  
#O Copy the html files to respective directories
#O   Create a file with the pagename $Projectdir/$Bookname.mainPage
      echo
      echo $"Create the page from the local link to the main page, 'the book'"
      cat $Projectdir/$Bookname.locale.list | sed "s/ /\\ /g" | cut -d ',' -f1 > $Projectdir/$Bookname.mainPage
      echo "----------"
#O   Initialize the variable $mainPage
      read mainPage < $Projectdir/$Bookname.mainPage
      echo "variable mainPage = $mainPage"     
    #T cat $Projet/$1.mainPage | awk -F"/" '{print NF}' > nbchamps
    #T read NbChamps < nbchamps
    #T echo "Variable NbChamps = $NbChamps"
      echo "----------"
#O   Create a file of the working directories to be created.
      ls "$mainPage" | sed "s/.html//g"  > $Projectdir/$Bookname.dirs
      echo "sub-working-diectories : "
      cat  $Projectdir/$Bookname.dirs
      echo "----------" 
#O   Copy the html pages and subpages in the respective directories
      while read line
      do
        echo "$line".html | sed "s/https:\/\///g" | tr '\n' ' ' > source
        read Source < source
        echo "Source = $Source"

        echo "$line" | awk -F"/" '{ print $NF }'| tr '\n' '/' > destination 
        read dir < destination
        mkdir $dir
        echo "$line".html | awk -F"/" '{ print $NF }' >> destination
        read Destination < destination
        echo "Destination = $Destination"
        echo $"Copy : 'cp -f ./$Source $Destination'"
        cp -f "./$Source" "$Destination"
      done < $Projectdir/$Bookname.list
      rm source ; rm destination

#O ============================================================================
#O Create variable PageSclt
    PageSclt=$Projectdir/$Bookname.sclt
#O File creation '$Bookname.sclt' and print the contents.
    echo "----------"
    echo "$(gettext '= Appendix = ')" > $PageSclt
    echo >> $PageSclt

#O Add <references />
    echo "$(gettext '== References == ')" >> $PageSclt
    echo "$(gettext '<references /> ')" >> $PageSclt
    echo  >> $PageSclt
    echo "<div style='page-break-before:always'></div>" >> $PageSclt
    
#O Add the link to printable book and to articles.
    echo "$(gettext '== Contents == ')" >> $PageSclt
    echo "<div style='font-zize:85%'>" >> $PageSclt
    cat $Projectdir/$Bookname.list | tr ' ' '_' | tr '\n' '%' | sed "s/%/\n\n/g" >> $PageSclt
    echo "</div>" >> $PageSclt

#0 Add the link to the source of this edition.
    echo "$(gettext '=== Source for this edition === ')" >> $PageSclt
    echo "<div style='font-zize:85%';>" >> $PageSclt
    echo -n "https://" >> $PageSclt
    cat $Projectdir/$Bookname.mainPage | sed "s/\\\ /_/g" >> $PageSclt
#P other version : cat $Projectdir/Bookname".list" | tr ' ' '_' | tr '\n' '%' | sed "s/%/%\n/g" | grep $1% | tr -d % >> $PageSclt
    echo "</div>" >> $PageSclt
    echo " " >> $PageSclt
    echo "<div style='page-break-before:always'></div>" >> $PageSclt

#O Create section 'Article', 'Source', 'License', 'Contributors(?)'
    echo "$(gettext '== Articles Sources, and Contributors == ')" >> $PageSclt
#O   add the text : style PediaPress or personalized.
#O   The ''sources'' listed for each article provide more detailled licencing
#O   information including the copyright status, the copyleft owner and the license conditions.
    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
#O or, validate one or the other of these texts : 
#   echo $"The texts are available with their respective licenses, however other terms may apply.<br />See the terms of use for more details : <br />https://wikimediafoundation.org/wiki/Conditions_d'utilisation.</span>" >> $PageSclt
    echo " " >> $PageSclt
    echo "<div style='font-zize:72%';>" >> $PageSclt
    
echo "----------"
#O Create or recreate the list-file $Projectdir/$1.pj
    cat $Projectdir/$Bookname.list | awk -F"/" '{ print $NF }' > $Projectdir/$Bookname.pj
    Pjlist=$Projectdir/$Bookname.pj
    echo "Pjlist : "$PjList

#O While exist line in file $PjList ,
    while read line
    do    
#O    Print the line read,
       echo
       echo $"   line read = $line"
       echo
#O    Extract and copy all strings from the html file
#O      $line.html in the file $line.str and add to screen
#T pwd
       mkd -pws '**' "$line/$line.html" $Projectdir/$line/$line.tmp | tr ',' '\n' > $Projectdir/$line/$line.str
#T break
#O    Create the documentation file of pages :
       echo "*** References : articles, src, lic, contrib. "
    
#O    Print article,
       if [ $line != $Bookname ]
       then  
         echo "'''$line'''" >> $PageSclt
       fi
       echo "'''"$line"'''" > $Projectdir/$line/$line.article
       cat $Projectdir/$line/$line.article
       
#O    Print source,
       echo -n $", ''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" != "$Bookname" ]
       then          
         cat $Projectdir/$line/$line.RevisionId  >> $PageSclt
       fi
       cat $Projectdir/$line/$line.RevisionId
       

#P    license du bas de page : 
#P    <li id="footer-info-copyright">Les textes sont disponibles sous <a href="https://creativecommons.org/licenses/by-sa/3.0/">license Creative Commons attribution partage à l’identique</a> ; d’autres termes peuvent s’appliquer.<br/>
#P      Voyez les <a href="https://wikimediafoundation.org/wiki/Conditions_d'utilisation">termes d’utilisation</a> pour plus de détails.<br/></li>
#P
#P    Print license :
#P    <link rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"/>


#T echo ", ''Copyright :''"  >> ArticleUn.tmp
#T cat ArticleUn.str | grep -n -m 1 -i -e license | sed "s/\"\//%\//g" | cut -d'%' -f2 |sed "s/\/\//https:\/\//g"  >> ArticleUn.tmp
#O    Print license :
       echo -n $", ''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/$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 != $Bookname ]
       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

#O    Author(s).  
       echo -n $", ''authors : ''" > $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/$Sitename/$line" >> $Projectdir/$line/$line.author
           elif wget --spider https://xtools.wmflabs.org/articleinfo/$Sitename/$Bookname/$line 2>/dev/null
           then 
             echo "$(gettext '. -see :') https://xtools.wmflabs.org/articleinfo/$Sitename/$Bookname/$line" >> $Projectdir/$line/$line.author
           else 
             cat $Projectdir/$line/$line.str | grep -n -m 1 -i -e wgRelevantPageName | sed "s/\"/%/g" | cut -d'%' -f4 > tmp
             if test -s tmp
             then
               #T echo "&action=history" >> tmp
               echo -n "$(gettext '. -see ''contributors'' in book, history page of ')"  >> $Projectdir/$line/$line.author
               cat tmp >> $Projectdir/$line/$line.author; rm tmp
             fi
           fi
       fi
       #https://xtools.wmflabs.org/articleinfo/en.wikibooks.org/Guide_to_Unix/Introduction
       
       if [ $line != $Bookname ]
       then
         cat $Projectdir/$line/$line.author >> $PageSclt
         cat $Projectdir/$line/$line.author
       fi
       
       echo >> $PageSclt
       
#O end of while.
    done < $Pjlist
    
#O Add end of div and pagre break
    echo "</div>" >> $PageSclt
    echo "<div style='page-break-before:always'></div>" >> $PageSclt
    
#P
#P Création de la page Bookname.scli (sources contributeurs licenses des images)
#P

#0 Initialisation de la variable d'entête des fichiers scli.
    Headscli=$Projectdir/$Bookname.scli
    echo > $Headscli
#O Afficher le nom du fichier Headscli à la console 
#O Show Headscli filename to console
    echo
    echo -n "$Headscli"; echo $" english version"; echo
    echo $"== Images Sources Licenses and Contributors ==" > $Headscli
    echo -n "<span style='font-size:85%'>"; echo $"The ''sources'' listed for each illustration provide more detailed licensing information, including copyright status, the holders of these rights and the license conditions.</span>" >>  $Headscli
    echo " " >>  $Headscli
    echo "<div style='font-size:72%'>" >> $Headscli
    echo >>  $Headscli
#T Show the content of file Headscli    cat $Headscli; exit 0

#O ============================================================================
#O If the file $Projectdir/$Bookname/$Bookname.str exist, create the PageSclic in classic order
#O Si la page $Projectdir/$Bookname/$Bookname.str existe, créer la page $PageSclic contenant les images dans un ordre classique
    if test -e $Projectdir/$Bookname/$Bookname.str
    then
#O Select lines containing 'fichier:', 'file', image and create bookname.files
    cat $Projectdir/$Bookname/$Bookname.str | grep -n -i -e fichier: -e file: -e image: > $Projectdir/$Bookname/$Bookname.files
#O Select lines containing 'fichier:', '.jpg', '.png', '.gif' and create bookname.pict
    cat $Projectdir/$Bookname/$Bookname.str | grep -n -i -e fichier: -e .jpg -e .png -e .gif > $Projectdir/$Bookname/$Bookname.picts
#O Sélect in bookname.files, the lines containing 'title', remove the tag <div> cut ">" and select the last champ to create bookname.illustrations
    cat $Projectdir/$Bookname/$Bookname.files | grep title |sed "s/<\/div>//g" | awk -F">" '{print $NF}' > $Projectdir/$Bookname/$Bookname.illustrations
#O Dans le fichier .files avec le séparateur "=" imprimer dans le champ 'i' le retour chariot, sélectionner le slignes conteneant 'https', remplacer le caractère '"' par '!'
#O   et sélectionner le trosième champ, puis relélectionner la ligne contenant https, remplacer le caractère '>' par !, supprimer </a, puis supprimer le caractère '!'
#O   et créer le fichier.links
       cat $Projectdir/$Bookname/$Bookname.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https | sed "s/\"/!/g" | cut -d '!' -f3 \
       | grep https | tr '>' ! | sed "s/<\/a//g" |sed "s/!//g" > $Projectdir/$Bookname/$Bookname.links
#OF Télécharger les fichiers contenus dans la liste du fichier bookname.links
#O Download the files contained in the list of the bookname.links file
    wget -P $Projectdir/$Bookname -r -linf -k -p -E -i $Projectdir/$Bookname/$Bookname.links       
#O Copy html liles from ./commons.wikimedia.org/wiki in the curreny directory
    cd $Bookname
    if test -e commons.wikimedia.org; then cp -R commons.wikimedia.org/wiki/*.html . ; fi
#O html.list initialization
    echo -n "" > html.list
    if test -s $Projectdir/$Bookname/$Bookname.links
    then 
    { 
      echo $"$Projectdir/$Bookname/$Bookname.links is not empty" 
#OF  Tant qu'on lit des lignes dans le fichier .links, lire les images et les lister dans html.list  
#O   As long as there is a line in file html.links, read the line and copy it to html.list
      while read line
      do
      echo $line | awk -F"/" '{print $NF}' | cut -d '%' -f1 | cut -d '.' -f1 > tmp
      read Image < tmp
      ls $Image*.html  >> html.list
      echo "Image : "$Image.html  
      done < $Projectdir/$Bookname/$Bookname.links
    }
    elif test -s $Projectdir/html.list; then cp $Projectdir/html.list $Projectdir/$Bookname/html.list
    else echo $"No images found in $Projectdir/$Bookname"; exit 0
    fi
    
    echo " *** References : image, src, lic, contrib."
#O As long as there is a line in file html.list extract illustrations, sources, licenses, authors(s)	   
    while read line
    do
       echo
       echo
       echo $"**** line = $line ****"
       echo
	   
       mkd -pw '**' $line $line.tmp
       cat $line.tmp | tr ',' '\n' > $line.str 
     
       echo -n $"'''Illustration : '''" > $line.title
       cat $line.str |grep wgTitle | cut -d '"' -f4 >> $line.title
       cat $line.title >> $PageSclic 
       cat $line.title

       echo -n $", '' source : ')''https://"$Site"/w/index.php?title= " > $line.source
       echo $line | sed "s/.html//g" >> $line.source
       cat $line.source >> $PageSclic
       cat $line.source

       echo -n $", ''license : ''" > $line.license
       cat $line.str | grep licensetpl_short | sed "s/<td>//g" | sed "s/<span class//g" | sed "s/<\/span>//g" | sed "s/style=\"display:none;\"//g" | tr '=' '\n' | grep licensetpl_short | awk -F">" '{print $NF}' >> $line.license
       cat $line.license >> $PageSclic
       cat $line.license
	   
       echo -n $", authors : ''" > $line.authors
       rm tmp
       cat $line.str | grep -i -n -m1 -A 1 -e Author | grep -i -e user -e utilisteur -e auteur | tr '/' '\n' | grep -i -e user -e utilisteur -e auteur | cut -d '"' -f1 > tmp
       if test -s tmp 
       then cat tmp >> $line.authors
       else echo "-" >> $line.authors
       fi
       cat $line.authors >> $PageSclic
       cat $line.authors	   
       echo >> $PageSclic
    done < html.list
#P bas de la page avant la nouvelle page	
    echo "</div>" >> $PageSclic
    
#T    echo "$(gettext '{{Newpage}} ')" >> $PageSclic
    echo "<div style='page-break-before:always'></div>" >> $PageSclic
#O end of test -e $Projectdir/$Bookname/$Bookname.str  
    else 
      echo  -e "\033[31m"
      echo $"Can not create $Projectdir/$Bookname/$Bookname.sclic. URL page of book is not found"
	  echo -e "\033[0m"
#O end of create PageSclic
    fi
    
#O ============================================================================
#O Create variable Pagesclipco
    Pagesclipco="$Projectdir/$Bookname.sclipco"
    echo $Pagesclipco
#O Wikibooks sclipco personalized page initialization with the title Images sources, etc.
    cat $Projectdir/$Bookname.scli > $Pagesclipco
#Test 
cat $Pagesclipco
#O ============================================================================
 
#O Create an identification loop of the directories corresponding to the articles
#O As long as we can read the lines of the file $Projectdir/$Bookname.pj
    while read pjline
    do
#O   If the line read is not $Bookname (name of the book)
#T    echo "line read : " $line
      if [ $pjline != $Bookname ]
#O     Then:
        then
#O     Enter in the article directory,
        cd $Projectdir/$pjline
#O     Create image documentation files
#O     Open the stream of $ Projectdir/$Bookname/$Bookname.str of the image and select 
#O       the character strings containing: File:, Image; and put in files
#O       $Projectdir/$line/$line/.files, .pict, .illustration, .images, .links
        cat $Projectdir/$pjline/$pjline.str | grep -n -i -e Fichier: -e file: -e image: | sed -f $RepCom/$Conversions > $Projectdir/$pjline/$pjline.files
        cat $Projectdir/$pjline/$pjline.str | grep -n -i -e fichier: -e .jpg -e .png -e .gif | sed -f $RepCom/$Conversions> $Projectdir/$pjline/$pjline.picts
        cat $Projectdir/$pjline/$pjline.files | grep title |sed "s/<\/div>//g" | awk -F">" '{print $NF}' > $Projectdir/$pjline/$pjline.illustrations
#T        cat $Projectdir/$pjline/$pjline.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https | sed "s/\"/!/g" | cut -d '!' -f3 | grep https | tr '>' ! | sed "s/<\/a//g" |sed "s/!//g" > $Projectdir/$pjline/$pjline.links
        cat $Projectdir/$pjline/$pjline.files | awk -F"=" '{for (i=1;i<=NF;i++) print $i "\n"}' | grep https://$Site | sed "s/\"/!/g" | cut -d '!' -f2 > $Projectdir/$pjline/$pjline.images
#Tbreak
#O Transform the links of the image file on wikibooks into an image file on commons
    cat $Projectdir/$pjline/$pjline.images | sed "s/$Site/commons.wikimedia.org/g"| sed "s/Fichier/File/g" > $Projectdir/$pjline/$pjline.commonsimages
#O     Download the image files from the wikimedia server.
#P     Note: the -N option allows you to avoid downloading an up-to-date file,
#P      and without adding a numbering.
#T      #T wget -N -P $Projectdir/$pjline -i $Projectdir/$pjline/$pjline.images
        wget -P $Projectdir/$pjline -r -linf -k -p -E  -i $Projectdir/$pjline/$pjline.commonsimages
#T     echo "*** Commonsimages ***"; cat $Projectdir/$pjline/$pjline.commonsimages; exit 0
#O     Copy the downloaded images to the directory of the current article..
        cp $Projectdir/$pjline/commons.wikimedia.org/wiki/*.html $Projectdir/$pjline/.           
#O     Initialize the commonshtml.list file with empty text.
        echo -n "" > commonshtml.doublons  
#O     List the image files in the order of printing or display,
#O       using the list $Projectdir/$pjline/$pjline.commons.images
#O     As long as we can read lines in $Projectdir/$pjline/$pictline.images
        while read pictline
        do
#O       Cut the lignes at carriage return, sélect the last field and add '.html'
          #echo $pictline | awk -F"/" '{for (i=1;i<=NF;i+=2) print $i "\n"}' #| cut -d '%' -f1 | cut -d '.' -f1 > tmp
          echo $pictline | awk -F"/" '{ print $NF".html"}' >> commonshtml.doublons
#O       Cut the duplicated lines and select even fields.
          echo -n "" > commonshtml.list
          awk 'BEGIN { FILENAME }
                {memfile [NR] = $0 }
               END   { for ( i = 1 ; i <= NR ; i=i+2 ) {
                       print memfile[i] >> "commonshtml.list"
                       } 
	                   # print "Fin"
                     } ' commonshtml.doublons
#O     End of while $Projectdir/$pjline/$pjline.commonsimages
        done < $Projectdir/$pjline/$pjline.commonsimages

#T     Afficher html.list
#T echo "*** commonshtml.list ***"; cat commonshtml.listexit 0
#O   Copy article name in file $Bookname.sclipco
      echo "'''Article : $pjline'''<br />" >> $Pagesclipco
      echo "'''Article : $pjline'''"


#P## Annexe version 'wikimedia commons' ##############################

#O     As long as there are (local) links in the commonshtml.list image file
        while read htmlline
        do
#O       Afficher la ligne lue,
          echo ""
	      echo ""
          echo $" ---- line read = $htmlline --- "
          echo ""
#O   With mkd (sofware), select the character strings from the image file $htmlline
#O    and copy them to $ htmlline.co.str after replacing the character ',' with 
#O    'new-line'
	  mkd -pw '**' $htmlline $htmlline.tmp
	  cat $htmlline.tmp | tr ',' '\n' > $htmlline.co.str 
#T echo "*** $htmlline.co.str : ***"; cat $htmlline.co.str; exit 0     
#O     images, 
        echo -n $"'''Illustration : '''" > $htmlline.co.title
        cat $htmlline.co.str | grep wgTitle | cut -d '"' -f4 >> $htmlline.co.title
	    cat $htmlline.co.title >> $Pagesclipco 
	    cat $htmlline.co.title
#T echo "*** $htmlline.co.title : ***"; cat $htmlline.co.title; exit 0
#O     source, 
        echo -n $", ''source : ''https://commons.wikimedia.org/wiki/" > $htmlline.co.source
        ##echo -n ",''$(gettext 'source : ')''https://commons.wikimedia.org/wiki/" > $htmlline.co.source
	    echo -n $htmlline | sed "s/.html//g" | sed "s/.str//g" >> $htmlline.co.source
        if [ "$Site" = "fr.wikibooks.org" ]; then echo "?uselang=fr" >> $htmlline.co.source
        elif [ "$Site" = "en.wikibooks.org" ]; then echo "?uselang=en" >> $htmlline.co.source
        else echo
        fi
        cat $htmlline.co.source >> $Pagesclipco
        cat $htmlline.co.source
#T echo "*** $htmlline.co.source : ***"; cat $htmlline.co.source; exit 0
#O     license, 
        echo -n $", ''license : '' " > $htmlline.co.license
	    cat $htmlline.co.str | grep licensetpl_short | sed "s/<td>//g" | sed "s/<span class//g" | sed "s/<\/span>//g" | sed "s/style=\"display:none;\"//g" | tr '=' '\n' | grep licensetpl_short | awk -F">" '{print $NF}' >> $htmlline.co.license
        cat $htmlline.co.license >> $Pagesclipco
	    cat $htmlline.co.license
#T echo "*** $htmlline.co.license : ***"; cat $htmlline.co.license; exit 0	   

#O     authors. 
        rm -rf tmp
        echo -n $", ''authors : ''" > $htmlline.co.authors
#Test cat tmp; echo "$htmlline.co.authors"; exit -1
	    cat $htmlline.co.str | grep -i -n -m1 -A 1 -e Author -e Auteur | tr '/' '\n' | grep -i -e user -e utilisteur -e auteur -e author | cut -d '"' -f1 | grep -i -e user -e utilisteur -e auteur -e author > tmp        
        if test -s tmp; then echo ; else echo "-" > tmp; fi
        cat tmp >> $htmlline.co.authors
        cat $htmlline.co.authors >> $Pagesclipco
        cat $htmlline.co.authors 	   
#O   Finish the page $Pagesclipco
      echo "" >> $Pagesclipco
#O   End of as long as there are lines in commonshtml.list
      done < commonshtml.list
#O  End of 'if the line is not the name of book'.
     fi      
#O End of while line in $Bookname.pj
    done < $Projectdir/$Bookname.pj
#O clean intermediate files
    rm -rf tmp
#O End of page $Pagesclipco 
    echo "</div>" >> $Pagesclipco
    #T echo "$(gettext ' {{Newpage}} ')" >> $Pagesclipco 
    echo "<div style='page-break-before:always'></div>" >> $Pagesclipco
#O ============================================================================	
#O Creating Bookname.appendix
    cat $Projectdir/$Bookname.sclt>$Projectdir/$Bookname.appendix
    cat $Projectdir/$Bookname.sclipco>>$Projectdir/$Bookname.appendix
    echo $"= License of articles and sofware =">>$Projectdir/$Bookname.appendix
    echo "<div style='font-zize:85%'>">>$Projectdir/$Bookname.appendix
    echo "Creative Commons Attribution Share Alike 3.0">>$Projectdir/$Bookname.appendix
    echo "//creativecommons.org/licenses/by-sa/3.0/">>$Projectdir/$Bookname.appendix
    echo >>$Projectdir/$Bookname.appendix
    echo $"This appendix is created with addappendix software version $VERSION">>$Projectdir/$Bookname.appendix
    echo "https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/addappendix">>$Projectdir/$Bookname.appendix
    echo "</div>">>$Projectdir/$Bookname.appendix
    echo "<div style='page-break-before:always'></div>">>$Projectdir/$Bookname.appendix
#O ============================================================================	
#O Display file Bookname.appendix
    echo;echo -e "\033[1;32mcopy and paste the text displayed and add after the book $Bookname.\033[0m"
    cat $Projectdir/$Bookname.appendix 
    echo;echo -e "\033[1;32mcopy and paste the text displayed and add after the book.$Bookname\033[0m"
    exit 0
#O addappendix script end

script tests_addappendix.bash modifier

#!/bin/bash
#!/bin/bash
#H Header doc
#H -------------------------------
#H File : tests/addappendix/tests_addapendix.bash
#H Syntax : ./tests_addapendix.bash
#H Created : 220113 by GC
#H Updated : 220113 by ... for
#O Organizational chart
#O -------------------------------
#P Programmers notes
#P -------------------------------
VERSION=220119
#P Before execute this tests, execute tests/preinstall-usr-local.bash to install datas directory in /usr/local

echo -e "\033[1;033mtest addappendix.sh with first param empty\033[0m"
./addappendix.sh
sleep 3
echo "----"

echo -e "\033[1;033mtest addappendix.sh with first param = '?'\033[0m"
./addappendix.sh ?
sleep 3
echo "----"

echo -e "\033[1;033mtest addappendix.sh with first param = '--v'\033[0m"
./addappendix.sh --v
sleep 3
echo "----"

echo -e "\033[1;033mtest addappendix.sh with param = https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel\033[0m"
./addappendix.sh https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel

Résultat des tests modifier

Au Terminal
cardabela@jpl-W230SS:~/addappendix-211219/tests/addapendix$ ./tests_addapendix.bash 
test addappendix.sh with first param empty
No parameter. addappendix [ <full url of book> | ? | -v ]
----
test addappendix.sh with first param = '?'
Syntax: addappendix [ <full url of book> | -v ]
  Example 1 : addappendix https://en.wikibooks.org/wiki/Wikibooks:Collections/Guide_to_Unix
  Example 2 : addappendix https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel

----
test addappendix.sh with first param = '-v'
addapendix version : 220117
----
test addappendix.sh with param = https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel
https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel
  is a wiki-books
File https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel is found

Book name : Faire_sa_fleur_de_sel
Compilations name: Wikilivres:Compilations
Suffix = compiled

Faire_sa_fleur_de_sel.compiled : 
[[Faire fleurir le sel/Couverture]]
[[Faire fleurir le sel/Introduction]]
[[Faire fleurir le sel/Préparation]]
[[Faire fleurir le sel/Filtrer et aseptiser]]
[[Faire fleurir le sel/Récolter]]

Dowload https://fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel

List of book files created 31/01/2022
 find Add_appendix/books/Faire_sa_fleur_de_sel/
Add_appendix/books/Faire_sa_fleur_de_sel/
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.prj
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/robots.txt
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel/Introduction.html
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel/Récolter.html
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel/Préparation.html
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel/Filtrer_et_aseptiser.html
Add_appendix/books/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Faire_fleurir_le_sel/Couverture.html
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.dirs
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtre
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.license
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.author
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.html
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.str
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.article
Add_appendix/books/Faire_sa_fleur_de_sel/Filtrer_et_aseptiser/Filtrer_et_aseptiser.RevisionId
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.sclt
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.compiled.cleaned
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.pj
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.locale.list
Add_appendix/books/Faire_sa_fleur_de_sel/.tmp
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.compiled
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.list
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.author
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.html
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.RevisionId
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.license
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.str
Add_appendix/books/Faire_sa_fleur_de_sel/Préparation/Préparation.article
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.tmp
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.license
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.html
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.author
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.article
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.str
Add_appendix/books/Faire_sa_fleur_de_sel/Récolter/Récolter.RevisionId
Add_appendix/books/Faire_sa_fleur_de_sel/resources
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/fr.wikibooks.org
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/fr.wikibooks.org/robots.txt
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Wikilivres:Compilations
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/fr.wikibooks.org/wiki/Wikilivres:Compilations/Faire_sa_fleur_de_sel.html
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/extract-dd1
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.compiled
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/extract-li1
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/extract-dd
Add_appendix/books/Faire_sa_fleur_de_sel/resources/Faire_sa_fleur_de_sel/extract-li
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.article
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.html
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.license
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.RevisionId
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.str
Add_appendix/books/Faire_sa_fleur_de_sel/Introduction/Introduction.author
Add_appendix/books/Faire_sa_fleur_de_sel/Faire_sa_fleur_de_sel.mainPage
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.license
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.article
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.tmp
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.RevisionId
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.html
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.author
Add_appendix/books/Faire_sa_fleur_de_sel/Couverture/Couverture.str

Appendix en anglais créée avec addappendix le 25 février 2022 modifier

  • À consulter :

Appendix de la compilation Faire_sa_fleur_de_sel, le 25 février 2022, avec la version internationalisée addappendix pour l'empaquetage linux;


Annexe en français créée avec addappendix le 6 mars 2022 modifier

Annexes de la compilation avec la traduction fr/LC_MESSAGES/addappendix.mo

  • À comparer avec la version de juin 2020 :

Annexe de Faire_fleurir_le_sel, Juin 2020, avec la première version Annexer

Tests du script d’installation du logiciel par Makefile modifier

Script du Makefile modifier

#!/bin/make
# file:Makefile to install ubuntu addappendix
# addappendix-O~220313
# updated by french wikibooks user:Goelette_Cardabela
# 
# Install this Makefile in ~/Add_appendix
# To test make -d clean install DESTDIR=../tests
# Lors de l'installation les fichiers sources doivent être recopiés
# d'un autre répertoire qui peut être ~/Add_appendix/tests
##
# /usr/local directory :
VERSION=220313
BIN		= $(DESTDIR)/usr/local/bin
DOCU	= $(DESTDIR)/usr/local/share/addappendix/doc
CATMANDIR		= $(DESTDIR)/var/cache/man
CATMANDIR_FR	= $(DESTDIR)/var/cache/man/fr.UTF-8/cat1 debian
DATAS	= $(DESTDIR)/usr/local/datas
DOC		= $(DESTDIR)/usr/local/share/doc/Add_appendix
ETC		= $(DESTDIR)/usr/local/etc
LIB		= $(DESTDIR)/usr/local/lib
SLIBS	= annex.lib.sh cpcleaned2bin.sh ecfpb.sh ecfpc.sh findbook.sh killalldoc.sh
# system directories :
ICONS	= $(DESTDIR)/usr/share/icons/hicolor
LANG	= $(DESTDIR)/usr/share/locale
MAN		= $(DESTDIR)/usr/share/man
MIME	= $(DESTDIR)/usr/share/mime
SRC		= $(DESTDIR)/usr/local/src/Add_appendix
SRCS	= addappendix.sh
SBIN	= $(DESTDIR)/usr/local/sbin
SBINS	= compil2bin.sh findversions.sh install_annex.sh \
		install_datasfiles.sh makeman_annex.sh users_install_annex.sh
PGM		= addappendix

# local Add_appendix directories as variables
Installdir=.
Workdir=.
Bindir=./bin
Booksdir=./books
Datasdir=./datas
Libdir=./lib
Sharedir=./share
Srcdir=./src/Add_appendix
Sbindir=./sbin
Testsdir=./tests
Varsdir=./vars
Langdir=./share/addappendix/resources/lang/po
Localedir=./share/locale
Mandir=./share/man

install: $(PGM)
            
$(PGM): 
	@echo "*** DESTDIR : $(DESTDIR)"
	# Create all directories to making up the application
	install -d $(BIN) $(DOCU) $(CATMANDIR_FR) $(DATAS) $(LIB) $(ETC) $(SBIN) $(SRC)
	# Copy all sources files in SRC directory
	cp -f $(Srcdir)/* $(SRC)/.
	# Copy all executables files in BIN directory
	cp -f $(Bindir)/* $(BIN)/.
	# Copy all datas files to DATAS directory
	cp -f $(Datasdir)/* $(DATAS)/.
	# Copy all sbin executables files to SBIN directory
	cp -rf $(Sbindir)/* $(SBIN)/.
	# Copy all lib files to LIB directory
	cp -rf $(Libdir)/* $(LIB)/.
	# Create new Add_appendix directory and essential sub-directories from package
	@if [ -e ~/Add_appendix ]; then echo "~/Add_appendix exist, ok"; else mkdir -p ~/Add_appendix; fi
	@if [ -e ~/Add_appendix/books ]; then echo "~/Add-appendix/books exist ok"; else mkdir -p ~/Add_appendix/books; fi
	@if [ -e ~/Add_appendix/vars ]; then echo "~/Add_appendix/vars exist ok"; else mkdir -p ~/Add_appendix/vars; fi
	@if [ -e ~/Add_appendix/temp ]; then mkdir -p ~/Add_appendix/temp; fi

install: $(PGM)
    # Create SHARE sub directories
	install -d $(ICON) $(LANG) $(MAN) $(MIME)

	#install icons and update cache
	install -d $(ICONS) $(ICONS)/scalable/mimetypes $(ICONS)/256x256/mimetypes
	install -d $(ICONS)/256x256/apps $(ICONS)/48x48/apps $(ICONS)/32x32/apps $(ICONS)/16x16/apps $(ICONS)/8x8/apps
	#cp -f $(Sharedir)/icons/AA256x256.svg $(ICONS)/scalable/mimetypes/addappendix.svg
	cp -f $(Sharedir)/icons/hicolor/scalable/mimetypes/addappendix.svg  $(ICONS)/scalable/mimetypes/addappendix.svg
	#cp -f $(Sharedir)/icons/AA256x256.png $(ICONS)/256x256/mimetypes/addappendix.png
	cp -f $(Sharedir)/icons/hicolor/256x256/mimetypes/addappendix.png $(ICONS)/256x256/mimetypes/addappendix.png
	#cp -f $(Sharedir)/icons/AA256x256.svg $(ICONS)/256x256/mimetypes/addappendix.svg
	cp -f $(Sharedir)/icons/hicolor/256x256/mimetypes/addappendix.svg $(ICONS)/256x256/mimetypes/addappendix.svg
	#cp -f $(Sharedir)/icons/AA48x48bleu.png $(ICONS)/48x48/apps/addappendix.png
	cp -f $(Sharedir)/icons/hicolor/48x48/apps/addappendix.png $(ICONS)/48x48/apps/addappendix.png
	#cp -f $(Sharedir)/icons/AA32x32bleu.png $(ICONS)/32x32/apps/addappendix.png
	cp -f $(Sharedir)/icons/hicolor/32x32/apps/addappendix.png $(ICONS)/32x32/apps/addappendix.png
	#cp -f $(Sharedir)/icons/AA16x16bleu.png $(ICONS)/16x16/apps/addappendix.png
	cp -f $(Sharedir)/icons/hicolor/16x16/apps/addappendix.png $(ICONS)/16x16/apps/addappendix.png
	#cp -f $(Sharedir)/icons/AA8x8bleu.png $(ICONS)/8x8/apps/addappendix.png
	cp -f $(Sharedir)/icons/hicolor/8x8/apps/addappendix.png $(ICONS)/8x8/apps/addappendix.png
	#
	# Attention il faut que toute la commande soit sur la même ligne d'où le caractère escape '\'
	# On ne peut mettre à jour la base de données que si les images sont installées dans le système
	# La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
	@if [ -z $(DESTDIR) ]; then sudo gtk-update-icon-cache -t /usr/share/icons/hicolor;fi

	# Install languages after directories installation
	install -d $(LANG)/de/LC_MESSAGES $(LANG)/en/LC_MESSAGES $(LANG)/fr/LC_MESSAGES $(LANG)/es/LC_MESSAGES
	## de
	#cp -f $(Localedir)/de/LC_MESSAGES/*.mo $(LANG)/de/LC_MESSAGES/.
	## en
	#cp -f $(Localedir)/en/LC_MESSAGES/*.mo $(LANG)/en/LC_MESSAGES/.
	## es
	#cp -f $(Localedir)/es/LC_MESSAGES/*.mo $(LANG)/es/LC_MESSAGES/.
	## fr
	cp -f $(Localedir)/fr/LC_MESSAGES/*.mo $(LANG)/fr/LC_MESSAGES/.
	cp -u $(Langdir)/fr/addappendix.mo $(LANG)/fr/LC_MESSAGES/addappendix.mo
	cp -u $(Langdir)/fr/annex.mo $(LANG)/fr/LC_MESSAGES/annex.mo
	cp -u $(Langdir)/fr/header.inc.mo $(LANG)/fr/LC_MESSAGES/header.inc.mo

	#install manuals
	install -d $(MAN) $(MAN)/man1 $(MAN)/de/man1 $(MAN)/en/man1 $(MAN)/es/man1 $(MAN)/fr/man1 $(MAN)/fr.UTF-8/man1
	## Default manual
	@if [ -e $(Mandir)/man1/addappendix.1.gz ]; then catman -M $(Man)/man1/addappendix.1.gz; fi
	@if [ -e $(mandir)/man1/annex.1.gz ]; then catman -M $(MAN)/man1/annex.1.gz; fi
	@if [ -e $(mandir)/man1/compil2bin.1.gz; then catman -M $(MAN)/man1/compil2bin.1.gz; fi
	## de
	## en
	## es
	## fr
	@if [ -e $(Mandir)/fr.UTF-8/man1/addappendix.1.gz ]; then catman -M $(MAN)/fr.UTF-8/man1/addappendix.1.gz; fi
	@if [ -e $(Mandir)/fr.UTF-8/man1/annex.1.gz; then catman -M $(MAN)/fr.UTF-8/man1/annex.1.gz; fi
	@if [ -e $(Mandir)/fr.UTF-8/man1/annexer.1.gz; then catman -M $(MAN)/fr.UTF-8/man1/annexer.1.gz; fi
	# La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
	@if [ -z $(DESTDIR) ]; then mandb -u; fi

	#install mime
	install -d $(MIME)
	@if [ -e $Sharedir/mime/packages/addappendix.xml ]; then cp -f $Sharedir/mime/package/addappendix.xml $(MIME)/packages/addappendix.xml; fi
	@if [ -e $Sharedir/mime/packages/annexer.xml ]; then cp -f $Sharedir/mime/packages/annexer.xml $(MIME)/packages/annexer.xml; fi
	# La ligne suivante est à inclure dans 'postinst' du paquet ubuntu
	@if [ -z $(DESTDIR) ]; then sudo update-mime-database /usr/share/mime; fi

	
	#install archives
	#install -d $(ARCHIVES)/books
	#cp -rf ./archives/books/* $(ARCHIVES)/books/.
		
clean:
	rm -rf ./tmp
Résultat du test
~/tests$ find usr
usr
usr/share
usr/share/man
usr/share/man/es
usr/share/man/es/man1
usr/share/man/en
usr/share/man/en/man1
usr/share/man/de
usr/share/man/de/man1
usr/share/man/fr
usr/share/man/fr/man1
usr/share/man/man1
usr/share/man/fr.UTF-8
usr/share/man/fr.UTF-8/man1
usr/share/locale
usr/share/locale/es
usr/share/locale/es/LC_MESSAGES
usr/share/locale/en
usr/share/locale/en/LC_MESSAGES
usr/share/locale/de
usr/share/locale/de/LC_MESSAGES
usr/share/locale/fr
usr/share/locale/fr/LC_MESSAGES
usr/share/locale/fr/LC_MESSAGES/add_sclipwb.mo
usr/share/locale/fr/LC_MESSAGES/header.inc.mo
usr/share/locale/fr/LC_MESSAGES/en_sclipco.inc.mo
usr/share/locale/fr/LC_MESSAGES/en_sclt.inc.mo
usr/share/locale/fr/LC_MESSAGES/en_sclipwb.inc.mo
usr/share/locale/fr/LC_MESSAGES/annexer.mo
usr/share/locale/fr/LC_MESSAGES/scli.inc.mo
usr/share/locale/fr/LC_MESSAGES/addappendix.mo
usr/share/locale/fr/LC_MESSAGES/add_sclt.mo
usr/share/locale/fr/LC_MESSAGES/annex.mo
usr/share/locale/fr/LC_MESSAGES/fr_FR_addappendix.mo
usr/share/locale/fr/LC_MESSAGES/en_sclic.inc.mo
usr/share/locale/fr/LC_MESSAGES/add_sclipco.mo
usr/share/locale/fr/LC_MESSAGES/add_sclic.mo
usr/share/icons
usr/share/icons/hicolor
usr/share/icons/hicolor/48x48
usr/share/icons/hicolor/48x48/apps
usr/share/icons/hicolor/48x48/apps/addappendix.png
usr/share/icons/hicolor/16x16
usr/share/icons/hicolor/16x16/apps
usr/share/icons/hicolor/16x16/apps/addappendix.png
usr/share/icons/hicolor/256x256
usr/share/icons/hicolor/256x256/apps
usr/share/icons/hicolor/256x256/mimetypes
usr/share/icons/hicolor/256x256/mimetypes/addappendix.svg
usr/share/icons/hicolor/256x256/mimetypes/addappendix.png
usr/share/icons/hicolor/32x32
usr/share/icons/hicolor/32x32/apps
usr/share/icons/hicolor/32x32/apps/addappendix.png
usr/share/icons/hicolor/8x8
usr/share/icons/hicolor/8x8/apps
usr/share/icons/hicolor/8x8/apps/addappendix.png
usr/share/icons/hicolor/scalable
usr/share/icons/hicolor/scalable/mimetypes
usr/share/icons/hicolor/scalable/mimetypes/addappendix.svg
usr/share/mime
usr/local
usr/local/bin
usr/local/bin/add_sclic
usr/local/bin/testexecution
usr/local/bin/fr_sclt.inc
usr/local/bin/annex
usr/local/bin/site.txt
usr/local/bin/add_sclipwb
usr/local/bin/pre-annex
usr/local/bin/fr_sclipwb.inc
usr/local/bin/addappendix
usr/local/bin/en_sclic.inc
usr/local/bin/add_sclt
usr/local/bin/en_sclt.inc
usr/local/bin/header.inc
usr/local/bin/annexer
usr/local/bin/compilations.txt
usr/local/bin/mwbookurl.txt
usr/local/bin/en_sclipco.inc
usr/local/bin/add_appendix
usr/local/bin/updt-langs.bash
usr/local/bin/bookname.txt
usr/local/bin/en_sclipwb.inc
usr/local/bin/add_sclipco
usr/local/bin/scli.inc
usr/local/bin/README
usr/local/bin/list
usr/local/bin/fr_sclipco.inc
usr/local/bin/fr_sclic.inc
usr/local/bin/download
usr/local/share
usr/local/share/addappendix
usr/local/share/addappendix/doc
usr/local/src
usr/local/src/Add_appendix
usr/local/src/Add_appendix/add_sclic.sh
usr/local/src/Add_appendix/list.sh
usr/local/src/Add_appendix/en_sclic.inc.sh
usr/local/src/Add_appendix/files_list
usr/local/src/Add_appendix/en_sclipwb.inc.sh
usr/local/src/Add_appendix/add_sclipwb.sh
usr/local/src/Add_appendix/addappendix.sh
usr/local/src/Add_appendix/header.inc.sh
usr/local/src/Add_appendix/download.sh
usr/local/src/Add_appendix/fr_sclic.inc.sh
usr/local/src/Add_appendix/annexer.sh
usr/local/src/Add_appendix/FILES-VERSIONS.txt
usr/local/src/Add_appendix/add_sclipco.sh
usr/local/src/Add_appendix/fr_sclt.inc.sh
usr/local/src/Add_appendix/scli.inc.sh
usr/local/src/Add_appendix/annex.sh
usr/local/src/Add_appendix/en_sclipco.inc.sh
usr/local/src/Add_appendix/fr_sclipwb.inc.sh
usr/local/src/Add_appendix/fr_sclipco.inc.sh
usr/local/src/Add_appendix/en_sclt.inc.sh
usr/local/src/Add_appendix/pre-annex.sh
usr/local/src/Add_appendix/add_sclt.sh
usr/local/src/Add_appendix/add_appendix.sh
usr/local/lib
usr/local/lib/cpcleaned2bin.lib
usr/local/lib/ecf.lib
usr/local/lib/killalldoc.lib
usr/local/lib/findbook.lib
usr/local/lib/src
usr/local/lib/src/findbook.sh
usr/local/lib/src/files_list
usr/local/lib/src/FILES-VERSIONS.txt
usr/local/lib/src/ecfpc.sh
usr/local/lib/src/annex.lib.sh
usr/local/lib/src/killalldoc.sh
usr/local/lib/src/cpcleaned2bin.sh
usr/local/lib/src/ecfpb.sh
usr/local/lib/updt-annex-lib.sh
usr/local/lib/annex.lib
usr/local/sbin
usr/local/sbin/userman
usr/local/sbin/sbin_files.list
usr/local/sbin/sbin_files.versions.txt
usr/local/sbin/install_datasfiles
usr/local/sbin/install_annex
usr/local/sbin/users_install_annex
usr/local/sbin/htmlman
usr/local/sbin/BINFILES_VERSIONS
usr/local/sbin/makeman_annex
usr/local/sbin/sbin_files.versions2.txt
usr/local/sbin/src
usr/local/sbin/src/install_datasfiles.sh
usr/local/sbin/src/install_annex.sh
usr/local/sbin/src/users_install_annex.sh
usr/local/sbin/src/SRCFILES_VERSIONS
usr/local/sbin/src/compil2bin.sh
usr/local/sbin/src/findversions.sh
usr/local/sbin/src/makeman_annex.sh
usr/local/sbin/src/.txt
usr/local/sbin/src/list.txt
usr/local/sbin/compil2bin
usr/local/sbin/findversions
usr/local/sbin/textman
usr/local/sbin/docu2html
usr/local/sbin/updt-manuals
usr/local/etc
usr/local/datas
usr/local/datas/content_cleaner.dat
usr/local/datas/conversions.dat
usr/local/datas/unrecognized_links.dat
jpl@jpl-GE60-2OC-2OE:~/tests$ ls
usr  var
~/tests$ find var
var
var/cache
var/cache/man
var/cache/man/fr.UTF-8
var/cache/man/fr.UTF-8/cat1

liste des réperoires créés modifier





Construction du paquet ubuntu modifier

  • Création d'un paquet dit origine

  vβ 211220 Éditer






Créer l'archive origine modifier

  • Le répertoire d’origine doit être en caractères minuscules
  • Il doit être de la forme <package>-<version>
  • Notre répertoire origine aura pour nom addappendix-211219
Créer l'original
Entrer dans le répertoire addappendix-211219'
dh_make --createorig

Nous obtenons à l'exécution avec l'option 'i' (indep):

Type of package: (single, indep, library, python)
[s/i/l/p]?
Maintainer Name     : Cardabela
Email-Address       : cardabela@unknown
Date                : Sun, 19 Dec 2021 14:57:49 +0100
Package Name        : addappendix
Version             : 211219
License             : blank
Package Type        : indep
Are the details correct? [Y/n/q]
Please respond with "yes", "no" or "quit" (or "y", "n" or "q")
Done. Please edit the files in the debian/ subdirectory now.
  • Cette commande va créer
  1. l'archive /home/cardabela/addappendix_211219.orig.tar.xz
  2. le répertoire /home/cardabela/addappendix_211219/debian qui contiendra les fichiers standard d'empaquetage:
addappendix.cron.d.ex    manpage.sgml.ex  README.source
addappendix.doc-base.EX  manpage.xml.ex   rules
addappendix-docs.docs    postinst.ex      salsa-ci.yml.ex
changelog                postrm.ex        source
control                  preinst.ex       watch.ex
copyright                prerm.ex
manpage.1.ex             README.Debian

On peut supprimer addappendix.doc-base.EX

Mise à jour des fichiers d'empaquetage modifier

Note: https://www.debian.org/doc/manuals/maint-guide/dother.en.html#docs

changelog modifier

changelog initial

addappendix (211219-1) unstable; urgency=medium

  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>

 -- Cardabela <cardabela@unknown>  Sun, 19 Dec 2021 14:57:49 +0100
  • changelog peut être unstable, experimental, unreleased, version de linux ubuntu.
  • utiliser unreleased pour éviter l'enregistrement par erreur sur le ppa
addappendix (211219-1) unstable; urgency=medium

  * Initial Release.

 -- https://fr.wikibooks.org/wiki/Discussion_utilisateur:Goelette_Cardabela/addappendix  Sun, 19 Dec 2021 14:57:49 +0100

control modifier

addappendix (211219-1) unstable; urgency=medium

  * Initial release 

 -- https://fr.wikibooks.org/wiki/Discussion_utilisateur:Goelette_Cardabela/addappendix  Sun, 19 Dec 2021 14:57:49 +0100
 

addappendix-docs.docs modifier

  • Ces fichiers se trouvent dans le répertoire origine
  • Attention README sans extension dans le répertoire origine concerne les versions de Add_appendix indépendantes du paquet
README.Debian
README.source
SURVEY
TRANSLATIONS

copyright modifier

Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: addappendix
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/addappendix

Files: *
Copyright: 2021 Goelette Cardabela french wikibooks user
           <years> <likewise for another author>
License: <special license>
 <Put the license of the package here indented by 1 space>
 <This follows the format of Description: lines in control file>
 .
 <Including paragraphs>

# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2021 Cardabela <goelette.cardabela@orange.fr>
License: GPL-2+
 This package is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 .
 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <https://www.gnu.org/licenses/>
 .
 On Debian systems, the complete text of the GNU General
 Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
#
# If you need, there are some extra license texts available in two places:
#   /usr/share/debhelper/dh_make/licenses/
#   /usr/share/common-licenses/

preinst modifier

postinst modifier

prerm modifier

postrm modifier

Créer le Makefile original modifier

  • Ce 'Makefile' est destiné aux tests afin de l'intégrer dans la production d'un 'paquet' ubuntu.
  • Il doit être placé dans le répertoire dit 'origine' addappendix_211219 qui contient les sources.
  • On entend par sources, toutes les sources, du programme, de la maintenance, des images, etc.
On se contentera d'adapter le Makefis d'installation

Auto-éditer un wikilivre/Annexer (Version internationalisée)/Makefile

Empaqueter modifier

  1. https://fr.wikibooks.org/wiki/Annexes_de_wikibooks
  2. https://fr.wikibooks.org/wiki/Auto-éditer_un_wikilivre/Annexer_(Version_orignale)/Version_imprimable