Docs: DateTimeCtrls. Syncs CSS, build scripts.

(cherry picked from commit 2a59941a59)
This commit is contained in:
dsiders 2025-01-14 04:57:33 -05:00
parent a6f72a1275
commit cda68ec812
4 changed files with 76 additions and 73 deletions

0
components/datetimectrls/docs/clean-files.sh Normal file → Executable file
View File

View File

@ -4,43 +4,34 @@
*/
body {
background: white;
color: black;
font-size: 12pt;
font-family: "San Francisco", "Roboto", "Noto Sans", "Open Sans", "Segoe UI", "Helvetica", "Arial", sans-serif;
}
p, th, td, caption, h1, h2, h3, ul, ol, dl {
font-family: "San Francisco", "Roboto", "Noto Sans", "Open Sans", "Segoe UI", "Helvetica", "Arial", sans-serif;
background-color: white;
color: black;
font-family: "Roboto", "DejaVu Sans", "Arial", Helvetica, sans-serif;
font-size: 11pt;
}
tt, span.kw, pre {
font-family: "Menlo", "JetBrains Mono", "Roboto Mono", "Noto Sans Mono", "Inconsolata", "Courier New", Courier, monospace;
font-size: 1em;
font-family: "Courier New", Courier, monospace;
font-size: 11pt;
}
p, th, td, caption, ul, ol, dl, tt, span.kw, pre {
font-size: 1em;
}
A:link {
a:link {
color: blue;
}
A:visited {
a:visited {
color: darkblue;
}
A:active {
a:active {
color: red;
}
A {
a {
text-decoration: none;
}
A:hover {
a:hover {
text-decoration: underline;
}
@ -50,12 +41,14 @@ h1, h2, td.h2 {
/* Especially for Netscape on Linux: */
h3, td.h3 {
font-size: 1em;
font-size: 11pt;
}
/* source fragments */
span.code {
white-space: nowrap;
font-weight: bold;
/* font-size: 1em; */
}
/* symbols in source fragments */
@ -121,7 +114,6 @@ span.warning {
font-weight: bold;
}
/* !!!: How should we define this...? */
span.file {
color: darkgreen;
}
@ -134,17 +126,13 @@ table.bar {
background-color: #a0c0ff;
}
table.footer {
margin-top: .5em;
width: 100%;
table.bar tr td {
font-size: .875em;
/* font-style: italic; */
font-style: normal;
}
span.bartitle {
font-weight: bold;
font-style: normal;
font-weight: bold;
color: darkblue;
}
@ -155,50 +143,53 @@ span.footer {
/* definition list */
dl {
/* border: 2px solid #ccc; */
display: block;
margin: 1em 0 1em 0;
display: block;
}
/* definition list: term */
dt {
/*
float: left;
clear: left;
*/
width: auto; /* normally browsers default width of largest item */
/* padding-right: 1.25em; */
font-weight: bold;
color: darkgreen;
}
/* definition list: description */
dd {
margin: 0 0 0 2em;
padding: 0 0 0.5em 0;
dd {
margin-left: 1.5em;
padding-bottom: .3em;
}
/* for browsers in standards compliance mode */
td p { margin: 0; }
td p { margin: 0px; }
var { font-weight: bold; }
/* used in custom page footers */
hr.footer-sep { margin-top: .667em; }
table.footer {
width: 100%;
margin-top: .5em;
font-style: normal;
font-size: .875em;
color: Black;
}
td.footer-doc { width: 42%; text-align: left; font-weight: bold; }
td.footer-ver { width: 33%; text-align: center; color: Gray; }
td.footer-date { width: 25%; text-align: right; color: Gray; }
/* used on the class hierarchy page */
span.toggletreeclose {
background: url(minus.png) center left no-repeat;
padding-left: 20px;
background: url(minus.png) center left no-repeat;
padding-left: 20px;
}
span.toggletreeopen {
background: url(plus.png) center left no-repeat;
padding-left: 20px;
background: url(plus.png) center left no-repeat;
padding-left: 20px;
}
li.classtree ul { display: block; }
ul.classtreelist { list-style-type:none; }
ul.classtreelist { list-style-type: none; }
ul.classtreelist li { padding-left: 0px; }
li.classtreeclosed ul { display: none; }
hr.footer-sep { margin-top: .667em; }
td.footer-doc { width: 36%; text-align: left; font-weight: bold; color: Black; }
td.footer-ver { width: 32%; text-align: center; color: Gray; }
td.footer-date { width: 32%; text-align: right; color: Gray; }

6
components/datetimectrls/docs/make-archive.sh Normal file → Executable file
View File

@ -5,14 +5,10 @@ echo "Create archive for DateTimeCtrls html documentation"
echo ""
# convert to unix line endings expected by git
cd datetimectrls
dos2unix *.{html,css}
dos2unix **/*.html
cd ..
# create an archive for the generated html content
dt=`date +"%Y-%m-%d"`
7z a -t7z -r -mx9 docs-html-datetimectrls-$dt.7z ./datetimectrls/
# move .7z file to another directory for permanent storage
cp -v docs-html-datetimectrls-$dt.7z ../../../docs/build/html/
# the .7z file is removed in clean-files.sh

52
components/datetimectrls/docs/make-docs.sh Normal file → Executable file
View File

@ -15,21 +15,29 @@
#==========================================================================
# lazarus documentation directory
docdir="../../../docs"
docdir=$(realpath ../../../docs)
chmdir=../../../docs/chm
# fpdoc executable directory
fpcdir="../../../fpc/3.2.2/bin/x86_64-win64"
#fpcdir="../../../../fpc331/fpc/bin/x86_64-win64"
# 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
# lazarus repository directory
#gitpath="../../../../usr/work/git-lazarus"
gitpath=""
gitpath=$(realpath ../../..)
# version number is hard-coded because main-2_3 tag is not the format needed
verno="2.3.0"
# 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"`
# get only the commit hash
#commit=`git -C "$gitpath" describe --all --long | cut -d "-" -f 3 | cut -b "2-"`
linkurl="https://dsiders.gitlab.io/lazdocsnext/"
#linkurl="https://lazarus-ccr.sourceforge.io/docs/"
linktext="Home"
# chm and html footer files are the same... for now
# chm footer should have a link to the online HTML
@ -38,7 +46,7 @@ cat <<EOT > ./datetimectrls-chm-footer.xml
<table class="footer">
<tr>
<td class="footer-doc">Date/Time Controls Package (DateTimeCtrls)</td>
<td class="footer-ver">Version $verno</td>
<td class="footer-ver">Version $verno-$commit</td>
<td class="footer-date">Generated $dt</td>
</tr>
</table>
@ -49,8 +57,10 @@ cat <<EOT > ./datetimectrls-html-footer.xml
<table class="footer">
<tr>
<td class="footer-doc">Date/Time Controls Package (DateTimeCtrls)</td>
<td class="footer-ver">Version $verno</td>
<td class="footer-date">Generated $dt</td>
<td class="footer-ver">Version $verno-$commit ($dt)</td>
<td class="footer-date">
<a href="$linkurl">$linktext</a>
</td>
</tr>
</table>
EOT
@ -62,18 +72,24 @@ echo -e "\n\e[7m DateTimeCtrls package \e[0m";
# output to current directory
echo "Generating CHM help..."
chmTitle="(DateTimeCtrls) Date/Time Controls"
$fpcdir/fpdoc --project=datetimectrls-project.xml --format=chm --chm-title="$chmTitle" --footer="datetimectrls-chm-footer.xml" --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=datetimectrls-project.xml --format=chm --chm-title="$chmTitle" --footer=@datetimectrls-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 with footers
# imports done manually to set the correct prefixs for the html format
# html written to the datetimectrls sub-directory
echo "Generating HTML help..."
$fpcdir/fpdoc --project=datetimectrls-project.xml --format=html --footer="datetimectrls-html-footer.xml" --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=datetimectrls 2>&1 | tee ./build_html.log
$fpdocpgm --project=datetimectrls-project.xml --format=html --footer=@datetimectrls-html-footer.xml \
--import="$chmdir/rtl.xct,../rtl/" --import="$chmdir/fcl.xct,../fcl/" \
--import="$chmdir/lcl.xct,../lcl/" --import="$chmdir/lazutils.xct,../lazutils/" --output=datetimectrls \
2>&1 | tee ./build_html.log
# copy generated chm, xct to lazarus docs directory
cp -v datetimectrls.{chm,xct} $docdir/chm/
cp -v datetimectrls.{chm,xct} $chmdir/
# copy css file to output directory for generated html content
cp -v datetimectrls.css datetimectrls/
# run make-archive.sh if needed
# run clean-files.sh if needed
# ./make-archive.sh
# ./clean-files.sh