(** The special backend in the Fox compiler suite serves as a documentation generator to produce documents from Oberon source files. #author# Felix Friedrich #purpose# Documentation Generator *) MODULE FoxDocumentationBackend; (** @concept = Documentation Backend The [[FoxDocumentationBackend|documentation backend]] is mainly a tool to merge different informations, namely: # The information from the symbol and module scope structure # The information provided by documenting comments Documentation comments that immediately precede a symbol or that are directly in the same line as a symbol are associated with this symbol. Therefore the documentation contained within the respective comment is on the same level as the description of the symbol itself and will be displayed together with the information about the symbol. The following describes how a documentation is generated from a module: * Association to symbols and preprocessing ## A comment that follows a symbol X and stands in the same line as X is associated with this symbol X. ## Comments that follow the MODULE (or CELLNET) specification are treated separately to describe the module. ## Any other comment that stand in front of some symbol Y is associated with this symbol Y. ## Consecutive comments are always merged as character arrays mefore being parsed by the comment parser. * Module documentation ## Each comment (or sequence of consecutive comments) is parsed by the comment parser into a separate document ## During processing of a module, each symbol is described in a separate symbol section. The module itself is described in the module summary section. ## Each comment document is merged with the respective symbol section in the overal module document. * Module documentation merging ## When more than one modules are processed into one documentation file, the module documentats are merged into one global document. ## The header of the document contains a linked list of all involved modules. == Formatting elements === Paragraphs and line breaks Text is written in paragraphs. Paragraphs are separated by a blank line. Lines that are not separated by a blank line are considered as contiguous text (such as in LaTex) Explicit line breaks can be inserted using two backslashes: {{{ This is a line \\ that is broken }}} This is a line \\ that is broken === Text Styles Text can be written boldface, underlined or in italics. Left and right delimiters of such emphasized text may not be separated from the text by a whitespace. |=Name |= Code Example |= Translation | | Boldface | {{{ *example text*}}} | *Boldface Text* | | Underline | {{{ _example text_}}} | _Underline Text_ | | Italics | {{{ /example text/ }}} | /Italics Text/ | === bullets and lists Bulleted or numbered lists start with an asterisk or number sign, respectively. Description start with a text that is embraced by number signs. {{{ * bullet 1 ** sub bullet1 ** sub bullet2 * bullet 2 # number 1 ## sub number 1 ## sub number 2 # number 2 #description label# description text #description label2# description text2 }}} Result * bullet 1 ** sub bullet1 ** sub bullet2 * bullet 2 # number 1 ## sub number 1 ## sub number 2 # number 2 #description label# description text #description label2# description text2 === Labels and links A label in the text is denoted as follows {{{ <> }}} <> A link in the text is denoted as {{{ [[labelName]] }}} or, if an alternative text should be displayed, it can be written as {{{ [[labelName|alternative text]] }}} === Document Structure Documents consist of sections. A section is started with a sequence of {{{@}}} letter as the first characters on a separate line. Examples: {{{ @ title of a section of level 1 }}} {{{ @@ title of a section of level 2 }}} If the first text element of the title is a label, then this lable is attributed to the section. {{{ @ <