Special tags
In this chapter, you can find information about:
Index of special tags
Here are the special tags in Cod2Doc (all tags are
case insensitive):
Adding more description
There is a lot of special tags which accept only one line of description by default.
To add more line of description to these tags, you should add the ;+ tag
just
below the tag you want to describe. Description of variables (constant, global, array, field)
as well as variable and return value description in the function description may use the
;+ tag.
The ;;+ tag has the same functionality, but it has the particularity to
continue the previous line
(no carriage return).
The following tags accept the ;+ or ;+ tag: ;author, ;bug, ;cell, ;creation, ;group, ;lastUpdate,
;project, ;table, ;toDo, ;version.
Example:
Global variable1
|
Project tags
Project tags are here to document your code in a standardized way.
They can be inserted in the
header of the code,
in the
inline documentation, in the
Type or
Function description.
The following tags are available:
- ;author
- ;bug
- ;creation
- ;lastUpdate
- ;project
- ;toDo
- ;version
The description of project tags can be extended using the
;+ tag.
The text resulting of the tag can be changed with the modification of the language file (see
here).
Result:
|
Author:
Description of the author
|
Bugs:
Description of the bug
|
Creation:
Date of creation
|
Last update:
Date of last update
|
Project:
Description of the project
|
To do:
Description of the to-do list
|
Version:
Description of the version
|
|
Code tags
The code tags are very useful when you want to show some Blitz Basic code in your
documentation (or even other types of code). The code will be
highlighted as it is in your usual IDE (unless you
specify the option
Do not highlight code in
the graphical interface).
Notice that the code tags could be used in the function or type description as well as in
the
inline documentation.
The ;example tag:
If you insert these tags into a description, all the code located between
the ;example and ;/example tags will turn into code. The "Example:" text turns to a
link
to a Blitz Basic file containing the code.
If no file name is specified after
the ;example tag, then the code will be saved in a file with the same name of the function
it is located (if it's inside a function description).
If a file name is specified, then the code will be saved in this file. The files are saved
in the subdirectory
files\ of the documentation directory (Cod2Doc\ by default). You can precise
a relative path in the fileName.
Warning: if a file with the same name exists, it will be erased!
If you don't want to save this piece of code, simply write ";example -" or ";example !" (only
useful inside a function description).
For
alignment reasons, in the code region, you have to let always one space after the first ";"!
Notice also that having some html tags in you code can cause big problems. Try to avoid this
situation!
Example:
|
Example:
Function FunctionExampleCode()
End Function
|
This gives the result:
FunctionExampleCode() |
Description:
Type the ;example tag inside the description of the function
|
Return value:
None
|
Example:
For i = 1 To 10
FunctionExampleCode()
Next
|
|
The ;code tag:
This tag is quite similar to the previous one, and actually
extends the ;example tags. The
only difference is that you can specify the string that you want to write for the code
description (instead of "Example:" for the ;example tag).
To precise the description string, you just put this string into [] after the ;code tag (without
space). For example ";code[A wonderful piece of code:]". If no [] are used, then the default string
is "Code:". If you don't want to have a description string at all, just put ";code[]".
See the
;example tag for other details as everything is similar otherwise.
Tags to import code from a file:
These tags are used to
import code from a given file. The file will be
cut and past and put
at the place of the tag. If the file is a Blitz Basic file, then the code will be
highlighted.
For the ;importExample tag, the description string will be "Example:". For ;importCode, it will
be "Code:" unless you specify into brackets the description string. If no description string is
precise between the [], then there will be no description string at all.
Example:
|
This gives the result:
|
Groups
Structure:
Some keywords...
|
Sometimes it is useful to group your variables or your functions together in the documentation
(for variables related to the
same functionality for example).
The behaviour of the group depends on the
layout set in the main window:
- in the "Same order as the source file" mode, all variables, types and functions encapsulated between the ;group and
;/group tags will be grouped together
- in the "Sorted by category" mode, only keyword of the same type will be encapsulated together. The ;group tag
refers to the keyword directly below this tag. The group is closed when Cod2Doc meets a ;/group
tag or another ;group tag
- in the "Alphabetically sorted by category" mode, no groups are allowed.
Warning: groups can not contain another group!
Warning: the ;group tag shouldn't be placed inside description of type or function!
Groups can also be created in the
inline documentation (the above rules do
not apply). Groups in the main program and in the inline documentation are
independent and could
be inserted in each other.
You can also add a description of the group (and more description with the
;+ tag)
by adding a text after the ;group tag.
Example:
Const constant1 = 1
Const constant2 = 2
Const constant3 = 3
Global global1
Global global2
|
Defining the end of the header
This tag could be useful in some occasion to mark the end of the header of the file. The only
use of this tag is when you use an
inline documentation and you want
to differentiate the inline documentation contained in the header and the one related to the
first variable.
Veto
There is
several ways to put a veto to avoid documentation.
Veto for a line of comment:
These tags may be used to avoid inserting a commented line in your documentation (technical
comments for example).
Of course, there is no need to veto comments in the program which are not taken
into account by Cod2Doc!
Veto for code (variables, functions, ...)
Structure:
Global myVar
Function myFunc
End Function
Type myType
Field field1
Field field2
End Type
|
Sometimes, you don't want that some variables/functions (technical ones for example)
appear in the documentation. To do that, simply add the tag
;!! anywhere on the line
you don't want to document. Adding this tag on the line of the declaration of a function or of a
type will of course prevent the whole function/type to appear in the documentation. This tag
could be used for variables, arrays, types, fields, functions, ...
Veto for a group of line of code:
Structure:
Global myVar
Function myFunc
End Function
|
Simply add a
;noDocumentation tag ended by the
;/noDocumentation tag. Any code/comments inbetween
these two tags won't be documented.
Veto for a single word:
If you don't want that a word turn into automatic link, or automatic inserted image,
then a ! has to be placed in front of the word (
See also: automatic links).
"See also:" tag
The ;see tag may be inserted in every description comments. It will simply be replaced
by the "See also:" string (with a specific style defined in the
style file).
This tag may be located at the first position in the comment or
anywhere in this comment.
You have also the possibility to use the ;+see tag instead of
the
;+ prolongation tag. The ;;see and ;;+see tags are also supported.
Example:
|
Example:
Global myVariable%
Global myOtherVariable%
|
This gives this result:
myOtherVariable% |
Description:
Some description here. See also: myVariable%
|
|
Tags for the html header (title, keywords)
Html title:
This tag allows you to define the title of the html file. This title appears at the top of the
browser as well as in the browser history.
Html keywords:
The ;htmlKeyword allows you to define the keywords which will be put in the
header of the
html files. This permits search engines like Google or Yahoo to reference easily your page.
The keywords should be separated by the "," character. Only the file which contains this tag
will have these keywords specified. If you prefer specifying the keywords for
all your files
you document, use the
Meta keywords for html option of the
graphical interface (however, the ;htmlKeyword, if specified, would supersede this option).