The -h option provides help. If it is specified without a parameter, a brief description of each option
is displayed. To display the attributes for an option, specify the option letter as a parameter.
By default, generated output goes to standard output. To direct output to a file per input file, use the
-o option to specify an extension for output files. If the -o option is specified without a parameter, an
extension of out is assumed.
Likewise, error messages go to standard error by default. Use the -l option to create a log file per
input file. If the -l option is specified without a parameter, an extension of log is assumed.
By default, generated output and log files are created in the current directory. Use the -O option to
specify an explicit output directory. If the -O option is specified without a parameter, the input
file's directory is used.
The -2 option is a convenient way of specifying the alias (collection of options) which generates the
output you want. e.g.
sdf -2html abc
is equivalent to:
sdf +sdf2html abc
The -D option is used to define variables. These are typically used for controlling conditional text and
substituting text which changes. The format used is:
-Dvariable1=value1,variable2=value2
A flag is a shorthand way of specifying variables in the DOC family. i.e. -ftoc=3 is equivalent to
-DDOC_TOC=3. The format of the -f option is:
-fflag1=value1,flag2=value2
If a variable or flag is specified without a value, 1 is assumed.
To generate HTML topics, the command is:
sdf -2topics abc
By default, this will create sub-topics for each heading already in a separate file. It will also
autosplit level 1 headings into sub-topics. The -n option can be used to control which level headings are
split at:
• 1 autosplits on level 1 headings (the default)
• 2 autosplits on level 2 headings
• 3 autosplits on level 3 headings
• 0 disables autosplitting.
Include files are searched for in the current directory, then in the directories given by the -I option,
then in the default library directory.
By default, sdf is configured to prefilter files with certain extensions. For example:
sdf mytable.tbl
is equivalent to executing sdf on a file which only contains:
!include "mytable.pl"; table
The -p option can be used to explicitly prefilter files or to override the default prefilter used. If a
parameter is not provided, the prefilter is assumed to be table.
The -a option can be used to specify parameters for the prefilter. For example:
sdf -aformat='15,75,10' mytable.tbl
The -P option prefilters the input files as programming languages. The parameter is the language to use.
If none is provided, the extension is assumed to be the language name. For example:
sdf -P myapp.c
is equivalent to executing sdf on a file which only contains:
!include "myapp.c"; example; wide; lang='c'
The -N option adds line numbers at the frequency given. The default frequency is 1. i.e. every line.
The -g option prefilters the input files by executing sdfget using the default report (default.sdg). To
change the report used, specify the report name as the parameter. If the report name doesn't include an
extension, sdg is assumed.
Note:sdfget searches for reports in the current directory, then in the stdlib directory within SDF's
library directory.
The -r option runs the nominated SDR report on each input before formatting. In other words, SDR reports
provide a mechanism for:
• analysing the SDF just before it would be formatted, and
• replacing that SDF with the output of the report (also SDF) so that the final output is a nicely
formatted report.
For example, the sdf_dir report generates a directory (tree) of the components (files) included in an SDF
document. Reports are stored in sdr files and are searched for using the usual rules.
The -L option can be used to specify a locale. The default locale name is specified in sdf.ini. Locale
naming follows POSIX conventions (i.e. language_country), so the locale name for American english is
en_us. The information for each locale is stored in the locale directory, so you'll need to have to look
in there to see what locales are available. (As the default locale can be set in sdf.ini, this isn't as
ugly as it first sounds.)
Note: At the moment, a locale file simply contains a list of language specific strings. Ultimately, it
should be extended to support localisation of date and time formats.
The -k option is used to specify a look. The default look library is specified in sdf.ini.
The -s option can be used to specify a document style. Typical values are:
• document - a technical document
• memo - a memo
• fax - a facsimile
• minutes - minutes of a meeting.
The -S option is used to specify the page size. Values supported include:
Name Width Height Comment
global 21.0cm 11.0in will fit on either A4 or letter
A3 29.7cm 42.0cm
A4 21.0cm 29.7cm
A5 14.8cm 21.0cm
B4 25.7cm 36.4cm
B5 17.6cm 25.0cm
letter 8.5in 11.0in
legal 8.5in 14.0in
tabloid 11.0in 17.0in
Additional page sizes can be configured in sdf.ini. To specify a rotated version of a named page size,
append an R. For example, A4R implies a width of 29.7cm and a height of 21cm. A custom page size can also
be specified using the format:
{{width}}x{{height}}
where width and height are the respective sizes in points.
The -c option is used to specify a configuration library.
A list of modules to use can be specified via the -u option.
The initial heading level to start on can be specified via the -H option. This is useful if you want to
preview how a topic will be displayed without regenerating the complete document. If a topic begins with
a level 1 heading (e.g. H1) and you wish to format it as a document (i.e. the level 1 text becomes the
DOC_NAME for build_title), use the -H option with a value of 0.
The look of headings can also be adjusted. By default, H-style headings are numbered, A-style headings
are lettered and P-style headings are plain. To force a particular style for all headings, the -K option
can be used. Sensible parameter values are H, A and P although other values may work depending on what
paragraph styles are configured at your site.
The -d option is used to specify the format driver. Values supported include:
• expand - format as expanded text (the default)
• mif - Maker Interchange Format
• pod - Plain Old Documentation (as used by Perl).
Additional drivers can be configured in sdf.ini.
The -y option can to used to specify a post-filter.
The -z option can be used to specify a list of post-processing actions you want to execute on each output
file after it is generated. The actions supported include:
• ps - generate PostScript
• doc - generate a Frame (binary) file
• fvo - generate a Frame View-Only file
• txt - generate a text file
• rtf - generate an RTF file
• clean - delete the output file (must be last).
Additional actions can be configured in sdf.ini. By convention, the generated files are given the same
names as the action keywords.
The -t option is used to specify the logical target format. If none is specified, the default is the
first post processing action, if any. Otherwise, the default is the format driver name.
The -v option enables verbose mode. This is useful for debugging problems related to post processing. In
particular, post processing actions containing the pattern clean are skipped in verbose mode. You can
also switch off the post processing messages by using a verbose value of -1. Values higher than 1 switch
on additional trace messages as follows:
• 2 - show how names of files and libraries are resolved
3 - show the directories searched for libraries
4 - show the directories searched for modules
5 - show the directories searched for normal files.
The -T option can be used to switch on debug tracing. The parameter is a comma-separated list of name-
value pairs where each name is a tracinggroup and each value is the level of tracing for that group. To
get the trace output provided by the -v option, one can use the user group like this:
sdf -Tuser=2 ...
This is slightly different from the -v option in that intermediate files are not implicitly kept.
Additional tracing groups will be added over time (probably one per output driver).
The -w option is used to specify the width for text-based outputs.
The -z, -D, -f and -I options are list options. i.e. multiple values can be separated by commas and/or
the options can be supplied multiple times.