Customizing ROBODoc ROBODoc can be configured with a configuration file called
robodoc.rc. With it you can define item
names, frequently used options, and translations for English
terms. One should note that if a configuration file is specified,
its definitions over-ride ROBODoc internal (i.e. built-in) settings.
This is a feature; some arbitrary language may include syntax
which conflicts with ROBODoc's internal markers. By taking advantage
of a configuration file, these sort of issues and conflicts
can be circumvented. An example is shown below.
# Example robodoc.rc
#
items:
NAME
FUNCTION
SYNOPSIS
INPUTS
OUTPUTS
SIDE EFFECTS
HISTORY
BUGS
EXAMPLE
ignore items:
HISTORY
BUGS
item order:
FUNCTION
SYNOPSIS
INPUTS
OUTPUTS
source items:
SYNOPSIS
preformatted items:
INPUTS
OUTPUTS
format items:
FUNCTION
SIDE EFFECTS
options:
--src ./source
--doc ./doc
--html
--multidoc
--index
--tabsize 8
headertypes:
J "Projects" robo_projects 2
F "Files" robo_files 1
e "Makefile Entries" robo_mk_entries
x "System Tests" robo_syst_tests
q Queries robo_queries
ignore files:
README
CVS
*.bak
*~
"a test_*"
accept files:
*.c
*.h
*.pl
header markers:
/****
#****
remark markers:
*
#
end markers:
****
#****
header separate characters:
,
header ignore characters:
[
remark begin markers:
/*
remark end markers:
*/
source line comments:
//
keywords:
if
do
while
for
The configuration file consists of a number of blocks.
Each block starts with a name followed by a
:.
In each block you define a number of values. Each value must
start with at least one space.
items blockIn this block you can define the names of items that
ROBODoc should recognize. Item names can consist of more than
one word but should be written in all uppercase characters.
Define one item name per line. You do not need to put quotes
around them if they contain spaces.
If you do not define an items block ROBODoc uses its
default list of item names. If you define an items block
ROBODoc uses only those item names, any of the default items names
(except SOURCE) are no longer recognized.ignore items blockIn this block you can define the names of items that
ROBODoc should ignore when generating documentation.
This can be useful if you want to create documentation
for a client, but for instance do not want to include
the history items and bugs items.item order blockIn this block you can define the order in which items
are to appear in the generated documentation.
The items listed here will appear in the given order in the
generated documentation. Any remaining items appear
after these items in the order they were found in the header.
This allows you to make the documentation look more uniform.
source items blockIn this block you can define the names of items that
ROBODoc handles in the same way as the SOURCE item.
preformatted items block
In this block you can define the names of items that should be always
preformatted. This is useful if you have the
option
specified and want specific items (like input and output lists) to be
automatically preformatted. See
for more
information.
format items block
In this block you can define the names of items that should be formatted by
the feature
(like function descriptions) even if the
option has not been specified.
options blockIn this block you can define frequently used options.
The options you specify here are added to any options you
specify on the command line.
See .
headertypes blockIn this block you can define your own header types.
These are added to the existing header types. Each new
header type requires three parameters: the character used to
indicate a header of this type, the title for this type as
used in the master index and the name of the file in which the
index of this type is stored. If you use a character of an
existing header type, this header type is overwritten.
Additionally the sorting priority can also be specified for each header
type. Headers with higher priority will appear earlier in the
generated output. (For example you can make module definitions appear
at the beginning of a page.) If this parameter is omitted, the header
will have the priority 0 (lowest) by default. All pre-defined header
types have zero priority, except
"",
which has the sorting priority 1.
See .
ignore files blockIn this block you can define the names of files or
directories that ROBODoc should ignore while scanning
the directory tree for source files. You can use the
wildcard symbols * and
?. If you use spaces in the expression
enclose the expression in quotes.
For instance, the rc file above causes ROBODoc
to skip all README files, all files with
the name CVS (these are usually
directories). It also skips all files with a name that ends
with .bak or ~ or
that start with a test_Normally you specify the names of directories here
and do the filtering of file names with a accept files block.
accept files blockIn this block you can define the names of files that
robodoc should accept. This test is carried out after the
'ignore files' filtering is performed. Any files that do
not match the patterns in this block are ignored by ROBODoc.
If there is no accept files block all files are accepted.
header markers block
In this block you define what ROBODoc will recognize
as start of a header. If you use this block ROBODoc only
recognizes these markers, any of the inbuilt markers will
be ignored.
remark markers block
In this block you define what ROBODoc will recognize
as start of remark. If you use this block ROBODoc only
recognizes these markers, any of the inbuilt markers will
be ignored.
end markers block
In this block you define what ROBODoc will recognize
as end of a header. If you use this block ROBODoc only
recognizes these markers, any of the inbuilt markers will
be ignored.
header separate characters block
In this block you can specify the separation character(s) for multiple
header names. The default character is "," (comma) if
this block is missing. See
for more information.
header ignore characters block
In this block you can specify character(s) where the evaluation of a header
should stop. The default character is "[" if this block
is missing. This is useful to supply additional information to the header
that ROBODoc should not care about.
For example one can include the version number of the function:
****f* financial.library/StealMoney [2.0]
remark begin markers and remark end markers block
Some languages allow remarks to span more than one line. They
start a remark with a begin marker and end it with another
marker. For instance in C you can have:
/* This is a
multi-line remark.
*/
Here the markers are /* and */.
If you tell ROBODoc what these markers are in a remark begin
markers block and remark end markers block. ROBODoc can skip
them in source items.We illustrate this with an example. Say we have a language
that start a remark with |* and
*|. We define SYNOPSIS
to be a source like item. If we now run ROBODoc on the
without a remark begin markers and
end markers block on the following piece of source,
|****f* Bar/foo
* FUNCTION
* foo computes the foo factor.
* SYNOPSIS
*|
int foo( float correction )
|*
* BUGS
* None
* SOURCE
*| .
{
return correction * 42.0;
}
|*****|
the extracted documentation will look like:
FUNCTION
foo computes the foo factor.
SYNOPSIS
*|
int foo( float correction )
|*
BUGS
None
SOURCE
*| .
{
return correction * 42.0;
}
because ROBODoc considers
|* and *|.to be part of the
source, and not part of the begin or end of a header. If you add
remark begin markers:
|*
remark end markers:
*|
the output will look like:
FUNCTION
foo computes the foo factor.
SYNOPSIS
int foo( float correction )
BUGS
None
SOURCE
{
return correction * 42.0;
}
These markers will also be used to highlight block comments if the
option (or the
option) is specified (Similar to
).
source line comments block
Here you can specify markers which start whole line comments.
(Comments that span until the end of line like "//",
"REM", ";", etc...)
These lines will be highlighted in the generated HTML
output if the
option (or the
option) has been specified.
You don't need this if you have the
option specified.
The default highlighting color can be changed in the CSS
file (span.comment).
keywords block
Here you can specify the keywords in your SOURCE items.
These keywords will be highlighted in the generated HTML
output if the
option (or the
option) has been specified. Keywords meant to be the language native ones
(for, if, etc...).
You don't need this if you have the
option specified.
The default highlighting color can be changed in the CSS
file (span.keyword).
Configuration file locationROBODoc searches the your current directory for the
robodoc.rc file. If it can't find
it there it will search in $HOME/, then
$HOMEDRIVE$HOMEPATH/, and finally in
/usr/share/robodoc/.With the option you can tell ROBODoc to
use a different file than robodoc.rc as
configuration file. This is handy if you want to create
documentation in different formats. For instance:
robodoc --rc htmlsingle.rc
robodoc --rc rtfsingle.rc
robodoc --rc htmlmulti.rc