mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 10:35:58 +02:00
Docs: LazControls. Removes footer processing in project file and scripts.
This commit is contained in:
parent
73afaa0226
commit
061ba75ede
@ -11,12 +11,12 @@
|
||||
<option name="dont-trim" value="true"/>
|
||||
<option name="emit-notes" value="false"/>
|
||||
<option name="css-file" value="lazcontrols.css"/>
|
||||
<option name="footer" value="@lazcontrols-footer.xml"/>
|
||||
<option name="auto-index" value="true"/>
|
||||
<option name="auto-toc" value="true"/>
|
||||
<option name="chm-title" value="(LazControls) Lazarus Controls Package"/>
|
||||
<!--
|
||||
pass format as a command line argument: format="chm"
|
||||
<option name="footer" value="lazcontrols-footer.xml"/>
|
||||
<option name="format" value="chm | html"/>
|
||||
-->
|
||||
</options>
|
||||
<packages>
|
||||
|
@ -1,10 +1,9 @@
|
||||
@echo off
|
||||
|
||||
REM =======================================================================
|
||||
REM Builds CHM and HTML help files for the LazControls package using the fpdoc utility.
|
||||
REM Requires chm and xct files for rtl, fcl, lcl, and lazutils in the Lazarus docs\chm directory.
|
||||
REM Requires chm and xct files for rtl, fcl, lcl, and lazutils in the
|
||||
REM Lazarus docs\chm directory.
|
||||
REM fpdoc will fail if they are not present.
|
||||
REM Requires git command line client to get the commit hash for the repository.
|
||||
REM =======================================================================
|
||||
|
||||
REM ======================================
|
||||
@ -12,70 +11,29 @@ REM SET THE CORRECT PATHS FOR YOUR SYSTEM
|
||||
REM ======================================
|
||||
REM lazarus documentation directory
|
||||
set docdir=..\..\..\docs
|
||||
|
||||
REM fpdoc executable directory
|
||||
REM set fpcdir=..\..\..\..\lazarus-2.2.0-RC2\fpc\3.2.2\bin\x86_64-win64
|
||||
set fpcdir=..\..\..\..\fpc331\fpc\bin\x86_64-win64
|
||||
REM directory with lazarus git repository
|
||||
set gitdir=..\..\..\..\usr\work\git-lazarus
|
||||
|
||||
REM values used in the footer
|
||||
REM package title for CHM
|
||||
set pkgtitle=Lazarus Controls Package (LazControls)
|
||||
|
||||
REM CHANGE THIS BEFORE BUILDING
|
||||
set version=2.3.0
|
||||
|
||||
REM commit SHA
|
||||
git -C %gitdir% describe --all --long > describe.txt
|
||||
for /f "delims=-g tokens=1-3" %%a in (describe.txt) do set commit=%%c
|
||||
del describe.txt
|
||||
|
||||
REM date stamp in YYYY-MM-DD format
|
||||
for /f "usebackq tokens=2 delims== " %%i in (`wmic os get LocalDateTime /value`) do set token10=%%i
|
||||
set dtstamp=%token10:~0,4%-%token10:~4,2%-%token10:~6,2%
|
||||
set token10=
|
||||
REM TODO: wmic is deprecated in Windows 11... check for powershell equivalent
|
||||
|
||||
echo %pkgtitle% %version%-%commit% %dtstamp%
|
||||
|
||||
REM generate footer with title, version, commit SHA, date stamp
|
||||
REM footer is included using the fpdoc project file
|
||||
|
||||
echo|(set /p="<hr class='footer-sep'/>" & echo.) > lazcontrols-footer.xml
|
||||
echo|(set /p="<table class='footer'>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p=" <tr>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p=" <td class='footer-doc'>%pkgtitle%</td>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p=" <td class='footer-ver'>Version %version%-%commit%</td>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p=" <td class='footer-date'>Generated %dtstamp%</td>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p=" </tr>" & echo.) >> lazcontrols-footer.xml
|
||||
echo|(set /p="</table>" & echo.) >> lazcontrols-footer.xml
|
||||
echo LazControls package
|
||||
|
||||
echo Generating CHM help...
|
||||
|
||||
REM generate chm format
|
||||
REM generate chm format without footers
|
||||
REM imports done manually to set the correct prefix for the output format
|
||||
REM output to current directory
|
||||
|
||||
%fpcdir%\fpdoc --project=lazcontrols-project.xml --format=chm --verbose --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::/" > .\build_chm.log
|
||||
%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::/" > .\build_chm.log
|
||||
|
||||
echo Generating HTML help...
|
||||
|
||||
REM generate html format
|
||||
REM generate html format without footers
|
||||
REM imports done manually to set the correct prefix for the output format
|
||||
REM html written to lazcontrols sub-directory
|
||||
|
||||
%fpcdir%\fpdoc --project=lazcontrols-project.xml --format=html --verbose --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 > .\build_html.log
|
||||
%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 > .\build_html.log
|
||||
|
||||
REM create an archive file with html content
|
||||
REM echo Creating archive: docs-html-lazcontrols-%dtstamp%.7z
|
||||
REM 7z a -t7z -mx9 -r docs-html-lazcontrols-%dtstamp%.7z .\lazcontrols\ > NUL
|
||||
|
||||
REM move generated html to lazarus docs\html directory
|
||||
REM move /Y .\lazcontrols %docdir%\html\
|
||||
|
||||
REM move generated chm, xct to lazarus docs directory
|
||||
REM move /Y lazcontrols.chm %docdir%\chm\
|
||||
REM move /Y lazcontrols.xct %docdir%\chm\
|
||||
|
||||
REM discard generated footer file
|
||||
del lazcontrols-footer.xml
|
||||
REM copy generated chm, xct to lazarus docs directory
|
||||
copy /Y lazcontrols.chm %docdir%\chm\
|
||||
copy /Y lazcontrols.xct %docdir%\chm\
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
#======================================================================
|
||||
# Builds CHM and HTML help files for the LazControls package using the fpdoc utility.
|
||||
# Requires chm and xct files for rtl, fcl, lcl, and lazutils in the Lazarus docs/chm directory.
|
||||
# Builds CHM and HTML help files for the LazControls package using fpdoc.
|
||||
# Requires chm and xct files for rtl, fcl, lcl, and lazutils in the
|
||||
# Lazarus docs/chm directory.
|
||||
# fpdoc will fail if they are not present.
|
||||
# Requires git command line client to get the commit hash for the repository.
|
||||
#======================================================================
|
||||
|
||||
#=======================================
|
||||
@ -11,65 +11,24 @@
|
||||
#=======================================
|
||||
# lazarus documentation directory
|
||||
docdir="../../../docs"
|
||||
|
||||
# fpdoc executable directory
|
||||
#fpcdir="../../../../lazarus-2.2.0-RC2/fpc/3.2.2/bin/x86_64-win64"
|
||||
#fpcdir="../../../fpc/3.2.2/bin/x86_64-win64"
|
||||
fpcdir="../../../../fpc331/fpc/bin/x86_64-win64"
|
||||
# directory with lazarus git repository
|
||||
gitdir="../../../../usr/work/git-lazarus"
|
||||
# values used in the footer
|
||||
# package title for CHM
|
||||
pkgtitle="Lazarus Controls Package (LazControls)"
|
||||
# CHANGE THIS BEFORE BUILDING
|
||||
version="2.3.0"
|
||||
# commit SHA
|
||||
commit=`git -C "$gitdir" describe --all --long | cut -d "-" -f 3 | cut -b "2-"`
|
||||
# date stamp in YYYY-MM-DD format
|
||||
dtstamp=`date +"%Y-%m-%d"`
|
||||
|
||||
echo -e "\n\e[7m $pkgtitle $version—$commit $dtstamp \e[0m";
|
||||
echo -e "\n\e[7m LazControls package \e[0m";
|
||||
|
||||
# generate footer with title, version, commit SHA, date stamp
|
||||
# footer is included using the fpdoc project file
|
||||
cat << EOT > lazcontrols-footer.xml
|
||||
<hr class="footer-sep"/>
|
||||
<table class="footer">
|
||||
<tr>
|
||||
<td class="footer-doc">$pkgtitle</td>
|
||||
<td class="footer-ver">Version $version-$commit</td>
|
||||
<td class="footer-date">Generated $dtstamp</td>
|
||||
</tr>
|
||||
</table>
|
||||
EOT
|
||||
|
||||
# generate chm format
|
||||
# generate chm format without footers
|
||||
# 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 --verbose --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
|
||||
$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
|
||||
|
||||
# generate html format
|
||||
# generate html format without footers
|
||||
# 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 --verbose --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
|
||||
$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
|
||||
|
||||
# convert CRLF to LF so git doesn't complain
|
||||
#echo "Converting CRLF to LF in HTML files..."
|
||||
#cd lazcontrols
|
||||
#dos2unix *.{css,html}
|
||||
#dos2unix **/*.{css,html}
|
||||
#cd ..
|
||||
|
||||
# create an archive file with html content
|
||||
#echo "Creating archive: docs-html-lazcontrols-$dtstamp.7z"
|
||||
#7z a -t7z -mx9 -r docs-html-lazcontrols-$dtstamp.7z ./lazcontrols/ > /dev/null
|
||||
|
||||
# copy or move generated html to lazarus docs/html directory
|
||||
#rm -vrf $docdir/html/lazcontrols/*
|
||||
#cp -vrf ./lazcontrols/* $docdir/html/lazcontrols/
|
||||
|
||||
# copy or move generated chm, xct to lazarus docs directory
|
||||
#cp -v lazcontrols.{chm,xct} $docdir/chm/
|
||||
|
||||
# discard generated footer file
|
||||
rm lazcontrols-footer.xml
|
||||
# copy generated chm, xct to lazarus docs directory
|
||||
cp -v lazcontrols.{chm,xct} $docdir/chm/
|
||||
|
Loading…
Reference in New Issue
Block a user