fpdoc.tex 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694
  1. %
  2. % $Id$
  3. % This file is part of the FPC documentation.
  4. % Copyright (C) 1997, by Michael Van Canneyt
  5. %
  6. % The FPC documentation is free text; you can redistribute it and/or
  7. % modify it under the terms of the GNU Library General Public License as
  8. % published by the Free Software Foundation; either version 2 of the
  9. % License, or (at your option) any later version.
  10. %
  11. % The FPC Documentation is distributed in the hope that it will be useful,
  12. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. % Library General Public License for more details.
  15. %
  16. % You should have received a copy of the GNU Library General Public
  17. % License along with the FPC documentation; see the file COPYING.LIB. If not,
  18. % write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. % Boston, MA 02111-1307, USA.
  20. %
  21. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  22. % Preamble.
  23. \input{preamble.inc}
  24. \latex{%
  25. \ifpdf
  26. \pdfinfo{/Author(Michael Van Canneyt)
  27. /Title(Users' Guide)
  28. /Subject(FPDoc Users' guide)
  29. /Keywords(Free Pascal)
  30. }
  31. \fi}
  32. %
  33. % Settings
  34. %
  35. \makeindex
  36. %
  37. % Start of document.
  38. %
  39. \newcommand{\fpdoc}{\textsc{FPDoc}\xspace}
  40. \newcommand{\seesu}[1]{section \ref{suse:#1}, page \pageref{suse:#1}\xspace}
  41. \newcommand{\seetag}[1]{\tag{#1} (\pageref{tag:#1})\xspace}
  42. \newcommand{\tag}[1]{\textbf{#1}}
  43. \newcommand{\attr}[1]{\textit{#1}}
  44. \usepackage{tabularx}
  45. \usepackage{syntax}
  46. \begin{document}
  47. \title{FPDoc :\\Free Pascal code documenter: Reference manual}
  48. \docdescription{Reference manual for FPDoc}
  49. \docversion{0.9}
  50. \date{\today}
  51. \author{Micha\"el Van Canneyt}
  52. \maketitle
  53. \tableofcontents
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. % Introduction
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57. \chapter{Introduction}
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. % About this document
  60. \section{About this document}
  61. This is the reference manual for \fpdoc, a free documentation tool for
  62. Pascal units. It describes the usage of \fpdoc and how to write
  63. documentation with it.
  64. It attempts to be complete, but the tool is under continuous development,
  65. and so there may be some slight differences between the documentation and
  66. the actual program. In case of discrepancy, the sources of the tool are the
  67. final reference. A \file{README} or \file{CHANGES} file may be provided, and
  68. can also give some hints as to things which have changed. In case of doubt,
  69. these files or the sources are authoritative.
  70. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  71. % About FPDoc
  72. \section{About \fpdoc}
  73. \fpdoc is a tool that combines a Pascal unit file and a description file
  74. in XML format and produces reference documentation for the unit. The
  75. reference documentation contains documentation for all of the identifiers
  76. found in the unit's interface section. The documentation is fully
  77. cross-referenced, making it easy to navigate. It is also possible to refer
  78. to other documentation sets written with \fpdoc, making it possible to
  79. maintain larger documentation sets for large projects.
  80. Contrary to some other documentation techniques, \fpdoc does not require the
  81. presence of formatted comments in the source code. It takes a source file
  82. and a documentation file (in XML format) and merges these two together to a
  83. full documentation of the source. This means that the code doesn't get
  84. obfuscated with large pieces of comment, making it hard to read and
  85. understand.
  86. \fpdoc is package-oriented, which means that it considers units as part of a
  87. package. Documentation for all units in a package can be generated in one
  88. run.
  89. At the moment of writing, the documentation can be generated in the
  90. following formats:
  91. \begin{description}
  92. \item[HTML] Plain HTML. Javascript is used to be able to show a small window
  93. with class properties or class methods, but the generated HTML will work
  94. without JavaScript as well. Style sheets are used to do the markup, so the
  95. output can be customised.
  96. \item[XHTML] As HTML, but using a more strict syntax.
  97. \item[LaTeX] LaTeX files, which can be used with the \file{fpc.sty} file
  98. which comes with the \fpc documentation. From this output, PDF documents can
  99. be generated, and with the use of latex2rtf, RTF or Winhelp files. Text
  100. files can also be generated.
  101. \end{description}
  102. Plans exist to create direct text output and RTF output as well.
  103. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  104. % Getting more information.
  105. \section{Getting more information.}
  106. If the documentation doesn't give an answer to your questions,
  107. you can obtain more information on the Internet, on the following address:
  108. \htmladdnormallink{http://fpdoc.freepascal.org/}
  109. {http://fpdoc.freepascal.org}
  110. It contains links to download all \fpdoc related material.
  111. Finally, if you think something should be added to this manual
  112. (entirely possible), please do not hesitate and contact me at
  113. \htmladdnormallink{[email protected]}{mailto:[email protected]}.
  114. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  115. % Installation
  116. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  117. \chapter{Compiling and Installing \fpdoc}
  118. \label{ch:Installation}
  119. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  120. % Compiling
  121. \section{Compiling}
  122. In order to compile \fpdoc, the following things are needed:
  123. \begin{enumerate}
  124. \item The fpdoc sources. These can be downloaded from the \fpdoc website.
  125. \item The \fpc compiler sources. \fpdoc uses the scanner from the \fpc
  126. comiler to scan the source file.
  127. \item The FCL units (or their sources) should be installed.
  128. \item fpcmake is needed to create the makefile for fpdoc. It comes with
  129. \fpc, so if \fpc is installed, there should be no problem.
  130. \item To make new internationalisation support files, \file{rstconv} must be
  131. installed, and the GNU gettext package.
  132. \end{enumerate}
  133. Links to download all these programs can be found on the \fpdoc website.
  134. When the fpdoc sources have been unzipped, the Makefile must be generated.
  135. Before generating the makefile, the location of the compiler source
  136. directory should be indicated. In the \file{Makefile.fpc} file, which has a
  137. windows ini file format, locate the \var{fpcdir} entry in the \var{defaults}
  138. section:
  139. \begin{verbatim}
  140. fpcdir=../..
  141. \end{verbatim}
  142. and change it so it points to the top-level \fpc source directory.
  143. After that, running \file{fpcmake} will produce the \file{Makefile}, and
  144. running \file{make} should produce 2 executables: \file{fpdoc} and
  145. \file{makeskel}.
  146. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  147. % Installation
  148. \section{Installation}
  149. When installing from sources, a simple
  150. \begin{verbatim}
  151. make install
  152. cd intl
  153. make install
  154. \end{verbatim}
  155. should completely install the documentation tool.
  156. When installing from a archive with the binaries, it should be sufficient
  157. to copy the binaries to a directory in the \var{PATH}.
  158. To have fpdoc available in several languages, the language files should be
  159. installed in the following directory on Unix systems:
  160. \begin{verbatim}
  161. /usr/local/share/locale/XX/LC_MESSAGES/
  162. \end{verbatim}
  163. or
  164. \begin{verbatim}
  165. /usr/share/locale/XX/LC_MESSAGES/
  166. \end{verbatim}
  167. Depending on the setup. Here \var{XX} should be replaced by the locale
  168. identifier.
  169. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  170. % Usage
  171. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  172. \chapter{\fpdoc usage}
  173. \label{ch:usage}
  174. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  175. % Usage
  176. \section{fpdoc}
  177. Using \fpdoc is quite simple. It takes some command-line options, and based
  178. on these options, creates documentation. The command-line options can be
  179. given as long or short options, as is common for most GNU programs.
  180. In principle, only 2 command-line options are needed:
  181. \begin{description}
  182. \item[package] This specifies the name of the package for which
  183. documentation must be created. Exactly one package option can be
  184. specified.
  185. \item[input] The name of a unit file for which documentation should be
  186. generated. This can be a simple filename, but can also contain some syntax
  187. options as they could be given to the \fpc scanner. More than one
  188. \var{input} option can be given, and documentation will be generated for all
  189. specified input files.
  190. \end{description}
  191. Some examples:
  192. \begin{verbatim}
  193. fpdoc --package=fcl --input=crt.pp
  194. \end{verbatim}
  195. This will scan the \file{crt.pp} file and generate documentation for it
  196. in a directory called \file{fcl}.
  197. \begin{verbatim}
  198. fpdoc --package=fcl --input='-I../inc -S2 -DDebug classes.pp'
  199. \end{verbatim}
  200. This will scan the file \file{classes.pp}, with the \var{DEBUG} symbol
  201. defined, the scanner will look for include files in the \file{../inc}
  202. directory, and \var{OBJFPC}-mode syntax will be accepted.
  203. (for more information about these options, see the \fpc compiler user's
  204. guide)
  205. With the above commands, a set of documentation files will be generated in
  206. HTML format (this is the standard). There will be no description of any of
  207. the identifiers found in the unit's interface section, but all identifiers
  208. declarations will be present in the documentation.
  209. The actual documentation (i.e. the description of each of the identifiers)
  210. resides in a description file, which can be specified with the \var{descr}
  211. option:
  212. \begin{verbatim}
  213. fpdoc --package=fcl --descr=crt.xml --input=crt.pp
  214. \end{verbatim}
  215. This will scan the \file{crt.pp} file and generate documentation for it,
  216. using the descriptions found in the file{crt.xml} file. The documentation
  217. will be written in a directory called \file{fcl}.
  218. \begin{verbatim}
  219. fpdoc --package=fcl --descr=classes.xml \
  220. --input='-I../inc -S2 -DDebug classes.pp'
  221. \end{verbatim}
  222. All options should be given on one line.
  223. This will scan the file \file{classes.pp}, with the \var{DEBUG} symbol
  224. defined, the scanner will look for include files in the \file{../inc}
  225. directory, and \var{OBJFPC}-mode syntax will be accepted.
  226. More than one input file or description file can be given:
  227. \begin{verbatim}
  228. fpdoc --package=fcl --descr=classes.xml --descr=process.xml \
  229. --input='-I../inc -S2 -DDebug classes.pp' \
  230. --input='-I../inc -S2 -DDebug process.pp'
  231. \end{verbatim}
  232. Here, documentation will be generated for 2 units: \file{classes}
  233. and \var{process}
  234. The format of the description file is discussed in the next chapter.
  235. Other formats can be generated, such as latex:
  236. \begin{verbatim}
  237. fpdoc --format=latex --package=fcl \
  238. --descr=classes.xml --descr=process.xml\
  239. --input='-I../inc -S2 -DDebug classes.pp' \
  240. --input='-I../inc -S2 -DDebug process.pp'
  241. \end{verbatim}
  242. This will generate a LaTeX file called \file{fcl.tex}, which contains the
  243. documentation of the units \file{classes} and \var{process}. The latex file
  244. contains no document preamble, it starts with a chapter command.
  245. It is meant to be included (using the LaTeX include command) in a latex
  246. document with a preamble.
  247. The output of \fpdoc can be further customised by several command-line
  248. options, which will be explained in the next section.
  249. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  250. % Usage
  251. \section{\fpdoc command-line options reference}
  252. In this section all \fpdoc command-line options are explained.
  253. % content
  254. \subsection{content}
  255. \label{suse:content}
  256. This option tells \fpdoc to generate a content file.
  257. A content file contains a list of all the
  258. possible anchors (labels) in the generated documentation file, and can be
  259. used to create cross-links in documentation for units in other packages,
  260. using the counterpart of the content option, the \var{import} option
  261. (\seesu{import}).
  262. %descr
  263. \subsection{descr}
  264. \label{suse:descr}
  265. This option specifies the name of a description file that contains the
  266. actual documentation for the unit. This option can be given several
  267. times, for several description files. The file will be searched relative to
  268. the current directory. No extension is added to the file, it should be a
  269. complete filename.
  270. If the filename starts with an 'at' sign \var{@}, then it is interpreted
  271. as a text file which contains a list of filenames, one per line.
  272. Each of these files will be added to the list of description files.
  273. The nodes in the description files will be merged into one big tree. This
  274. means that the documentation can be divided over multiple files. When
  275. merging the description files, nodes that occur twice will end up only once
  276. in the big node tree: the last node will always be the node that ends up in
  277. the parse tree. This means that the order of the various input commands or
  278. the ordering of the files in the file list is important.
  279. Examples:
  280. \begin{verbatim}
  281. --descr=crt.xml
  282. \end{verbatim}
  283. will tell \fpdoc to read documentation from \file{crt.xml}, while
  284. \begin{verbatim}
  285. [email protected]
  286. \end{verbatim}
  287. will tell \fpdoc to read filenames from \file{fcl.lst}; each of the
  288. filenames found in it will be added to the list of files to be scanned for
  289. descriptions.
  290. %format
  291. \subsection{format}
  292. \label{suse:format}
  293. Specifies the output format in which the documentation will be generated.
  294. Currently, the following formats are known:
  295. \begin{description}
  296. \item[htm] Plain HTML with 8.3 conforming filenames.
  297. \item[html] HTML with long filenames.
  298. \item[xhtml] XHTML with long filenames.
  299. \item[latex] LaTex, which uses the \file{fpc.sty} style used by the \fpc
  300. documentation.
  301. \item[xml-struct] Structured XML.
  302. \end{description}
  303. % help
  304. \subsection{help}
  305. Gives a short copyright notice.
  306. % hide-protected
  307. \subsection{hide-protected}
  308. \label{suse:hideprotected}
  309. By default, the documentation will include descriptions and listings of
  310. protected fields and methods in classes or objects. This option changes this
  311. behaviour; if it is specified, no documentation will be generated for these
  312. methods. Note that public methods or properties that refer to these
  313. protected methods will then have a dangling (i.e. unavailable) link.
  314. % html-search
  315. \subsection{html-search}
  316. \label{suse:htmlsearch}
  317. This option can be used when generating HTML documentation, to specify an
  318. url that can be used to search in the generated documentation. The URL will be
  319. included in the header of each generated page with a \var{Search} caption.
  320. The option is ignored for non-html output formats.
  321. \fpdoc does not generate a search page, this should be made by some external
  322. tool. Only the url to such a page can be specified.
  323. Example:
  324. \begin{verbatim}
  325. --html-search=../search.html
  326. \end{verbatim}
  327. % import
  328. \subsection{import}
  329. \label{suse:import}
  330. Import a table of contents file, generated by \fpdoc for another package
  331. with the \var{content} option (\seesu{content}). This option can be used
  332. to refer to documentation nodes in documentation sets for other packages.
  333. The argument consists of two parts: a filename, and a link prefix.
  334. The filename is the name of the file that will be imported. The link
  335. prefix is a prefix that will be made to each HTML link; this needs to be
  336. done to be able to place the files in different directories.
  337. Example:
  338. \begin{verbatim}
  339. --import=../fcl.cnt,../fcl
  340. \end{verbatim}
  341. This will read the file fcl.cnt in the parent directory. For HTML
  342. documentation, all links to items in the fcl.cnt file, the link will be
  343. prepended with \file{../fcl}.
  344. This allows a setup where all packages have their own subdirectory of a
  345. common documentation directory, and all content files reside in the main
  346. documentation directory, as e.g. in the following directory tree:
  347. \begin{verbatim}
  348. /docs/fcl
  349. /fpdoc
  350. /fpgui
  351. /fpgfx
  352. /fpimg
  353. \end{verbatim}
  354. The file fcl.cnt would reside in the \file{docs} directory. Similarly, for
  355. each package a contents file \file{xxx.cnt} could be places in that
  356. directory. Inside the subdirectory, commands as the above could be used to
  357. provide links to other documentation packages.
  358. Note that for Latex documentation, this option is ignored.
  359. % input
  360. \subsection{input}
  361. \label{suse:input}
  362. This option tells \fpdoc what input file should be used. The argument can
  363. be just a filename, but can also be a complete compiler command-line with
  364. options that concern the scanning of the Pascal source: defines, include
  365. files, syntax options, as they would be specified to the \fpc compiler
  366. when compiling the file. If a complete command is used, then it should be
  367. enclosed in single or double quotes, so the shell will not break them in
  368. parts.
  369. It is possible to specify multiple input commands; they will be treated one
  370. by one, and documentation will be generated for each of the processed files.
  371. % lang
  372. \subsection{lang}
  373. \label{suse:lang}
  374. Select the language for the generated documentation. This will change all
  375. header names to the equivalent in the specified language. The documentation
  376. itself will not be translated, only the captions and headers used in the
  377. text.
  378. Currently, valid choices are
  379. \begin{description}
  380. \item[de] German.
  381. \item[fr] French.
  382. \item[nl] Dutch.
  383. \end{description}
  384. Example:
  385. \begin{verbatim}
  386. --lang=de
  387. \end{verbatim}
  388. Will select German language for headers.
  389. The language files should be installed correctly for this option to work.
  390. See the section on installing to check whether the languages are installed
  391. correctly.
  392. % latex-highlight
  393. \subsection{latex-highlight}
  394. \label{suse:latexhighlight}
  395. Switches on an internal latex syntax highlighter. This is not yet
  396. implemented. By default, syntax highlighting is provided by the syntax
  397. package that comes with \fpc.
  398. % output
  399. \subsection{output}
  400. \label{suse:output}
  401. This option tells \fpdoc where the output file should be generated.
  402. How this option is interpreted depends on the format that is used.
  403. For latex, this is interpreted as the filename for the tex file.
  404. For all other formats, this is interpreted as the directory where all
  405. documentation files will be written. The directory will be created if
  406. it does not yet exist.
  407. The filename or directory name is interpreted as relative to the current
  408. directory.
  409. Example:
  410. \begin{verbatim}
  411. --format=html --output=docs/classes
  412. \end{verbatim}
  413. will generate HTML documentation in the directory \file{docs/classes}.
  414. \begin{verbatim}
  415. --format=latex --output=docs/classes.tex
  416. \end{verbatim}
  417. will generate latex documentation in the file \file{docs/classes}.
  418. % package
  419. \subsection{package}
  420. \label{suse:package}
  421. This option specifies the name of the package to be used. The package name
  422. will also be used as a default for the \var{output} option (\seesu{output}).
  423. % show-private
  424. \subsection{show-private}
  425. \label{suse:showprivate}
  426. By default, no documentation is generated for private methods or fields of
  427. classes or objects. This option causes \fpdoc to generate documentation
  428. for these methods and fields as well.
  429. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  430. % Makeskel
  431. \section{makeskel}
  432. \label{se:makeskel}
  433. % Introduction
  434. \subsection{introduction}
  435. \label{suse:makeskelintro}
  436. The makeskel tool can be used to generate an empty description file
  437. for a unit. The description file will contain an element node for each
  438. identifier in the interface section of the Pascal unit.
  439. It's usage is quite straightforward: the name of an input file
  440. (one or more) must be specified (as for \fpdoc), an output file,
  441. and the name of a package:
  442. \begin{verbatim}
  443. makeskel --package=rtl --input=crt.pp --output=crt.xml
  444. \end{verbatim}
  445. This will read the file \file{crt.pp} and will create a file \file{crt.xml}
  446. which contains empty nodes for all identifiers found in \file{crt.pp}, all
  447. in a package named \var{rtl}.
  448. The \var{input} option can be given more than once, as for the \file{fpdoc}
  449. command:
  450. \begin{verbatim}
  451. makeskel --input='-Sn system.pp' --input=crt.pp --output=rtl.xml
  452. \end{verbatim}
  453. As can be seen, the \var{input} option can contain some compiler options,
  454. as is the case for \fpdoc. The above command will process the files
  455. \file{system.pp} and \var{crt.pp}, and will create \tag{element} tags
  456. for the identifiers in both units in the file \var{rtl.xml}.
  457. The output of \file{makeskel} is a valid, empty description file. It will
  458. contain a \tag{module} tag for each unit specified, and each \tag{module}
  459. will have \tag{element} tags for each identifier in the unit.
  460. Each \tag{element} tag will by default contain \tag{short}, \tag{descr},
  461. \tag{errors} and \tag{seealso} tags, but this can be customised.
  462. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  463. % Makeskel
  464. \section{Makeskel option reference}
  465. \label{se:makeskeloption}
  466. The output of \file{makeskel} can be customised using several options, which
  467. are discussed below.
  468. % disable-arguments
  469. \subsection{disable-arguments}
  470. \label{suse:msdisablearguments}
  471. By default, for each function or procedure argument, a \tag{element} tag will
  472. be generated. This option disables this behaviour: no \tag{element} tags
  473. will be generated for procedure and function arguments.
  474. % disable-errors
  475. \subsection{disable-errors}
  476. \label{suse:msdisableerrors}
  477. If this option is specified, no \tag{errors} tag will be generated in the
  478. element nodes. By default all element tags contain a \tag{errors} node.
  479. The \tag{errors} tag is ignored when it is not needed; Normally, an
  480. \tag{errors} tag is only needed for procedure and function elements.
  481. % disable-function-results
  482. \subsection{disable-function-results}
  483. \label{suse:disablefunctionresults}
  484. If this option is specified, then no \tag{element} tag will be generated for
  485. function results. By default, \file{makeskel} will generate a result node
  486. for each function in the interface section. The result node is used in the
  487. documentation to document the return value of the function under a separate
  488. heading in the documentation page. Specifying this option suppresses the
  489. generation of the \tag{element} tag for the function result.
  490. % disable-private
  491. \subsection{disable-private}
  492. \label{suse:disableprivate}
  493. If this option is specified, then no \tag{element} tags will be generated
  494. for private methods or fields of classes or objects.
  495. The default behaviour is to generate nodes for private methods or fields.
  496. It can be used to generate a skeleton for end-user and developer
  497. documentation.
  498. % disable-protected
  499. \subsection{disable-protected}
  500. \label{suse:disableprotected}
  501. If this option is specified, then no \tag{element} tags will be generated
  502. for protected and private methods or fields of classes or objects.
  503. The default is to generate nodes for protected methods or fields. If this
  504. option is given, the option \var{--disable-private} is implied. It can be
  505. used to generate end-user-only documentation for classes.
  506. % disable-seealso
  507. \subsection{disable-seealso}
  508. \label{suse:msdisableseealso}
  509. If this option is specified, no \tag{seealso} tag will be generated in the
  510. element nodes. By default all \tag{element} tags contain a \tag{seealso} tag.
  511. % emitclassseparator
  512. \subsection{emitclassseparator}
  513. \label{suse:msemitclassseparator}
  514. When this option is specified, at the beginning of the elements for the
  515. documentation of a class, a comment tag is emitted which contains a
  516. separator text. This can be useful to separate documentation of different
  517. classes and make the description file more understandable.
  518. % help
  519. \subsection{help}
  520. \label{suse:mshelp}
  521. \file{Makeskel} emits a short copyright notice and exits when this option is
  522. specified.
  523. % input
  524. \subsection{input}
  525. \label{suse:msinput}
  526. This option is identical in meaning and functionality as the \var{input}
  527. option for \fpdoc. (\seesu{input}) It specifies the Pascal unit source
  528. file that will be scanned and for which a skeleton description file will be
  529. generated. Multiple \var{input} options can be given, and \tag{element}
  530. tags will be written for all the files, in one big output file.
  531. % lang
  532. \subsection{lang}
  533. \label{suse:mslang}
  534. This option is used to specify the language for messages emitted by
  535. \file{makeskel}. The supported languages are identical to the ones
  536. for \fpdoc:
  537. \begin{description}
  538. \item[de] German.
  539. \item[fr] French.
  540. \item[nl] Dutch.
  541. \end{description}
  542. % output
  543. \subsection{output}
  544. \label{suse:msoutput}
  545. This option specifies the name of the output file. A full filename must be
  546. given, no extension will be added. If this option is omitted, the output
  547. will be sent to standard output.
  548. % package
  549. \subsection{package}
  550. \label{suse:mspackage}
  551. This option specifies the package name that will be used when generating the
  552. skeleton. It is a mandatory option.
  553. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  554. % The description file.
  555. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  556. \chapter{The description file}
  557. \label{ch:descriptionfile}
  558. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  559. % Introduction
  560. \section{Introduction}
  561. The description file is a XML document, which means that it is a kind of
  562. HTML or SGML like format, however it is more structured than HTML, making it
  563. easier to parse - and makes it easier to connect or merge it with a Pascal
  564. source file. Since the allowed syntax uses a lot of HTML tags, this makes
  565. it easy to write code for those that are familiar with writing HTML.
  566. More information about the XML format, SGML and HTML can be found on the
  567. website of the W3 (World Wide Web) consortium:
  568. \htmladdnormallink{http://www.w3.org/}{http://www.w3.org}
  569. The remaining of this chapter assumes a basic knowledge of tags, their
  570. attributes and markup language, so these terms will not be explained here.
  571. The minimal documentation file would look something like this:
  572. \begin{verbatim}
  573. <?xml version="1.0" encoding="ISO8859-1"?>
  574. <fpdoc-descriptions>
  575. <package name="fpc">
  576. <module name="Classes">
  577. </module>
  578. </fpdoc-description>
  579. </package>
  580. \end{verbatim}
  581. The header \tag{xml} tag is mandatory, and indicates that the file contains a
  582. documentation XML document.
  583. Inside the document, one or more top-level \tag{fpdoc-descriptions}
  584. tags may appear. Each of these tags can contain one or more \tag{package}
  585. tags, which must have a \attr{name} attribute. The name attribute will be
  586. used by fpdoc to select the documentation nodes.
  587. Inside a \tag{package} tag, one or more \tag{module} tags may appear. there
  588. should be one \tag{module} tag per unit that should be documented. The value
  589. of the \attr{name} attribute of the \var{module} should be the name of the
  590. unit for which the \tag{module} tag contains the documentation. The value
  591. of the \var{name} attribute is case insensitive, i.e.
  592. \begin{verbatim}
  593. <module name="CRT">
  594. \end{verbatim}
  595. can be used for the documentation of the \file{crt} unit.
  596. As it is above, the documentation description does not do much. To write
  597. real documentation, the \tag{module} tag must be filled with the
  598. documentation for each identifier that appears in the unit interface header.
  599. For each identifier in the unit interface header, the \tag{module} should
  600. contain a tag that documents the identifier: this is the \tag{element} tag.
  601. The name attribute of the element tag links the documentation to the
  602. identifier: the \attr{name} attribute should have as value the fully
  603. qualified name of the identifier in the unit.
  604. For example, to document the type
  605. \begin{verbatim}
  606. Type
  607. MyEnum = (meOne,meTwo,meThree);
  608. \end{verbatim}
  609. an \tag{element} tag called \var{myenum} should exist:
  610. \begin{verbatim}
  611. <element name="myenum">
  612. </element>
  613. \end{verbatim}
  614. But also for each of the three enumerated values an \tag{element} tag should
  615. exist:
  616. \begin{verbatim}
  617. <element name="myenum.meOne">
  618. </element>
  619. <element name="myenum.meTwo">
  620. </element>
  621. <element name="myenum.meThree">
  622. </element>
  623. \end{verbatim}
  624. As it can be seen, the names of the identifiers follow a hierarchical
  625. structure. More about this in the next section.
  626. Now the tags for the types are present, all that should be done is to fill
  627. it with the actual description. For this, several tags can be placed inside
  628. a \tag{element} tag. The most important tag is the \tag{descr} tag. The
  629. contents of the \tag{descr} tag will be used to describe a type, function,
  630. constant or variable:
  631. \begin{verbatim}
  632. <element name="myenum">
  633. <descr>
  634. The MyEnum type is a simple enumeration type which is not
  635. really useful, except for demonstration purposes.
  636. </descr>
  637. </element>
  638. \end{verbatim}
  639. A second important tag is the \tag{short} tag. It should contain a
  640. short description of the identifier, preferably a description that fits on
  641. one line. The \tag{short} tag will be used in
  642. various overviews, at the top of a page in the HTML documentation (a
  643. synopsis) or will be used instead of the \tag{descr} tag if that one
  644. is not available. It can also be used in different other cases: For
  645. instance the different values of an enumeration type will be laid
  646. out in a table, using the \tag{short} description:
  647. \begin{verbatim}
  648. <element name="myenum.meOne">
  649. <short>The first enumeration value</short>
  650. </element>
  651. <element name="myenum.meTwo">
  652. <short>The second enumeration value</short>
  653. </element>
  654. <element name="myenum.meThree">
  655. <short>The third enumeration value</short>
  656. </element>
  657. \end{verbatim}
  658. This will be converted to a table looking more or less like this:
  659. \begin{tabularx}{\textwidth}{lX}
  660. meOne & The first enumeration value \\
  661. meTwo & The second enumeration value \\
  662. meThree & The third enumeration value \\
  663. \end{tabularx}
  664. For functions and procedures, a list of possible error conditions can be
  665. documented inside a \tag{errors} tag. This tag is equivalent to the
  666. \tag{descr} tag, but is placed under a different heading in the generated
  667. documentation.
  668. Finally, to cross-reference between related functions, types or classes, a
  669. \tag{seealso} tag is also introduced. This will be used to lay out a series
  670. of links to related information. This tag can only have sub-tags which are
  671. \var{link} tags. For more about the \tag{link} tag, see \seetag{link}.
  672. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  673. % cross-referencing
  674. \section{Element names and cross-referencing}
  675. \subsection{Element name conventions}
  676. As mentioned in the previous section, the \var{element} tag's \attr{name}
  677. attribute is hierarchical. All levels in the hierarchy are denoted by a dot
  678. (.) in the name attribute.
  679. As shown in the previous example, for an enumerated type, the various
  680. enumeration constants can be documented by specifying their name as
  681. \var{enumname.constname}. For example, given the type
  682. \begin{verbatim}
  683. Type
  684. MyEnum = (meOne,meTwo,meThree);
  685. \end{verbatim}
  686. The various enumeration values can be documented using the element names
  687. \var{MyEnum.meOne}, \var{MyEnum.meTwo} and \var{MyEnum.meThree}:
  688. \begin{verbatim}
  689. <element name="myenum.meOne">
  690. </element>
  691. <element name="myenum.meTwo">
  692. </element>
  693. <element name="myenum.meThree">
  694. </element>
  695. \end{verbatim}
  696. Note that the casing of the name attribute need not be the same as the
  697. casing of the declaration.
  698. This hierarchical structure can be used for all non-simple types:
  699. \begin{itemize}
  700. \item Enumeration type values.
  701. \item Fields in records, objects, classes. For nested record definitions,
  702. multiple levels are possible in the name.
  703. \item Methods of classes and objects.
  704. \item Properties of classes.
  705. \item Function and procedure arguments.
  706. \item Function results. The name is always the function name followed by
  707. \var{Result}.
  708. \end{itemize}
  709. \subsection{Cross referencing: the \var{link} tag}
  710. To refer to another point in the documentation (a related function, class or
  711. whatever), a \tag{link} tag exists. The \var{link} tag takes as a sole
  712. attribute a target \attr{id} attribute. The link tag usually encloses a
  713. piece of text. In the HTML version of the documentation, this piece of text
  714. will function as a hyperlink. In the latex version, a page number reference
  715. will be printed.
  716. The \attr{id} attribute contains the name of an element to which the link
  717. refers. The name is not case sensitive, but it must be a fully qualified
  718. name.
  719. An example of the link type would be:
  720. \begin{verbatim}
  721. The <link id="MyEnum">MyEnum</link> type is a simple type.
  722. \end{verbatim}
  723. The link attribute also has a short form:
  724. \begin{verbatim}
  725. The <link id="MyEnum"/> type is a simple type.
  726. \end{verbatim}
  727. In the short form, the value of the \attr{id} attribute will be used as the
  728. text which will be hyperlinked. This is especially useful in the \tag{seealso}
  729. tag.
  730. To refer to a type in another unit, the unit name must be prepended to the
  731. \attr{id} attribute:
  732. \begin{verbatim}
  733. <link id="myunit.myenum"/>
  734. \end{verbatim}
  735. will link to the \var{myenum} type in a unit named \file{myunit}.
  736. To refer to a node in the documentation of another package, the package name
  737. should be prepended to the \attr{id} attribute, and it should be prepended
  738. with the hash symbol (\#):
  739. \begin{verbatim}
  740. <link id="#fcl.classes.sofrombeginning"/>
  741. \end{verbatim}
  742. will link to the constant \var{sofrombeginning} in the \file{classes} unit
  743. of the FCL reference documentation. Note that for this to work correctly,
  744. the contents file which was created when generating the documentation of
  745. the type must be imported correctly (see the \var{import} option).
  746. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  747. % Tag reference
  748. \section{Tag reference}
  749. \subsection{Overview}
  750. The tags can roughly be divided in 2 groups:
  751. \begin{enumerate}
  752. \item Documentation structure tags. These are needed for fpdoc to do it's
  753. work. They determine what elements are documented. See \seet{structtags}
  754. \item Text structure and formartting tags. These tags indicate blocks of text, such as
  755. paragraphs, tables, lists and remarks, but also specify formatting: apply formatting (make-up)
  756. to the text, or to provide links to other parts of the text. These mostly occur in
  757. text structure tags. See \seet{formattags}
  758. \end{enumerate}
  759. \begin{table}[ht]
  760. \caption{Documentation structure tags}\label{tab:structtags}
  761. \begin{tabularx}{\textwidth}{lXr}
  762. Tag & Description & Page \\ \hline
  763. descr & Element description & \pageref{tag:descr} \\
  764. element & Identifier documentation & \pageref{tag:element} \\
  765. errors & Error section & \pageref{tag:errors} \\
  766. fpdoc-description & Global tag & \pageref{tag:fpdocdescription} \\
  767. module & Unit tag & \pageref{tag:module} \\
  768. package & Package global tab & \pageref{tag:package} \\
  769. seealso & Cross-reference section & \pageref{tag:seealso} \\
  770. short & Short description & \pageref{tag:short} \\ \hline
  771. \end{tabularx}
  772. \end{table}
  773. \begin{table}[ht]
  774. \caption{Text formatting tags}\label{tab:formattags}
  775. \begin{tabularx}{\textwidth}{lXr}
  776. Tag & Description & Page \\ \hline
  777. b & Format bold & \pageref{tag:b} \\
  778. caption & Specify table caption & \pageref{tag:caption} \\
  779. code & Syntax highlight code & \pageref{tag:code} \\
  780. dd & definition data & \pageref{tag:dd} \\
  781. dl & definition list & \pageref{tag:dl} \\
  782. dt & Definition term & \pageref{tag:dt} \\
  783. i & format italics & \pageref{tag:i} \\
  784. li & list element & \pageref{tag:li} \\
  785. link & Cross-reference & \pageref{tag:link} \\
  786. ol & numbered list & \pageref{tag:ol} \\
  787. p & paragraph & \pageref{tag:p} \\
  788. pre & Preformatted text & \pageref{tag:pre} \\
  789. remark & remark paragraph & \pageref{tag:remark} \\
  790. table & Table & \pageref{tag:table} \\
  791. td & Table cell & \pageref{tag:td} \\
  792. th & Table header & \pageref{tag:th} \\
  793. tr & Table row & \pageref{tag:tr} \\
  794. u & format underlined & \pageref{tag:u} \\
  795. ul & bulleted list & \pageref{tag:ul} \\
  796. var & format as variable & \pageref{tag:var} \\ \hline
  797. \end{tabularx}
  798. \end{table}
  799. The nodes for formatting a text resemble closely the basic HTML formatting tags with the
  800. following exceptions:
  801. \begin{itemize}
  802. \item Each opening tag must have a corresponding closing tag.
  803. \item Tags are case sensitive.
  804. \item Tables and paragraphs are at the same level, i.e. a table cannot occur
  805. inside a paragraph. The same is true for all 'structural' tags such as
  806. lists,
  807. \end{itemize}
  808. Also, if special formatting tags such as a table or lists are inserted, then
  809. the remaining text must be inside a paragraph tag. This means that the
  810. following is wrong:
  811. \begin{verbatim}
  812. <descr>
  813. Some beginning text
  814. <ol>
  815. <li>A list item</li>
  816. </ol>
  817. some ending text
  818. </descr>
  819. \end{verbatim}
  820. Instead, the correct XML should be
  821. \begin{verbatim}
  822. <descr>
  823. <p>Some beginning text</p>
  824. <ol>
  825. <li>A list item</li>
  826. </ol>
  827. <p>some ending text</p>
  828. </descr>
  829. \end{verbatim}
  830. % Tag B
  831. \subsection{\tag{b} : format bold}
  832. \label{tag:b}
  833. This tag will cause the text inside it to be formatted using a bold font.
  834. Example:
  835. \begin{verbatim}
  836. Normal text <b>Bold text</b> normal text.
  837. \end{verbatim}
  838. will be formatted as:\\
  839. Normal text \textbf{Bold text} normal text.
  840. See also: \seetag{i}, \seetag{u}.
  841. % Tag caption
  842. \subsection{\tag{caption} : Specify table caption}
  843. \label{tag:caption}
  844. This tag can occur inside a \tag{table} tag and serves to set the table
  845. caption.
  846. Example
  847. \begin{verbatim}
  848. <table>
  849. <caption>This caption will end up above the table</caption>
  850. <th><td>Column 1</td><td>Column 2</td></th>
  851. </table>
  852. \end{verbatim}
  853. See also: \seetag{table}
  854. % Tag code
  855. \subsection{\tag{code} : format as pascal code}
  856. \label{tag:code}
  857. The \tag{code} tag serves to insert Pascal code into the text. When possible
  858. this code will be highlighted in the output. It can be used to put
  859. highlighted Pascal code in the documentation of some identifier. It can
  860. occur inside \tag{descr} or \tag{errors} tags.
  861. Note that any text surrounding the \tag{code} tag should be placed in
  862. paragraph tags \tag{p}.
  863. Example:
  864. \begin{verbatim}
  865. <code>
  866. With Strings do
  867. For i:=Count-1 downto 0 do
  868. Delete(i);
  869. </code>
  870. \end{verbatim}
  871. Seealso: \seetag{pre}, \seetag{p}
  872. % Tag descr
  873. \subsection{\tag{descr} : Descriptions}
  874. \label{tag:descr}
  875. This is the actual documentation tag. The contents of this tag will be
  876. written as the documentation of the element. It can contain any mixture of
  877. text and markup tags. The \tag{descr} tag can only occur inside a
  878. \tag{element} or \tag{module}.
  879. Example:
  880. \begin{verbatim}
  881. <element name="MyEnym">
  882. <descr>Myenum is a simple enumeration type</descr>
  883. </element>
  884. \end{verbatim}
  885. See also: \seetag{element}, \seetag{short}, \seetag{errors}, \seetag{seealso}
  886. % Tag dd
  887. \subsection{\tag{dd} : definition data.}
  888. \label{tag:dd}
  889. The \tag{dd} tag is used to denote the definition of a term in a definition
  890. list. It can occur only inside a definition list tag (\tag{dl}), after a
  891. definition term (\tag{dt}) tag. It's usage is identical to the one in HTML.
  892. Example:
  893. \begin{verbatim}
  894. <dl>
  895. <dt>FPC</dt><dd>stands for Free Pascal Compiler.</dd>
  896. </dl>
  897. \end{verbatim}
  898. Will be typeset as
  899. \begin{description}
  900. \item[FPC] stands for Free Pascal Compiler.
  901. \end{description}
  902. See also: \seetag{dl}, \seetag{dt}, \seetag{ol}, \seetag{ul}
  903. % Tag dl
  904. \subsection{\tag{dl} : definition list.}
  905. \label{tag:dl}
  906. Definition lists are meant to type a set of terms together with their
  907. explanation. It's usage is identical to the one in HTML, with the exception
  908. that it cannot occur inside ordinary text: surrounding text should always be
  909. enclosed in paragraph tags.
  910. Example:
  911. \begin{verbatim}
  912. <dl>
  913. <dt>meOne</dt><dd>First element of the enumeration type.</dd>
  914. <dt>meTwo</dt><dd>Second element of the enumeration type.</dd>
  915. <dt>meThree</dt><dd>Thir element of the enumeration type.</dd>
  916. </dl>
  917. \end{verbatim}
  918. Will be typeset as
  919. \begin{description}
  920. \item[meOne] First element of the enumeration type.
  921. \item[meTwo] Second element of the enumeration type.
  922. \item[meThree] Third element of the enumeration type.
  923. \end{description}
  924. See also: \seetag{dt}, \seetag{dd}, \seetag{ol}, \seetag{ul}
  925. % Tag dt
  926. \subsection{\tag{dt} : definition term.}
  927. \label{tag:dt}
  928. The \tag{dt} tag is used in definition lists to enclose the term for which a
  929. definition is presented. It's usage is identical to the usage in HTML.
  930. Example:
  931. \begin{verbatim}
  932. <dl>
  933. <dt>FPC</dt><dd>stands for Free Pascal Compiler.</dd>
  934. </dl>
  935. \end{verbatim}
  936. Will be typeset as
  937. \begin{description}
  938. \item[FPC] stands for Free Pascal Compiler.
  939. \end{description}
  940. See also: \seetag{dl}, \seetag{dd}, \seetag{ol}, \seetag{ul}
  941. % Tag element
  942. \subsection{\tag{element} : Identifier documentation}
  943. \label{tag:element}
  944. The \tag{element} contains the documentation for an identifier in a unit. It
  945. should occur inside a \var{module} tag. It can contain 4 tags:
  946. \begin{description}
  947. \item[short] For a one-line description of the identifier. Is used as a
  948. header or is used in overviews of constants, types, variables or classes.
  949. \item[descr] Contains the actual description of the identifier.
  950. \item[errors] For functions an procedures this can be used to describe error
  951. conditions. It will be put in a separate section below the description
  952. section.
  953. \item[seealso] Used to refer to other nodes. will be typeset in a separate
  954. section.
  955. \end{description}
  956. The \tag{element} tag should have at least the \attr{name} attribute, it
  957. is used to link the element node to the actual identifier in the Pascal unit.
  958. Other attributes may be added in future.
  959. Example:
  960. \begin{verbatim}
  961. <element name="MyEnym">
  962. <descr>Myenum is a simple enumeration type</descr>
  963. </element>
  964. \end{verbatim}
  965. See also: \seetag{descr}, \seetag{short}, \seetag{errors}, \seetag{seealso}
  966. % Tag errors
  967. \subsection{\tag{errors} : Error section.}
  968. \label{tag:errors}
  969. The \tag{errors} tag is used to document any errors that can occur when
  970. calling a function or procedure. it is placed in a different section in the
  971. generated documentation. It occurs inside a \tag{element} tag, at the same
  972. level as a \tag{descr} or \tag{short} tag. It's contents can be any
  973. text or formatting tag.
  974. Example:
  975. \begin{verbatim}
  976. <element name="MyDangerousFunction">
  977. <descr>MyDangerousFunction is a dangerous function</descr>
  978. <errors>When MyDangerousFunction fails, all is lost</errors>
  979. </element>
  980. \end{verbatim}
  981. See also: \seetag{descr}, \seetag{short}, \seetag{element}, \seetag{seealso}
  982. % Tag fpdoc-description
  983. \subsection{\tag{fpdoc-description} : Global tag}
  984. \label{tag:fpdocdescription}
  985. The \tag{fpdoc-description} tag is the topmost tag in a description file. It
  986. contains a series of \tag{package} tags, one for each package that is
  987. described in the file.
  988. See also: \seetag{package}
  989. % Tag i
  990. \subsection{\tag{i} : Format italics}
  991. \label{tag:i}
  992. The \tag{i} tag will cause its contents to be typeset in italics. It can
  993. occur mixed with any text.
  994. Example:
  995. \begin{verbatim}
  996. Normal text <i>italic text</i> normal text.
  997. \end{verbatim}
  998. will be formatted as:\\
  999. Normal text \textit{italic text} normal text.
  1000. See also: \seetag{b}, \seetag{u}
  1001. % Tag li
  1002. \subsection{\tag{li} : list element}
  1003. \label{tag:li}
  1004. The tag \tag{li} denotes an element in a \tag{ol} or \tag{ul} list.
  1005. The usage is the same as for it's HTML counterpart: It can occur
  1006. only inside one of the \tag{ol} or \tag{ul} list tags.
  1007. It's contents may be arbitrary text and formatting tags, contrary to HTML
  1008. tags, the \tag{li} tag always must have a closing tag. Note that it cannot be used in a
  1009. definition list (\seetag{dl}).
  1010. Example:
  1011. \begin{verbatim}
  1012. <ul>
  1013. <li>First item in the list</li>
  1014. <li>Second item in the list</li>
  1015. </ul>
  1016. \end{verbatim}
  1017. Will be typeset as
  1018. \begin{itemize}
  1019. \item First item in the list.
  1020. \item Second item in the list.
  1021. \end{itemize}
  1022. See also: \seetag{ol}, \seetag{ul}.
  1023. % Tag link
  1024. \subsection{\tag{link} : Cross-reference}
  1025. \label{tag:link}
  1026. The \tag{link} tag is used to insert a reference to an element inside some
  1027. piece of text or inside the \tag{seealso} section. It is similar in
  1028. functionality to the
  1029. \begin{verbatim}
  1030. <A HREF="SomeAnchor">some linked text</A>
  1031. \end{verbatim}
  1032. construct in HTML.
  1033. The mandatory \attr{id} attribute of the \tag{link} tag should have the
  1034. name of an element tag in it. This name is not case sensitive. \fpdoc
  1035. will issue a warning if it cannot find a matching name. It will look for
  1036. matching names in the current file, and in all content files that have been
  1037. specified with the \var{import} command-line option.
  1038. The link tag can exist in 2 forms: one with separate closing tag,
  1039. surrounding a piece of text, one without separate closing tag. If a piece of
  1040. text is surrounded by the link tag, then the text will be converted to a
  1041. hyperlink in the HTML documentation. If there is no surrounded text, then
  1042. the value of the \attr{id} attribute will be used as the text. This means
  1043. that
  1044. \begin{verbatim}
  1045. <link id="TStream">TStream</link>
  1046. \end{verbatim}
  1047. and
  1048. \begin{verbatim}
  1049. <link id="TStream"/>
  1050. \end{verbatim}
  1051. are completely equivalent.
  1052. Example:
  1053. \begin{verbatim}
  1054. The <link id="TStringlist">stringlist</link> class is a descendent of the
  1055. <link id="TStrings"/> class.
  1056. \end{verbatim}
  1057. See also: \seetag{element}, the \var{import} option (\seesu{import}).
  1058. % Tag module
  1059. \subsection{\tag{module} : Unit reference}
  1060. \label{tag:module}
  1061. The \tag{module} tag encloses all \tag{element} tags for a unit. It can
  1062. contain only \tag{element} tags for all identifiers in the unit and
  1063. a \tag{descr} tag describing the unit itself. The \tag{module} tag should
  1064. occur inside a \tag{package} tag.
  1065. The \attr{name} attribute should have as a value the name of the unit which
  1066. is described by the module. This name is not case sensitive.
  1067. Example:
  1068. \begin{verbatim}
  1069. <module name="classes">
  1070. <descr>
  1071. The classes unit contains basic class definitions for the FCL.
  1072. </descr>
  1073. </module>
  1074. \end{verbatim}
  1075. See also: \seetag{package}, \seetag{descr}, \seetag{element}
  1076. % Tag ol
  1077. \subsection{\tag{ol} : Numbered list.}
  1078. \label{tag:ol}
  1079. The \tag{ol} tag starts a numbered list. It can contain only \seetag{li}
  1080. tags, which denote the various elements in the list. Each item will be
  1081. preceded by a number. The \tag{ol} tag can
  1082. occur inside a text, but surrounding text should always be enclosed in a
  1083. \seetag{p} paragraph tag, i.e. an \tag{ol} tag should occur always at the
  1084. same level as a \tag{p} tag.
  1085. Example:
  1086. \begin{verbatim}
  1087. <p> some text before</p>
  1088. <ol>
  1089. <li>First item in the list</li>
  1090. <li>Second item in the list</li>
  1091. </ol>
  1092. \end{verbatim}
  1093. Will be typeset as:
  1094. some text before
  1095. \begin{enumerate}
  1096. \item First item in the list.
  1097. \item Second item in the list.
  1098. \end{enumerate}
  1099. See also: \seetag{li}, \seetag{ul}.
  1100. % Tag paragraph
  1101. \subsection{\tag{p} : Paragraph}
  1102. \label{tag:p}
  1103. The \tag{p} tag is the paragraph tag. Every description text should be
  1104. enclosed in a \tag{p} tag. Only when there is only one paragraph (and no
  1105. lists or tables or remarks) in a description node, then the \tag{p} tag may
  1106. be skipped.
  1107. Note that if a description node contains a \tag{table}, \tag{pre}, \tag{code}
  1108. or any list tag, then the text surrounding these tags {\em must} be put
  1109. inside a \tag{p} paragraph tag. This is different from the behaviour in HTML.
  1110. The paragraph tag must always have an opening tag and a closing tag, unlike
  1111. html where only the opening tag may be present.
  1112. Example:
  1113. \begin{verbatim}
  1114. <descr>
  1115. This is a paragraph which need not be surrounded by paragraph tags.
  1116. </descr>
  1117. \end{verbatim}
  1118. \begin{verbatim}
  1119. <descr>
  1120. <p>
  1121. This is the first paragraph.
  1122. </p>
  1123. <p>
  1124. This is the second paragraph.
  1125. </p>
  1126. </descr>
  1127. \end{verbatim}
  1128. See also: \seetag{table}, \seetag{dl}, \seetag{remark},\seetag{code},
  1129. \seetag{ol},\seetag{ul},\seetag{ol}
  1130. % Tag package
  1131. \subsection{\tag{package} : Package reference}
  1132. \label{tag:package}
  1133. The \tag{package} tag indicates the package for which the description file
  1134. contains documentation. A package is a collection of units which are
  1135. logically grouped together (for a library, program, component suites). The
  1136. \attr{name} attribute of the \tag{package} tag will be used to select the
  1137. package node in the description file: Only the \tag{package} node with name as
  1138. specified by the \var{package} command-line option will be used when
  1139. generating documentation. All other package nodes will be ignored.
  1140. The \tag{package} node must always reside in a \tag{fpdoc-description} node.
  1141. It can contain a \tag{descr} node, and various \tag{module} nodes, one node
  1142. per unit in the package.
  1143. See also: \seetag{fpdocdescription}, \seetag{module}, \seetag{descr}
  1144. % Tag pre
  1145. \subsection{\tag{pre} : Insert text as-is}
  1146. \label{tag:pre}
  1147. The \tag{pre} tag can be used to insert arbitrary text in the documentation.
  1148. The text will not be formatted in any way, and will be displayed as it is
  1149. encountered in the description node. It is functionally equivalent to the
  1150. \tag{pre} tag in HTML.
  1151. Note that if there is text surrounding the \tag{pre} tag, it should be placed
  1152. inside a \tag{p} paragraph tag.
  1153. Example:
  1154. \begin{verbatim}
  1155. <pre>
  1156. This is some text.
  1157. This is some more text
  1158. And yet more text...
  1159. </pre>
  1160. \end{verbatim}
  1161. This will be typeset as:
  1162. \begin{verbatim}
  1163. This is some text.
  1164. This is some more text
  1165. And yet more text...
  1166. \end{verbatim}
  1167. See also: \seetag{code}, \seetag{p}
  1168. % Tag remark
  1169. \subsection{\tag{remark} : format as remark}
  1170. \label{tag:remark}
  1171. A \tag{remark} tag can be used to make a paragraph stand out. The
  1172. \tag{remark} is equivalent to the \tag{p} tag, but it's contents is
  1173. formatted in a way that makes it stand out from the rest of the text.
  1174. Note that any text before or after the \tag{remark} tag must be enclosed in
  1175. paragraph (\tag{p}) tags.
  1176. Example:
  1177. \begin{verbatim}
  1178. <p>Normal text.</p>
  1179. <remark>
  1180. This text will stand out.
  1181. <example>
  1182. <p>Again normal text.</p>
  1183. \end{verbatim}
  1184. Will be formatted as
  1185. Normal text.
  1186. \begin{remark}
  1187. This text will stand out.
  1188. \end{remark}
  1189. Again normal text.
  1190. See also: \seetag{p}, \seetag{code}, \seetag{pre}
  1191. % Tag seealso
  1192. \subsection{\tag{seealso} : Cross-reference section}
  1193. \label{tag:seealso}
  1194. The \tag{seealso} section can occur inside any \tag{element} tag, and will
  1195. be used to create a list of cross-references. The contents of the
  1196. \tag{seealso} tag is a list of \tag{link} tags. No other text is allowed
  1197. inside this tag. Note that both the long and short form if the link tag may
  1198. be used.
  1199. Example:
  1200. \begin{verbatim}
  1201. <seealso>
  1202. <link id="TStrings"/>
  1203. <link id="TStringList.Create">Create</link>
  1204. </seealso>
  1205. \end{verbatim}
  1206. See also: \seetag{link}, \seetag{element}
  1207. % Tag short
  1208. \subsection{\tag{short} : Short description}
  1209. \label{tag:short}
  1210. The \var{short} description is used to give a short description of an
  1211. identifier. If possible, the description should fit on a single line of
  1212. text. The contents of this tag will be used for the following purposes:
  1213. \begin{itemize}
  1214. \item Used as the synopsis on a page that describes an identifier.
  1215. \item Used in overviews of constants, types, variables, record fields,
  1216. functions and procedures, classes, and for method and property listings of classes.
  1217. \item Replaces the \tag{descr} tag in an \tag{element} if no \tag{descr} tag is present.
  1218. \item In the description of an enumerated type, the enumeration values are
  1219. typeset in a table, each row containing the name of the value and the short
  1220. description.
  1221. \item In the description of a function or procedure that accepts arguments,
  1222. the arguments are followed by their short description.
  1223. \item In the declaration of a class or record, each method, field or property
  1224. is followed by the short description.
  1225. \end{itemize}
  1226. Example:
  1227. \begin{verbatim}
  1228. <element name="MyEnum.meOne">
  1229. <short>First element of MyEnum</short>
  1230. </element>
  1231. \end{verbatim}
  1232. See also: \seetag{element}, \seetag{descr}
  1233. % Tag table
  1234. \subsection{\tag{table} : Table start}
  1235. \label{tag:table}
  1236. The \var{table} tag starts a table, as in HTML. A table can contain
  1237. \tag{tr} (table row), \tag{th} (table header row) or \tag{caption} tags.
  1238. Any text surrounding the table must be enclosed in paragraph tags (\tag{p}).
  1239. Example:
  1240. \begin{verbatim}
  1241. <table>
  1242. <caption>
  1243. <var>TALignment</var> values and their meanings.
  1244. </caption>
  1245. <th><td>Value</td><td>Meaning</td></th>
  1246. <tr>
  1247. <td><var>taLeftJustify</var></td>
  1248. <td>Text is displayed aligned to the left.</td>
  1249. </tr>
  1250. <tr>
  1251. <td><var>taRightJustify</var></td>
  1252. <td>Text is displayed aligned to the right</td>
  1253. </tr>
  1254. <tr>
  1255. <td><var>taCenter</var></td>
  1256. <td>Text is displayed centred.</td>
  1257. </tr>
  1258. </table>
  1259. \end{verbatim}
  1260. Will be formatted approximately as follows:
  1261. \begin{tabularx}{\textwidth}{lX}
  1262. Value & Meaning \\ \hline
  1263. \var{taLeftJustify} & Text is displayed aligned to the left. \\
  1264. \var{taRightJustify} & Text is displayed aligned to the right \\
  1265. \var{taCenter} & Text is displayed centred.
  1266. \end{tabularx}
  1267. See also: \seetag{th}, \seetag{caption}, \seetag{tr}, \seetag{p}
  1268. % Tag td
  1269. \subsection{\tag{td} : Table cell}
  1270. \label{tag:td}
  1271. The \tag{td} tag is used to denote one cell in a table. It occurs
  1272. inside a \tag{tr} or \tag{th} tag, and can contain any text and formatting
  1273. tags.
  1274. Example:
  1275. \begin{verbatim}
  1276. <table>
  1277. <tr><td>Cell (1,1)</td><td>Cell (2,1)</td></tr>
  1278. <tr><td>Cell (1,2)</td><td>Cell (2,2)</td></tr>
  1279. </table>
  1280. \end{verbatim}
  1281. Will be formatted approximately as
  1282. \begin{tabular}{ll}
  1283. Cell (1,1) & Cell (2,1) \\
  1284. Cell (1,2) & Cell (2,2)
  1285. \end{tabular}
  1286. See also: \seetag{table}, \seetag{th}, \seetag{tr}
  1287. % Tag th
  1288. \subsection{\tag{th} : Table header}
  1289. \label{tag:th}
  1290. The \var{th} table header tag is used to denote the first row(s) of a table:
  1291. It (they) will be made up differently from the other rows in the table.
  1292. Exactly how it is made up depends on the format. In printed documentation
  1293. (latex) a line will be drawn under the row. In HTML, the font and background
  1294. may be formatted differently.
  1295. The \tag{th} tag can only occur inside a \tag{table} tag, and can contain
  1296. only \tag{td} tags.
  1297. Example:
  1298. \begin{verbatim}
  1299. <table>
  1300. <th><td>Cell (1,1)</td><td>Cell (2,1)</td></th>
  1301. <tr><td>Cell (1,2)</td><td>Cell (2,2)</td></tr>
  1302. </table>
  1303. \end{verbatim}
  1304. Will be formatted approximately as
  1305. \begin{tabular}{ll}
  1306. Cell (1,1) & Cell (2,1) \\ \hline
  1307. Cell (1,2) & Cell (2,2)
  1308. \end{tabular}
  1309. See also: \seetag{tr}, \seetag{table}
  1310. % Tag tr
  1311. \subsection{\tag{tr} : table row}
  1312. \label{tag:tr}
  1313. The \tag{tr} tag denotes a row in a table. It works the same as in HTML.
  1314. It can occur only in a \tag{table} tag, and should contain only \tag{td}
  1315. table data tags.
  1316. Example:
  1317. \begin{verbatim}
  1318. <table>
  1319. <tr><td>Cell (1,1)</td><td>Cell (2,1)</td></tr>
  1320. <tr><td>Cell (1,2)</td><td>Cell (2,2)</td></tr>
  1321. </table>
  1322. \end{verbatim}
  1323. Will be formatted approximately as
  1324. \begin{tabular}{ll}
  1325. Cell (1,1) & Cell (2,1) \\
  1326. Cell (1,2) & Cell (2,2)
  1327. \end{tabular}
  1328. See also: \seetag{table}, \seetag{th}, \seetag{td}
  1329. % Tag u
  1330. \subsection{\tag{u} : Format underlined}
  1331. \label{tag:u}
  1332. Example:
  1333. \begin{verbatim}
  1334. Normal text <u>underlined text</u> normal text.
  1335. \end{verbatim}
  1336. will be formatted as:\\
  1337. Normal text \underline{underlined text} normal text.
  1338. See also: \seetag{i}, \seetag{b}.
  1339. % Tag ul
  1340. \subsection{\tag{ul} : bulleted list}
  1341. \label{tag:ul}
  1342. The \var{ul} tag starts a bulleted list. This works as under HTML, with the
  1343. exception that any text surrounding the list must be enclosed in paragraph
  1344. tags (\tag{p}). The list elements should be enclosed in \tag{li} tags.
  1345. Example:
  1346. \begin{verbatim}
  1347. <p> some text before</p>
  1348. <ol>
  1349. <li>First item in the list</li>
  1350. <li>Second item in the list</li>
  1351. </ol>
  1352. \end{verbatim}
  1353. Will be typeset as:
  1354. some text before
  1355. \begin{itemize}
  1356. \item First item in the list.
  1357. \item Second item in the list.
  1358. \end{itemize}
  1359. See also: \seetag{li}, \seetag{ol}.
  1360. % Tag var
  1361. \subsection{\tag{var} : variable}
  1362. \label{tag:var}
  1363. The \tag{var} tag is used to mark a piece of text as a variable (or, more
  1364. general, as an identifier). It will be typeset differently from the
  1365. surrounding text. Exactly how this is done depends on the output format.
  1366. Example:
  1367. \begin{verbatim}
  1368. The <var>Items</var> property gives indexed access to...
  1369. \end{verbatim}
  1370. Will be typeset as
  1371. The \var{Items} property gives indexed access to...
  1372. See also: \seetag{b}, \seetag{u}, \seetag{i}, \seetag{code}
  1373. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1374. % Generated output files.
  1375. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1376. \chapter{Generated output files.}
  1377. \label{ch:outputfiles}
  1378. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1379. % HTML output
  1380. \section{HTML output}
  1381. The HTML output consists of the following files, per unit:
  1382. \begin{enumerate}
  1383. \item A general unit description with the contents of the module's
  1384. \tag{descr} tag. The \var{uses} clause is documented here as well.
  1385. All units in the \var{uses} clause together with their \tag{short}
  1386. description tags are typeset in a table.
  1387. \item A listing of all constants in the unit.
  1388. \item A listing of all types in the unit (except classes).
  1389. \item A listing of all variables in the unit.
  1390. \item A listing of all functions/procedures in the unit.
  1391. \item A listing of all classes in the unit.
  1392. \end{enumerate}
  1393. All these overviews are hyperlinked to pages which contain the documentation
  1394. of each identifier. Each page starts with the name of the identifier,
  1395. plus a synopsis (made from the \tag{short} tag's contents). After that
  1396. follows the declaration, and the description. The description is filled with
  1397. the \tag{descr} node of the identifiers \tag{element} tag.
  1398. If an \var{errors} tag was present, an 'Errors' section follows the
  1399. description. Similarly, if there is a \tag{seealso} tag, a 'See also'
  1400. section with cross-reference links is made.
  1401. For classes, the declaration contains hyperlinks to separate pages which
  1402. document all the members of the class. Each member in the declaration is
  1403. followed by the \tag{short} tag of the member's \tag{element} tag, if one
  1404. exists. As an extra, the class hierarchy is given, plus links to pop-up pages
  1405. (if JavaScript is available, otherwise they are normal links) which contain
  1406. alphabetical or hierarchical listings of the methods, fields or properties
  1407. of the class.
  1408. For functions and procedures, the declaration will be typeset in such a way
  1409. that all function arguments (if they are present) are in tabular format,
  1410. followed by the short description of the argument. If it concerns a
  1411. function, and a result element exists, the result description will be
  1412. provided in a separate section, before the actual description.
  1413. The declaration of an enumerated type will be laid out in a table, with the
  1414. enumeration value at the left, and the short description node of the value's
  1415. element.
  1416. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1417. % Latex output
  1418. \section{Latex output}
  1419. The latex output is in one big file with the name of the package as
  1420. specified on the command line. in this file, one chapter is made per
  1421. unit.
  1422. Per unit the following sections are made:
  1423. \begin{enumerate}
  1424. \item A section with all constants.
  1425. \item A section with all types.
  1426. \item A section with all variables.
  1427. \item A section with all functions and procedures.
  1428. \item A section per declared class.
  1429. \end{enumerate}
  1430. For the constants, types and variables, the declaration is given, followed
  1431. by the \tag{descr} node of the element corresponding to the identifier.
  1432. All other nodes are ignored.
  1433. For functions and procedures, a subsection is made per procedure or
  1434. function. This subsection consists of a list with the following entries:
  1435. \begin{description}
  1436. \item[Synopsis] filled with the contents of the \tag{short} tag.
  1437. \item[Declaration] Filled with the declaration of the function.
  1438. \item[Arguments] A tabular description of all arguments, if \tag{short} tags
  1439. are found for them.
  1440. \item[Description] Description of the function. Filled with the contents of
  1441. the \tag{descr} tag.
  1442. \item[Errors] Description of any error conditions. Filled with the contents
  1443. of the \tag{errors} tag.
  1444. \item[See Also] Cross-references to other functions. Filled with the
  1445. contents of the \tag{seealso} tag.
  1446. \end{description}
  1447. For classes, a subsection is made with an overview of implemented methods.
  1448. Then a subsection is presented with available properties.
  1449. Then follows a subsection per method. These are formatted as a function, with an
  1450. additional \textbf{Visibility} list element, giving the visibility of the
  1451. function.
  1452. After the methods, a list of properties is given , formatted as a method,
  1453. with an additional \var{Access} list element, specifying whether the
  1454. property is read/write or not.
  1455. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1456. % End of file
  1457. \end{document}