Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at: https://www.gnu.org/copyleft/fdl.html.
5 Formatting
5.1 Manual Formatting
5.2 GUI Formatting
Figure 5.1-1 Table 1
Figure 5.2-2 GUI Menu
In reading this document, Familiarity with the STF Syntax Summary is assumed. (Download document PDF)
This document shows how to create a document using the STF Python API. A simple test report was chosen for the example:
The document is created
The document structure is defined
A table of results is generated
The resulting document is then processed by some of the command files that come with STF to produce an HTML representation of the document, a PDF representation, and a Wiki representation.It is assumed that Python has been installed, the STF Python API has been installed and STF has been installed. See the installation section of the STF Syntax Summary for details.
from stflib import StfDoc |
This creates a file TestReport.stf in the current folder and creates a basic header for it. The top of page title is Test Report for Auto System
desc = "Test Report for Auto System\t\t\tWritten by:\t\t\tThe Auto Team" |
Note "\t" is the Python way to specify a <TAB> character and represents a blank line in a description.
The results are saved in a table stored in its own file. This external file is then included into the test report document. The reason for doing it this way is to allow the table to be included in other documents, such as a more formal test report.
... Create table in external file |
This simple program (37 lines long) generates two files: TestReport.stf and the include file: Table.sti. To generate a PDF report, you can use a command file that is included with STF: makeDoc.bat. To use makeDoc, double click 0Dos.bat(1) and enter the following in the report directory:
C:\Users\Public\Cmds\makeDoc.bat TestReport
and TestReport.pdf and TestReport.html will be produced. If directory C:\Users\Public\Cmds was added to the path, per the installation instructions, then it is only necessary to enter:
makeDoc TestReport. The Wiki formatted version is generated by entering:
makeWiki TestReport
Alternately the commands may be entered by hand. First open a Dos window by double clicking 0Dos.bat, then enter the following:
STFxlate --latex -i TestReport |
Where it is assumed that LaTeX and STFxlate have been added to the path so it is not necessary to fully qualify file names. STFxlate.bat is a command file that provides services to STFxlate.py. To see what STFxlate.bat does, edit or type C:\Users\Public\Cmds\makeDoc.bat after installation.
The resulting table looks like Table 1.

To generate the documents the easy way, double click on TestReport.stf in the report directory and a menu will display (assuming Executor was installed per the installation instructions.) The default menu is shown in Figure 5.2-2. The defaults for Executor are stored in C:\Users\'you'\.nic\Executor and may be customized after the first execution. Since there is no contents for this document, use makeDoc; otherwise use makeDocWithIndex, etc.
