The ScreenSteps HTML template system provides a way to export content into a variety of custom formats. The primary use for HTML templates is to create HTML content, but templates can be customized to create any type of content that is text-based. For example, you might create a custom template to export to XML, Markdown, MediaWiki or other formats.
What language does an HTML template use?
ScreenSteps uses the PHP engine to process the template files. ScreenSteps converts manuals and articles into PHP objects that can be accessed from within template scripts.
What does an HTML template folder look like?
An HTML template is a folder which contains the necessary template files. A template folder is comprised of the following items:
- config.xml: The configuration file provides instructions about how ScreenSteps should prepare your content prior to passing it off to the PHP engine.
- ./Content folder: The Content folder contains all of the files necessary to export a template. At a minimum it will contain an article and manual folder. If you have supporting PHP files that are used in your HTML template then you would place them in the Content folder.
- ./Content/article folder: The article folder contains all of the files that will be exported when exporting an article.
- ./Content/manual folder: The manual folder contains all of the files that will be exported when exporting a manual.
The config.xml file can set any of the following properties:
- web_safe: true or false.
- text_format: xhtml or runs. xhtml is appropriate for creating HTML content and you won't need to do anything to the text that ScreenSteps puts into the PHP objects. runs formats text in an array that separates the actual text from the formatting applied to the text. This allows you to more easily massage the text into other formats (e.g. markdown).
- word_separator: character used to separate words in names.
- image_names: format used to name images. random or step_title. random can be useful if you need to ensure that you never end up with duplicate image names when importing into a 3rd party system.
max_image_dimensions: The maximum image dimensions to use for width and height. Entries are a comma delimited list of integers. You can provide just the width, width and height, or just height. Examples:
The default config.xml file contains the following XML:
<?xml version="1.0" encoding="utf-8" ?> <properties version="1"> <web_safe>true</web_safe> <text_format>xhtml</text_format> <word_separator>-</word_separator> </properties>
Here is an example using image_names and max_image_dimensions.
<?xml version="1.0" encoding="utf-8" ?> <properties version="1"> <web_safe>true</web_safe> <text_format>runs</text_format> <word_separator>-</word_separator> <image_names>random</image_names> <max_image_dimensions>600,</max_image_dimensions> </properties>
The article folder
The article folder is where you put all of the files that will be exported when exporting an article. There are two files that are required:
- @article: This is the template file that ScreenSteps will process with PHP. The filename must start with @article. The extension you add is up to you.
- @images: This is a placeholder file. ScreenSteps will store all article images in the same location as this file.
Any other files and folders in the article folder will be copied into the folder the article is being exported to.
The manual folder
The manual is like the article folder but is used when exporting manuals. The files to include in a manual template are as follows:
- @tofc: ScreenSteps will process this file with PHP and it will become the table of contents for the exported content.
- @article: This is the template file that ScreenSteps will process with PHP for each article in the manual. The filename must start with @article. The extension you add is up to you.
- @images: This is a placeholder file. ScreenSteps will store all images in the same location as this file.
- @article: This is a placeholder folder and it is optional. If present and it contains the @images file then ScreenSteps will organize all images by article.
Any other files and folders in the manual folder will be copied into the folder the manual is being exported to.