#!/bin/sh # # THhis script extracts parts of the HandBook to build the documentation # provided in the installer. This way translations of the HandBook are also # usable in the installers' documentation, displayed when typing 'doc' # just loading the web page in w3m. SLINTDOCS=/storage/DidierSpaier/slint-translations rm -f *.po *.adoc *.html cp $SLINTDOCS/translations/HandBook/*.po ./ for PO in $(ls *.po); do po4a-translate -M UTF-8 -f asciidoc -m $SLINTDOCS/source/HandBook.adoc -p $PO -l ${PO%po}adoc done cp $SLINTDOCS/source/HandBook.adoc ./en_US.HandBook.adoc for handbook in $(ls *.adoc); do ll_TT=$(echo ${handbook%.*.*}) rm -f $ll_TT.adoc echo \ ":toc: left :toclevels: 1 :toc-title: :toc-class: unstyled " >> ${ll_TT}.adoc # Chapter Overview of Slint installation sed -n '/Overview_of_Slint_Installation]/,/Usage_of_the_installer]/p' $handbook|head -n -1 >> ${ll_TT}.adoc # Chapter Usage of the installer sed -n "/Usage_of_the_installer]/,/Encryption]/p" $handbook|head -n -1 >>${ll_TT}.adoc # Chapter Prepare partitions for Slnt sed -n '/prepare_partitions_for_Slint]]/,/^=== /p' $handbook|head -n -1 >>${ll_TT}.adoc # Chapter Encryption sed -n "/Encryption]/,/Speakup]/p" $handbook|head -n -1 >>${ll_TT}.adoc # Chapter Speakup sed -n "/Speakup]/,/first_steps_after_installation]/p" $handbook|head -n -1 >>${ll_TT}.adoc # Chapter Glossary. Ugly way to find its beginning, but seems to work. sed -n '/"autowidth"/,$p' $handbook|tail -n -123 >>${ll_TT}.adoc # Normalize the headers' levels not the same in the installer doc as in the HandBook sed 's/^== /==== /' ${ll_TT}.adoc > bof && mv bof ${ll_TT}.adoc sed -n "/first_steps_after_installation]/,/README.slaptgetrc.Slint/p" $handbook >> ${ll_TT}.adoc sed 's/^===== /=== /' ${ll_TT}.adoc > bof && mv bof ${ll_TT}.adoc sed 's/^==== /== /' ${ll_TT}.adoc > bof && mv bof ${ll_TT}.adoc asciidoctor ${ll_TT}.adoc done