« Auto-éditer un wikilivre/Auto-référencer/ajouter sclt.sh » : différence entre les versions
Contenu supprimé Contenu ajouté
m WL:RD : * diverses retouches |
WL:RD : * diverses retouches, ! mise en page |
||
Ligne 1 :
<syntaxhighlight lang="bash">
#! /bin/bash
VERSION=200623
#P Nom du fichier de commandes : ajouter_sclt
#P Syntaxe : "ajouter_sclt <nom du livre>"
Ligne 49 ⟶ 50 :
#O inclure le fichier d'entête header.sh
source header.inc
if [ $0=ajouter_sclt ]; then echo "ajouter_sclt : Version "$VERSION; fi
#O## ajouter_sclt ###########
Ligne 81 ⟶ 84 :
echo "<small>" >> $PageSclt
echo -n "https://" >> $PageSclt
cat $Projet/
#P autre version : cat $Projet/$1".list" | tr ' ' '_' | tr '\n' '%' | sed "s/%/%\n/g" | grep $1% | tr -d % >> $PageSclt
echo "</small>" >> $PageSclt
Ligne 125 ⟶ 128 :
#O extraire et copier toutes les chaînes de caractères du fichier html
#O $ligne.html dans le fichier $ligne.str et les dupliquer à l'écran
#T pwd
mkd -pws '**'
#T break
#O créer les fichiers de documentation des pages :
echo "*** Références : articles, src, lic, contrib. "
Ligne 174 ⟶ 178 :
#O auteur(s).
echo -n ", ''auteur(s) : ''" > $Projet/$ligne/$ligne.auteur
cat $Projet/$ligne/$ligne.str | grep -n -m 1 -i -e wgRelevantUserName | sed "s/\"/%/g" | cut -d'%' -f4
if test -s tmp;
then cat tmp >> $Projet/$ligne/$ligne.auteur; rm tmp;▼
else
echo "Pas trouvé d'auteur ! " >> $Projet/$ligne/$ligne.auteur
echo "voir : https://xtools.wmflabs.org/articleinfo/fr.wikibooks.org/$ligne" >> $Projet/$ligne/$ligne.auteur;
fi
if [ $ligne != $1 ]
then
cat $Projet/$ligne/$ligne.auteur >> $PageSclt
cat $Projet/$ligne/$ligne.auteur
fi
▲ cat $Projet/$ligne/$ligne.auteur
echo "" >> $PageSclt
Ligne 189 ⟶ 201 :
exit 0
# Fin de ajouter_sclt
</syntaxhighlight>
# {{AutoCat}}
|