mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-01 01:17:23 +01:00
* Patch from Andrew Haines to support FPDOC generating CHMs
git-svn-id: trunk@9407 -
This commit is contained in:
parent
853c34fda0
commit
e261bd766c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8820,6 +8820,7 @@ utils/fpdoc/Makefile.fpc svneol=native#text/plain
|
||||
utils/fpdoc/README -text
|
||||
utils/fpdoc/dglobals.pp svneol=native#text/plain
|
||||
utils/fpdoc/dw_html.pp svneol=native#text/plain
|
||||
utils/fpdoc/dw_htmlchm.inc svneol=native#text/plain
|
||||
utils/fpdoc/dw_ipf.pp svneol=native#text/plain
|
||||
utils/fpdoc/dw_latex.pp svneol=native#text/plain
|
||||
utils/fpdoc/dw_linrtf.pp svneol=native#text/plain
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
|
||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
|
||||
#
|
||||
default: all
|
||||
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
|
||||
@ -1626,13 +1626,14 @@ else
|
||||
TAROPT=vz
|
||||
TAREXT=.tar.gz
|
||||
endif
|
||||
override REQUIRE_PACKAGES=rtl fcl-xml fcl-passrc
|
||||
override REQUIRE_PACKAGES=rtl fcl-xml fcl-passrc chm
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1640,6 +1641,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1648,6 +1650,7 @@ REQUIRE_PACKAGES_WINUNITS=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1655,6 +1658,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1662,6 +1666,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1669,6 +1674,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1676,6 +1682,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1683,6 +1690,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1690,6 +1698,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1697,6 +1706,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1704,6 +1714,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1711,6 +1722,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1718,6 +1730,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1725,6 +1738,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1732,6 +1746,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1739,6 +1754,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1746,6 +1762,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1753,6 +1770,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-symbian)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1760,6 +1778,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1767,6 +1786,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1774,6 +1794,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1781,6 +1802,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1788,6 +1810,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1795,6 +1818,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1802,6 +1826,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1809,6 +1834,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1816,6 +1842,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1823,6 +1850,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1830,6 +1858,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-amiga)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1837,6 +1866,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1844,6 +1874,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1851,6 +1882,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1858,6 +1890,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1865,6 +1898,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1872,6 +1906,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1879,6 +1914,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1886,6 +1922,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1893,6 +1930,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1900,6 +1938,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1907,6 +1946,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1914,6 +1954,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-win64)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1922,6 +1963,7 @@ REQUIRE_PACKAGES_WINUNITS=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1929,6 +1971,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1936,6 +1979,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-palmos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1943,6 +1987,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1950,6 +1995,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-gba)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1957,6 +2003,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-nds)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1964,6 +2011,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1971,6 +2019,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-symbian)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1978,6 +2027,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1985,6 +2035,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1992,6 +2043,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
@ -1999,6 +2051,7 @@ REQUIRE_PACKAGES_NETDB=1
|
||||
REQUIRE_PACKAGES_FCL-BASE=1
|
||||
REQUIRE_PACKAGES_FCL-XML=1
|
||||
REQUIRE_PACKAGES_FCL-PASSRC=1
|
||||
REQUIRE_PACKAGES_CHM=1
|
||||
endif
|
||||
ifdef REQUIRE_PACKAGES_RTL
|
||||
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
|
||||
@ -2130,6 +2183,32 @@ ifdef UNITDIR_FCL-PASSRC
|
||||
override COMPILER_UNITDIR+=$(UNITDIR_FCL-PASSRC)
|
||||
endif
|
||||
endif
|
||||
ifdef REQUIRE_PACKAGES_CHM
|
||||
PACKAGEDIR_CHM:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /chm/Makefile.fpc,$(PACKAGESDIR))))))
|
||||
ifneq ($(PACKAGEDIR_CHM),)
|
||||
ifneq ($(wildcard $(PACKAGEDIR_CHM)/units/$(TARGETSUFFIX)),)
|
||||
UNITDIR_CHM=$(PACKAGEDIR_CHM)/units/$(TARGETSUFFIX)
|
||||
else
|
||||
UNITDIR_CHM=$(PACKAGEDIR_CHM)
|
||||
endif
|
||||
ifdef CHECKDEPEND
|
||||
$(PACKAGEDIR_CHM)/$(FPCMADE):
|
||||
$(MAKE) -C $(PACKAGEDIR_CHM) $(FPCMADE)
|
||||
override ALLDEPENDENCIES+=$(PACKAGEDIR_CHM)/$(FPCMADE)
|
||||
endif
|
||||
else
|
||||
PACKAGEDIR_CHM=
|
||||
UNITDIR_CHM:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /chm/Package.fpc,$(UNITSDIR)))))
|
||||
ifneq ($(UNITDIR_CHM),)
|
||||
UNITDIR_CHM:=$(firstword $(UNITDIR_CHM))
|
||||
else
|
||||
UNITDIR_CHM=
|
||||
endif
|
||||
endif
|
||||
ifdef UNITDIR_CHM
|
||||
override COMPILER_UNITDIR+=$(UNITDIR_CHM)
|
||||
endif
|
||||
endif
|
||||
ifdef REQUIRE_PACKAGES_WINUNITS
|
||||
PACKAGEDIR_WINUNITS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits/Makefile.fpc,$(PACKAGESDIR))))))
|
||||
ifneq ($(PACKAGEDIR_WINUNITS),)
|
||||
|
||||
@ -7,7 +7,7 @@ name=fpdoc
|
||||
version=2.0.0
|
||||
|
||||
[require]
|
||||
packages=fcl-xml fcl-passrc
|
||||
packages=fcl-xml fcl-passrc chm
|
||||
|
||||
[target]
|
||||
programs=fpdoc makeskel unitdiff
|
||||
|
||||
@ -98,6 +98,15 @@ resourcestring
|
||||
|
||||
// HTML usage
|
||||
SHTMLUsageFooter = 'Append xhtml from file as footer to html page';
|
||||
|
||||
// CHM usage
|
||||
SCHMUsageTOC = 'Use [File] as the table of contents. Usually a .hhc file.';
|
||||
SCHMUsageIndex = 'Use [File] as the index. Usually a .hhk file.';
|
||||
SCHMUsageDefPage = 'Set the "Home" page relative to where it lives in the chm. i.e. "/index.html"';
|
||||
SCHMUsageOtrFiles= 'A txt file containing a list of files to be added relative to the working directory.';
|
||||
SCHMUsageCSSFile = 'Filename of a .css file to be included in the chm.';
|
||||
SCHMUsageAutoTOC = 'Automatically generate a Table of Contents. Ignores --toc-file';
|
||||
SCHMUsageAutoIDX = 'Automatically generate an Index. Ignores --index-file';
|
||||
|
||||
STitle = 'FPDoc - Free Pascal Documentation Tool';
|
||||
SVersion = 'Version %s [%s]';
|
||||
|
||||
@ -15,11 +15,14 @@
|
||||
{$mode objfpc}
|
||||
{$H+}
|
||||
|
||||
{$DEFINE FPDOC_CHM}
|
||||
|
||||
unit dw_HTML;
|
||||
|
||||
interface
|
||||
|
||||
uses Classes, DOM, DOM_HTML, dGlobals, PasTree, dWriter;
|
||||
uses Classes, DOM, DOM_HTML, dGlobals, PasTree, dWriter
|
||||
{$IFDEF FPDOC_CHM},ChmWriter, ChmBase{$ENDIF};
|
||||
|
||||
const
|
||||
// Subpage indices for modules
|
||||
@ -233,7 +236,7 @@ type
|
||||
ASubpageIndex: Integer): TXMLDocument;
|
||||
|
||||
// For producing complete package documentation
|
||||
procedure WriteHTMLPages;
|
||||
procedure WriteHTMLPages; virtual;
|
||||
procedure WriteXHTMLPages;
|
||||
|
||||
SearchPage: String;
|
||||
@ -252,10 +255,17 @@ type
|
||||
Procedure CreateAllocator; override;
|
||||
end;
|
||||
|
||||
{$DEFINE FPDOC_CHM}
|
||||
|
||||
{$IFDEF FPDOC_CHM}
|
||||
{$DEFINE chmInterface}
|
||||
{$I dw_htmlchm.inc}
|
||||
{$UNDEF chmInterface}
|
||||
{$ENDIF}
|
||||
|
||||
implementation
|
||||
|
||||
uses SysUtils, XHTML, XMLRead, XMLWrite, HTMWrite, sh_pas;
|
||||
uses SysUtils, XHTML, XMLRead, XMLWrite, HTMWrite, sh_pas {$IFDEF FPDOC_CHM},chmsitemap{$ENDIF};
|
||||
|
||||
|
||||
Function FixHTMLpath(S : String) : STring;
|
||||
@ -264,6 +274,8 @@ begin
|
||||
Result:=StringReplace(S,'\','/',[rfReplaceAll]);
|
||||
end;
|
||||
|
||||
{$I dw_htmlchm.inc}
|
||||
|
||||
procedure TFileAllocator.AllocFilename(AElement: TPasElement;
|
||||
ASubindex: Integer);
|
||||
begin
|
||||
@ -652,7 +664,7 @@ var
|
||||
i: Integer;
|
||||
PageDoc: TXMLDocument;
|
||||
Filename: String;
|
||||
begin
|
||||
begin WriteLn('!!!!!!!!!!!!!!!!!!!!!!1');
|
||||
if Engine.Output <> '' then
|
||||
Engine.Output := IncludeTrailingBackSlash(Engine.Output);
|
||||
for i := 0 to PageInfos.Count - 1 do
|
||||
@ -3007,7 +3019,13 @@ initialization
|
||||
// Do not localize.
|
||||
RegisterWriter(THTMLWriter,'html','HTML output using fpdoc.css stylesheet.');
|
||||
RegisterWriter(THTMWriter,'htm','HTM (8.3 filenames) output using fpdoc.css stylesheet.');
|
||||
{$IFDEF FPDOC_CHM}
|
||||
RegisterWriter(TCHMHTMLWriter,'chm','Compressed HTML file output using fpdoc.css stylesheet.');
|
||||
{$ENDIF}
|
||||
finalization
|
||||
UnRegisterWriter('html');
|
||||
UnRegisterWriter('htm');
|
||||
{$IFDEF FPDOC_CHM}
|
||||
UnRegisterWriter('chm');
|
||||
{$ENDIF}
|
||||
end.
|
||||
|
||||
516
utils/fpdoc/dw_htmlchm.inc
Normal file
516
utils/fpdoc/dw_htmlchm.inc
Normal file
@ -0,0 +1,516 @@
|
||||
{%mainunit dw_html}
|
||||
{$IFDEF chmInterface}
|
||||
type
|
||||
|
||||
{ TCHMHTMLWriter }
|
||||
|
||||
TCHMHTMLWriter = class(THTMLWriter)
|
||||
private
|
||||
FOutChm: TStream;
|
||||
FChm: TChmWriter;
|
||||
FTempUncompressed: TStream;
|
||||
FTempUncompressedName: String;
|
||||
FTOCName,
|
||||
FIndexName,
|
||||
FDefaultPage: String;
|
||||
FCSSFile: String;
|
||||
FAutoTOC,
|
||||
FAutoIndex: Boolean;
|
||||
FOtherFiles: String;
|
||||
procedure ProcessOptions;
|
||||
function RetrieveOtherFiles(const DataName: String; out PathInChm: String; out FileName: String; var Stream: TStream): Boolean;
|
||||
procedure LastFileAdded(Sender: TObject);
|
||||
procedure GenerateTOC;
|
||||
procedure GenerateIndex;
|
||||
public
|
||||
procedure WriteHTMLPages; override;
|
||||
|
||||
function InterPretOption(const Cmd,Arg : String): boolean; override;
|
||||
|
||||
class procedure Usage(List: TStrings); override;
|
||||
end;
|
||||
{$ELSE} // implementation
|
||||
|
||||
{ TCHMHTMLWriter }
|
||||
|
||||
procedure TCHMHTMLWriter.ProcessOptions;
|
||||
var
|
||||
TempStream: TMemoryStream;
|
||||
begin
|
||||
if FDefaultPage = '' then
|
||||
FDefaultPage := 'index.html'
|
||||
else
|
||||
begin
|
||||
WriteLn('Note: --index-page not assigned. Using default "index.html"');
|
||||
end;
|
||||
|
||||
if FCSSFile <> '' then
|
||||
begin
|
||||
TempStream := TMemoryStream.Create;
|
||||
TempStream.LoadFromFile(FCSSFile);
|
||||
TempStream.Position := 0;
|
||||
FChm.AddStreamToArchive('fpdoc.css', '/', TempStream, True);
|
||||
TempStream.Free;
|
||||
end;
|
||||
|
||||
FChm.DefaultPage := FDefaultPage;
|
||||
|
||||
if FOtherFiles <> '' then
|
||||
begin
|
||||
FChm.FilesToCompress.LoadFromFile(FOtherFiles);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
function TCHMHTMLWriter.RetrieveOtherFiles(const DataName: String; out
|
||||
PathInChm: String; out FileName: String; var Stream: TStream): Boolean;
|
||||
var
|
||||
Dir: String;
|
||||
begin
|
||||
if Stream <> nil then
|
||||
Stream.Free;
|
||||
Stream := TMemoryStream.Create;
|
||||
TMemoryStream(Stream).LoadFromFile(DataName);
|
||||
FileName := ExtractFileName(DataName);
|
||||
|
||||
if ExtractFileDir(DataName) <> '' then
|
||||
PathInChm := ExtractRelativepath(GetCurrentDir, ExtractFileDir(DataName))
|
||||
else
|
||||
PathInChm := '/';
|
||||
FixHTMLpath(PathInChm);
|
||||
Stream.Position := 0;
|
||||
end;
|
||||
|
||||
procedure TCHMHTMLWriter.LastFileAdded(Sender: TObject);
|
||||
var
|
||||
TmpStream: TMemoryStream;
|
||||
begin
|
||||
TmpStream := TMemoryStream.Create;
|
||||
if FAutoTOC then
|
||||
GenerateTOC
|
||||
else
|
||||
if FTOCName <> '' then
|
||||
begin
|
||||
TmpStream.LoadFromFile(FTOCName);
|
||||
TmpStream.Position := 0;
|
||||
FChm.AppendTOC(TmpStream);
|
||||
TmpStream.Size := 0;
|
||||
end;
|
||||
|
||||
if FAutoIndex then
|
||||
GenerateIndex
|
||||
else
|
||||
if FIndexName <> '' then
|
||||
begin
|
||||
TmpStream.LoadFromFile(FIndexName);
|
||||
TmpStream.Position := 0;
|
||||
FChm.AppendIndex(TmpStream);
|
||||
end;
|
||||
TmpStream.Free;
|
||||
WriteLn('Finishing compressing...');
|
||||
end;
|
||||
|
||||
function TOCSort(Item1, Item2: TChmSiteMapItem): Integer;
|
||||
begin
|
||||
Result := CompareText(LowerCase(Item1.Text), LowerCase(Item2.Text));
|
||||
end;
|
||||
|
||||
function GetAlphaItem(AItems: TChmSiteMapItems; AName: String): TChmSiteMapItem;
|
||||
var
|
||||
x: Integer;
|
||||
begin
|
||||
Result := nil;
|
||||
for x := 0 to AItems.Count-1 do
|
||||
begin
|
||||
if AItems.Item[x].Text = AName then
|
||||
Exit(AItems.Item[x]);
|
||||
end;
|
||||
Result := AItems.NewItem;
|
||||
Result.Text := AName;
|
||||
end;
|
||||
|
||||
procedure TCHMHTMLWriter.GenerateTOC;
|
||||
var
|
||||
TOC: TChmSiteMap;
|
||||
Element: TPasElement;
|
||||
k: Integer;
|
||||
j: Integer;
|
||||
i: Integer;
|
||||
AModule: TPasModule;
|
||||
Member: TPasElement;
|
||||
Stream: TMemoryStream;
|
||||
TmpItem: TChmSiteMapItem;
|
||||
ObjByUnitItem,
|
||||
AlphaObjItem,
|
||||
ObjUnitItem,
|
||||
RoutinesByUnitItem,
|
||||
RoutinesUnitItem,
|
||||
AlphaRoutinesItem: TChmSiteMapItem;
|
||||
|
||||
begin
|
||||
WriteLn('Generating Table of contents...');
|
||||
if Assigned(Package) then
|
||||
begin
|
||||
Toc := TChmSiteMap.Create(stTOC);
|
||||
Stream := TMemoryStream.Create;
|
||||
ObjByUnitItem := TOC.Items.NewItem;
|
||||
ObjByUnitItem.Text := 'Classes and Objects, by Unit';
|
||||
AlphaObjItem := TOC.Items.NewItem;
|
||||
AlphaObjItem.Text := 'Alphabetical Classes and Objects List';
|
||||
RoutinesByUnitItem := TOC.Items.NewItem;
|
||||
RoutinesByUnitItem.Text := 'Routines, by Unit';
|
||||
AlphaRoutinesItem := TOC.Items.NewItem;
|
||||
AlphaRoutinesItem.Text := 'Alphabetical Routines List';
|
||||
|
||||
// objects and classes
|
||||
for i := 0 to Package.Modules.Count - 1 do
|
||||
begin
|
||||
AModule := TPasModule(Package.Modules[i]);
|
||||
ObjUnitItem := ObjByUnitItem.Children.NewItem;
|
||||
ObjUnitItem.Text := AModule.Name;
|
||||
RoutinesUnitItem := RoutinesByUnitItem.Children.NewItem;
|
||||
RoutinesUnitItem.Text := AModule.Name;
|
||||
for j := 0 to AModule.InterfaceSection.Classes.Count-1 do
|
||||
begin
|
||||
Element := TPasClassType(AModule.InterfaceSection.Classes[j]);
|
||||
// by unit
|
||||
TmpItem := ObjUnitItem.Children.NewItem;
|
||||
TmpItem.Text := Element.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(Element, 0);
|
||||
|
||||
//alpha
|
||||
TmpItem := GetAlphaItem(AlphaObjItem.Children, UpperCase(Copy(Element.Name, 1, 2))).Children.NewItem;
|
||||
TmpItem.Text := Element.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(Element, 0);
|
||||
|
||||
end;
|
||||
|
||||
// non object procedures and functions
|
||||
for j := 0 to AModule.InterfaceSection.Functions.Count-1 do
|
||||
begin
|
||||
Element := TPasFunctionType(AModule.InterfaceSection.Functions[j]);
|
||||
// by unit
|
||||
TmpItem := RoutinesUnitItem.Children.NewItem;
|
||||
TmpItem.Text := Element.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(Element, 0);
|
||||
|
||||
// alpha
|
||||
TmpItem := GetAlphaItem(AlphaRoutinesItem.Children, UpperCase(Element.Name[1])).Children.NewItem;
|
||||
TmpItem.Text := Element.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(Element, 0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// cleanup
|
||||
for i := ObjByUnitItem.Children.Count-1 downto 0 do
|
||||
begin
|
||||
if ObjByUnitItem.Children.Item[i].Children.Count = 0 then
|
||||
ObjByUnitItem.Children.Delete(i);
|
||||
end;
|
||||
|
||||
for i := RoutinesByUnitItem.Children.Count-1 downto 0 do
|
||||
begin
|
||||
if RoutinesByUnitItem.Children.Item[i].Children.Count = 0 then
|
||||
RoutinesByUnitItem.Children.Delete(i);
|
||||
end;
|
||||
|
||||
for i := TOC.Items.Count-1 downto 0 do
|
||||
begin
|
||||
if TOC.Items.Item[i].Children.Count = 0 then
|
||||
TOC.Items.Delete(i);
|
||||
end;
|
||||
|
||||
// Sort
|
||||
for i := 0 to TOC.Items.Count-1 do
|
||||
begin
|
||||
TOC.Items.Item[i].Children.Sort(TListSortCompare(@TOCSort));
|
||||
for j := 0 to TOC.Items.Item[i].Children.Count-1 do
|
||||
begin
|
||||
TOC.Items.Item[i].Children.Item[j].Children.Sort(TListSortCompare(@TOCSort));
|
||||
end;
|
||||
end;
|
||||
|
||||
TOC.SaveToStream(Stream);
|
||||
TOC.Free;
|
||||
|
||||
fchm.AppendTOC(Stream);
|
||||
Stream.Free;
|
||||
end;
|
||||
|
||||
type
|
||||
TClassMemberType = (cmtProcedure, cmtFunction, cmtConstructor, cmtDestructor,
|
||||
cmtInterface, cmtProperty, cmtVariable, cmtUnknown);
|
||||
|
||||
function ElementType(Element: TPasElement): TClassMemberType;
|
||||
var
|
||||
ETypeName: String;
|
||||
begin
|
||||
Result := cmtUnknown;
|
||||
ETypeName := Element.ElementTypeName;
|
||||
//overloaded we don't care
|
||||
if ETypeName[1] = 'o' then ETypeName := Copy(ETypeName, 11, Length(ETypeName));
|
||||
|
||||
if ETypeName[1] = 'f' then Exit(cmtFunction);
|
||||
if ETypeName[1] = 'c' then Exit(cmtConstructor);
|
||||
if ETypeName[1] = 'v' then Exit(cmtVariable);
|
||||
if ETypeName[1] = 'i' then Exit(cmtInterface);
|
||||
// the p's
|
||||
if ETypeName[4] = 'c' then Exit(cmtProcedure);
|
||||
if ETypeName[4] = 'p' then Exit(cmtProperty);
|
||||
|
||||
end;
|
||||
|
||||
procedure TCHMHTMLWriter.GenerateIndex;
|
||||
var
|
||||
Index: TChmSiteMap;
|
||||
i, j, k: Integer;
|
||||
TmpItem: TChmSiteMapItem;
|
||||
ParentItem: TChmSiteMapItem;
|
||||
AModule: TPasModule;
|
||||
TmpElement: TPasElement;
|
||||
ParentElement: TPasElement;
|
||||
MemberItem: TChmSiteMapItem;
|
||||
Stream: TMemoryStream;
|
||||
begin
|
||||
WriteLn('Generating Index...');
|
||||
|
||||
if Assigned(Package) then
|
||||
begin
|
||||
try
|
||||
Index := TChmSiteMap.Create(stIndex);
|
||||
Stream := TMemoryStream.Create;
|
||||
for i := 0 to Package.Modules.Count - 1 do
|
||||
begin
|
||||
AModule := TPasModule(Package.Modules[i]);
|
||||
// classes
|
||||
for j := 0 to AModule.InterfaceSection.Classes.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasClassType(AModule.InterfaceSection.Classes[j]);
|
||||
ParentItem := Index.Items.NewItem;
|
||||
ParentItem.Text := ParentELement.Name;
|
||||
ParentItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
for k := 0 to TPasClassType(ParentElement).Members.Count-1 do
|
||||
begin
|
||||
TmpElement := TPasElement(TPasClassType(ParentElement).Members.Items[k]);
|
||||
if Engine.HidePrivate and(TmpElement.Visibility = visPrivate) then
|
||||
continue;
|
||||
if Engine.HideProtected and(TmpElement.Visibility = visProtected) then
|
||||
continue;
|
||||
TmpItem := ParentItem.Children.NewItem;
|
||||
case ElementType(TmpElement) of
|
||||
cmtProcedure : TmpItem.Text := TmpElement.Name + ' procedure';
|
||||
cmtFunction : TmpItem.Text := TmpElement.Name + ' function';
|
||||
cmtConstructor : TmpItem.Text := TmpElement.Name + ' constructor';
|
||||
cmtDestructor : TmpItem.Text := TmpElement.Name + ' destructor';
|
||||
cmtProperty : TmpItem.Text := TmpElement.Name + ' property';
|
||||
cmtVariable : TmpItem.Text := TmpElement.Name + ' variable';
|
||||
cmtInterface : TmpItem.Text := TmpElement.Name + ' interface';
|
||||
cmtUnknown : TmpItem.Text := TmpElement.Name;
|
||||
end;
|
||||
TmpItem.Local := Allocator.GetFilename(TmpElement, 0);
|
||||
{
|
||||
ParentElement = Class
|
||||
TmpElement = Member
|
||||
}
|
||||
MemberItem := nil;
|
||||
MemberItem := GetAlphaItem(Index.Items, TmpElement.Name);
|
||||
// ahh! if MemberItem.Local is empty MemberType is not shown!
|
||||
MemberItem.Local := Allocator.GetFilename(TmpElement, 0);
|
||||
|
||||
TmpItem := MemberItem.Children.NewItem;
|
||||
TmpItem.Text := ParentElement.Name;
|
||||
TmpITem.Local := Allocator.GetFilename(TmpElement, 0);
|
||||
end;
|
||||
end;
|
||||
// routines
|
||||
for j := 0 to AModule.InterfaceSection.Functions.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasProcedureType(AModule.InterfaceSection.Functions[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name + ' ' + TPasFunction(ParentElement).ElementTypeName;
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
end;
|
||||
// consts
|
||||
for j := 0 to AModule.InterfaceSection.Consts.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasElement(AModule.InterfaceSection.Consts[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
end;
|
||||
// types
|
||||
for j := 0 to AModule.InterfaceSection.Types.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasType(AModule.InterfaceSection.Types[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
// enums
|
||||
if ParentELement is TPasEnumType then
|
||||
begin
|
||||
ParentItem := TmpItem;
|
||||
for k := 0 to TPasEnumType(ParentElement).Values.Count-1 do
|
||||
begin
|
||||
TmpElement := TPasType(TPasEnumType(ParentElement).Values.Items[k]);
|
||||
// subitem
|
||||
TmpItem := ParentItem.Children.NewItem;
|
||||
TmpItem.Text := TmpElement.Name;
|
||||
TmpItem.Local := ParentItem.Local;
|
||||
// root level
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := TmpElement.Name;
|
||||
TmpItem.Local := ParentItem.Local;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// variables
|
||||
for j := 0 to AModule.InterfaceSection.Variables.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasElement(AModule.InterfaceSection.Variables[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name + ' var';
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
end;
|
||||
// declarations
|
||||
{
|
||||
for j := 0 to AModule.InterfaceSection.Declarations.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasElement(AModule.InterfaceSection.Declarations[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
end;
|
||||
// resource strings
|
||||
for j := 0 to AModule.InterfaceSection.ResStrings.Count-1 do
|
||||
begin
|
||||
ParentElement := TPasElement(AModule.InterfaceSection.ResStrings[j]);
|
||||
TmpItem := Index.Items.NewItem;
|
||||
TmpItem.Text := ParentElement.Name;
|
||||
TmpItem.Local := Allocator.GetFilename(ParentElement, 0);
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
// Sort
|
||||
Index.Items.Sort(TListSortCompare(@TOCSort));
|
||||
for i := 0 to Index.Items.Count-1 do
|
||||
begin
|
||||
Index.Items.Item[i].Children.Sort(TListSortCompare(@TOCSort));
|
||||
end;
|
||||
|
||||
// save
|
||||
Index.SaveToStream(Stream);
|
||||
Index.Free;
|
||||
Stream.Position :=0 ;
|
||||
FChm.AppendIndex(Stream);
|
||||
Stream.Free;
|
||||
except
|
||||
Dump_Stack(StdOut, get_frame);
|
||||
Halt(1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCHMHTMLWriter.WriteHTMLPages;
|
||||
var
|
||||
i: Integer;
|
||||
PageDoc: TXMLDocument;
|
||||
FileStream: TMemoryStream;
|
||||
FileName: String;
|
||||
FilePath: String;
|
||||
begin
|
||||
if Engine.Output = '' then
|
||||
begin
|
||||
WriteLn('Error: no --output option used.');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if ExtractFileExt(Engine.Output) <> '.chm' then
|
||||
ChangeFileExt(Engine.OutPut, '.chm');
|
||||
|
||||
FOutChm := TFileStream.Create(Engine.Output, fmOpenReadWrite or fmCreate);
|
||||
|
||||
FTempUncompressedName := GetTempFileName+IntToStr(GetProcessID) +'.raw';
|
||||
FTempUncompressed := TFileStream.Create(FTempUncompressedName, fmOpenReadWrite or fmCreate);
|
||||
FChm := TChmWriter.Create(FOutChm, False);
|
||||
FChm.Title := Copy(Package.Name, 2, Length(Package.Name));
|
||||
FChm.TempRawStream := FTempUncompressed;
|
||||
FChm.OnGetFileData := @RetrieveOtherFiles;
|
||||
FChm.OnLastFile := @LastFileAdded;
|
||||
|
||||
ProcessOptions;
|
||||
|
||||
FileStream := TMemoryStream.Create;
|
||||
for i := 0 to PageInfos.Count - 1 do
|
||||
with TPageInfo(PageInfos[i]) do
|
||||
begin
|
||||
PageDoc := CreateHTMLPage(Element, SubpageIndex);
|
||||
try
|
||||
FileName := ExtractFileName(Allocator.GetFilename(Element, SubpageIndex));
|
||||
FilePath := '/'+FixHTMLpath(ExtractFilePath(Allocator.GetFilename(Element, SubpageIndex)));
|
||||
|
||||
try
|
||||
WriteHTMLFile(PageDoc, FileStream);
|
||||
FChm.AddStreamToArchive(FileName, FilePath, FileStream, True);
|
||||
except
|
||||
on E: Exception do
|
||||
WriteLn(Format(SErrCouldNotCreateFile, [FileName, e.Message]));
|
||||
end;
|
||||
finally
|
||||
PageDoc.Free;
|
||||
FileStream.Size := 0;
|
||||
end;
|
||||
end;
|
||||
FileStream.Free;
|
||||
WriteLn('HTML Files written. Collecting other files and compressing...this could take some time');
|
||||
FChm.Execute;
|
||||
FChm.Free;
|
||||
// we don't need to free FTempUncompressed
|
||||
// FTempUncompressed.Free;
|
||||
FOutChm.Free;
|
||||
DeleteFile(FTempUncompressedName);
|
||||
end;
|
||||
|
||||
function TCHMHTMLWriter.InterPretOption(const Cmd, Arg: String): boolean;
|
||||
begin
|
||||
Result:=True;
|
||||
if Cmd = '--toc-file' then
|
||||
FTOCName := arg
|
||||
else if Cmd = '--index-file' then
|
||||
FIndexName := arg
|
||||
else if Cmd = '--default-page' then
|
||||
FDefaultPage := arg
|
||||
else if Cmd = '--other-files' then
|
||||
FOtherFiles := arg
|
||||
else if Cmd = '--css-file' then
|
||||
FCSSFile := arg
|
||||
else if Cmd = '--auto-index' then
|
||||
FAutoIndex := True
|
||||
else if Cmd = '--auto-toc' then
|
||||
FAutoTOC := True
|
||||
else
|
||||
Result:=inherited InterPretOption(Cmd, Arg);
|
||||
end;
|
||||
|
||||
class procedure TCHMHTMLWriter.Usage(List: TStrings);
|
||||
begin
|
||||
THTMLWriter.Usage(List);
|
||||
List.add('--default-page');
|
||||
List.Add(SCHMUsageDefPage);
|
||||
List.add('--toc-file');
|
||||
List.Add(SCHMUsageTOC);
|
||||
List.add('--index-file');
|
||||
List.Add(SCHMUsageIndex);
|
||||
List.add('--other-files');
|
||||
List.Add(SCHMUsageOtrFiles);
|
||||
List.add('--css-file');
|
||||
List.Add(SCHMUsageCSSFile);
|
||||
List.add('--auto-index');
|
||||
List.Add(SCHMUsageAutoIDX);
|
||||
List.add('--auto-toc');
|
||||
List.Add(SCHMUsageAutoTOC);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{$ENDIF}
|
||||
Loading…
Reference in New Issue
Block a user