Auto-éditer un wikilivre/Annexer (Version internationalisée)/src/lang/man/doc2html.sh
Apparence
#!/bin/sh
# File docu2html.sh
# Syntax docu2html.sh <man>
# Example : ./doccu2html.sh mkd
# ATTENTION éditer les manuels uniquement avec gedit ! ou gmanedit !
# La commande docu2html nécessite l'installation de man2html-base
# sudo apt install man2html-base
rm *.gz
#
# man (1)
#
rm *~
# Compress the .1 files
gzip -vkf *.1 # → *.1.gz
# Create text and UTF-8 html (de) manual
man ./$1_de.1.gz > $1_de.txt
echo "<meta charset=\"utf-8\">" > $1_de.html
man2html $1_de.1.gz >> $1_de.html
# Create plain text and ASCII html (en) manual
# Create plain text and utf-8 html (en) manual
man ./$1_en.1.gz > $1_en.txt
echo "<meta charset=\"utf-8\">" > $1_en.html
man2html $1_en.1.gz >> $1_en.html
# CReate text and UTF-8 html (fr) manual
man ./$1_fr.1.gz > $1_fr.txt
echo "<meta charset=\"utf-8\">" > $1_fr.html
man2html $1_fr.1.gz >> $1_fr.html
#
# man (3)
#
# Compress the .3 files
gzip -vkf *.3 # → *.3.gz
# Create plain text and ASCII html (en) manual
man ./$1_en.3.gz > $1_en.txt
man2html $1_en.3.gz > $1_en.html
#
# Copy to doc files
#
install -d ../../doc/html
gzip -vkf *.txt
chmod 644 *.gz *.html
cp -f *.txt.gz ../../doc/.
rm -f *.txt
cp -f *.html ../../doc/html/.
cp -f $1_de.1.gz ../../man/de/$1.1.gz
cp -f $1_en.1.gz ../../man/en/$1.1.gz
cp -f $1_fr.1.gz ../../man/fr/$1.1.gz
read inkey