Layout
Clio has two decorator classes, Title and Paragraph. They allow for a natural reading layout. The paragraphs follow web standards where they are separated by a empty line and expand to the width specified in the clio object.
Titles are very straightforward, you instantiate objects that represent different titles in your program.
$H1 = new Title($clio, "center", new Style(true,null,Color::black(),Color::teal),0,1);"); $H1->display("H1 Title");
Paragraphs are equally easy to use. Instantiate an object to reuse to draw out paragraphs, which by default work like web paragraphs, filling the width set in Clio and placing a blank space after each one.
$p = new Paragraph($clio); $p->display("A book is made from a tree. It is an assemblage of flat..."); $p->display("Across the millennia, the author is speaking, clearly and silently...");
Which looks like this:
Software Documentation
The following sections lists the software documentation for:
Title Class
Constructor
Set up the styling in the constructor and reuse for consistency throughout our program.
__construct($clio, $justification = "left", $style, $spaceBefore = 2, $spaceAfter = 1)
Parameters | ||
---|---|---|
Name | Type | Description |
$clio | Clio | The single Clio object controlling the terminal |
$justification | string | int - either a justification constant from HTML or "left", "Center"...etc | justification of the title |
$style | Style | bold, underscore and colors of the title |
$spaceBefore | int | The number of empty lines before the title (like margin-top) |
$spaceAfter | int | The number of empty lines after the title (like margin-bottom) |
display
Display the title, with an extra empty line underneath if desired.
display($text)
Parameters | ||
---|---|---|
Name | Type | Description |
$text | string | text of the paragraph |
Paragraph Class
Straightforward class to map out any paragraphs for reading. Markup can be placed in the text to trigger styling embedded in the text.
Constructor
Constructor to set up the look of the paragraph.
__construct($clio, $style = null, $spaceAfter = 1, $trim = true)
Parameters | ||
---|---|---|
Name | Type | Description |
$clio | Clio | Clio object |
$style | Style | The styling of a paragraph. |
display
Display a paragraph.
Any markup strings found in the $text will trigger the corresponding styling.
display($text)
Parameters | ||
---|---|---|
Name | Type | Description |
$text | string | text of the paragraph |