From e4400791cbe26c87f28ce7ce3cd517654836a16f Mon Sep 17 00:00:00 2001 From: dsiders Date: Fri, 10 Jan 2025 01:08:57 -0500 Subject: [PATCH] Docs: LazControls. Removes Windows cruft from build script. (cherry picked from commit 66e7c0348d5851cebfaad5357a072a984eb1596a) --- components/lazcontrols/docs/make-docs.sh | 76 ++++++++++++++++++++---- 1 file changed, 65 insertions(+), 11 deletions(-) mode change 100644 => 100755 components/lazcontrols/docs/make-docs.sh diff --git a/components/lazcontrols/docs/make-docs.sh b/components/lazcontrols/docs/make-docs.sh old mode 100644 new mode 100755 index 2fb9b93157..9ca008153b --- a/components/lazcontrols/docs/make-docs.sh +++ b/components/lazcontrols/docs/make-docs.sh @@ -9,26 +9,80 @@ #======================================= # SET THE CORRECT PATHS FOR YOUR SYSTEM #======================================= -# lazarus documentation directory -docdir="../../../docs" -# fpdoc executable directory -#fpcdir="../../../fpc/3.2.2/bin/x86_64-win64" -fpcdir="../../../../fpc331/fpc/bin/x86_64-win64" +# lazarus documentation and chm directories +docdir=$(realpath ../../../docs) +chmdir=$docdir/chm + +# path to fpdoc executable and file name +fpcdir=$(realpath ../../../../fpc/bin/x86_64-linux) +#fpcdir=$(realpath ~/fpc331/fpc/bin/x86_64-linux) +fpdocpgm=$fpcdir/fpdoc + +# path to lazarus git repo +gitpath=$(realpath ../../..) + +# version number, commit hash, generated date, link info for footer files +#verno="4.99" +#verno="4.0.0-RC2" +vermaj=`git -C $gitpath describe --long --always | cut -d "-" -f 1 | cut -d "_" -f 2` +vermin=`git -C $gitpath describe --long --always | cut -d "-" -f 1 | cut -d "_" -f 3` +verno=$vermaj.$vermin +commit=`git -C $gitpath describe --all --long | cut -d "-" -f 3 | cut -b "2-"` +dt=`date +"%Y-%m-%d"` +linkurl="https://dsiders.gitlab.io/lazdocsnext/" +#linkurl="https://lazarus-ccr.sourceforge.io/docs/" +linktext="Home" + +#chm format footer file +cat < ./lazcontrols-chm-footer.xml + + + + + + + + +EOT + +# html format footer file +cat < ./lazcontrols-html-footer.xml + + + + + + + + +EOT echo -e "\n\e[7m LazControls package \e[0m"; -# generate chm format without footers +# generate chm format # imports done manually to set the correct prefix for the output format # output to current directory echo "Generating CHM help..." -$fpcdir/fpdoc --project=lazcontrols-project.xml --format=chm --import="$docdir/chm/rtl.xct,ms-its:rtl.chm::/" --import="$docdir/chm/fcl.xct,ms-its:fcl.chm::/" --import="$docdir/chm/lcl.xct,ms-its:lcl.chm::/" --import="$docdir/chm/lazutils.xct,ms-its:lazutils.chm::/" 2>&1 | tee ./build_chm.log +$fpdocpgm --project=lazcontrols-project.xml --format=chm --footer="lazcontrols-chm-footer.xml" --import="$chmdir/rtl.xct,ms-its:rtl.chm::/" --import="$chmdir/fcl.xct,ms-its:fcl.chm::/" --import="$chmdir/lcl.xct,ms-its:lcl.chm::/" --import="$chmdir/lazutils.xct,ms-its:lazutils.chm::/" 2>&1 | tee ./build_chm.log -# generate html format without footers +# generate html format # imports done manually to set the correct prefix for the output format # html written to lazcontrols sub-directory echo "Generating HTML help..." -$fpcdir/fpdoc --project=lazcontrols-project.xml --format=html --import="$docdir/chm/rtl.xct,../rtl/" --import="$docdir/chm/fcl.xct,../fcl/" --import="$docdir/chm/lcl.xct,../lcl/" --import="$docdir/chm/lazutils.xct,../lazutils/" --output=lazcontrols 2>&1 | tee ./build_html.log +$fpdocpgm --project=lazcontrols-project.xml --format=html --footer="lazcontrols-html-footer.xml" --import="$chmdir/rtl.xct,../rtl/" --import="$chmdir/fcl.xct,../fcl/" --import="$chmdir/lcl.xct,../lcl/" --import="$chmdir/lazutils.xct,../lazutils/" --output=lazcontrols 2>&1 | tee ./build_html.log -# copy generated chm, xct to lazarus docs directory -cp -v lazcontrols.{chm,xct} $docdir/chm/ +# copy generated chm, xct to chm directory +mv -v lazcontrols.{chm,xct} $chmdir/ + +# generate an archive for html content +7z a -t7z -mx9 -r docs-html-lazcontrols-$dt.7z ./lazcontrols/ +#mv -v docs-html-lazcontrols-$dt.7z $docdir/build/html/ + +# clean up +rm -rf ./lazcontrols +rm -v lazcontrols-*-footer.xml +#rm -v *.log +#rm -v *.7z