4. TypeFriendly
4.2. Output interface
4.1. Command line interface
« Previous
4.3. Multilingual books
Next »

4.2. Output interface

TypeFriendly allows to create your own output interfaces that can be used to generate the documentation. Some knowledge about PHP language is required in order to write them.

Parsing rules

TypeFriendly starts with creating a project object that allows to manipulate various aspects of the documentation. Then, the configuration is read and later, TF scans the input directory and puts the chapters in the correct order. At the end, the script loads the outputs and requests to generate the pre-processed results.

Each output is saved in a separate PHP file in the /outputs directory. It is a class named after the output that extends the standardOutput class and overwrites three methods described below. The class has one task: to pack the meta-data provided by the TypeFriendly into the HTML code. Unfortunately, the current version of Markdown supports only XHTML and it is not possible to generate, for example, LaTeX output. This feature will appear in the future versions of TypeFriendly.

The output system must take care of saving the result to the files. TypeFriendly provides only a directory path, where the result must be stored, but does not limit you in any other way. The programmer may use some of script interfaces.

API

standardOutput

An abstract class that must be extended by the output class. The methods:

Additional tags in the meta-data defined by TypeFriendly:

tfTranslate

It is used to translate the documentation messages to other languages.

tfProject

The project object.

tfFilesystem

This class represents the file system inside a directory. It allows fast and easy file/directory manipulation. We assume that filesystem means the directory mapped by an object of this class, where we can do the manipulations.

4.2. Output interface
4. TypeFriendly
« Previous
4.1. Command line interface
Next »
4.3. Multilingual books