TSTool / Command / WriteTableToMarkdown
Overview
The WriteTableToMarkdown command writes a table to a Markdown format file. See:
It can be used to provide tabular data for documentation. It is also useful to write tables to Markdown text files for automated tests.
The default is to use | as the column separator without any column justification specified.
Command Editor
The command is available in the following TSTool menu:
- Commands(Table) / Output Table
The following dialog is used to edit the command and illustrates the command syntax.
WriteTableToMarkdown Command Editor for Table Parameters (see full-size image)
WriteTableToMarkdown Command Editor for Formatting Parameters (see full-size image)
WriteTableToMarkdown Command Editor for Inserts Parameters (see full-size image)
WriteTableToMarkdown Command Editor for Output File Parameters (see full-size image)
Command Syntax
The command syntax is as follows:
WriteTableToMarkdown(Parameter="Value",...)
Command Parameters
| Tab | Parameter | Description | Default |
|---|---|---|---|
| Table to Write | TableIDrequired |
Identifier for the table to write. Can be specified using ${Property} syntax. |
None – must be specified. |
IncludeColumns |
The names of columns to write, separated by commas. | Write all of the columns. | |
ExcludeColumns |
The names of columns to not write, separated by commas. | Write all of the included columns. | |
| Formatting | LinkColumns |
Indicate columns that are links and specify the corresponding column containing the link text, using the format: LinkColumn1:LinkTextColumn1,LinkColumn2:LinkTextColumn2,... |
Links are automatically detected and the link text is the same as the link URI. |
NewlineReplacement |
The string to replace newlines in string values, necessary to prevent unexpected line breaks in output rows. In order to handle newlines from various systems, the following patterns are replaced in sequence:
Use <br> to replace newlines with the HTML line break element, which will typically pass through viewing software to display a line break within a table cell. The following special parameter values are recognized:
|
Space. | |
NaNValue |
The value to write for NaN data values. Specify the word Blank to write a blank (empty string). |
NaN |
|
| Inserts | PrependText |
Text to prepend to the output file before the table. Line breaks can be inserted using the Return key. Can be specified using ${Property} syntax. |
|
PrependFile |
Path to a file containing text to prepend to the output file before the table. Can be specified using ${Property} syntax. |
||
AppendText |
Text to append to the output file after the table. Line breaks can be inserted using the Return key. Can be specified using ${Property} syntax. |
||
AppendFile |
Path to a file containing text to append to the output file after the table. Can be specified using ${Property} syntax. |
||
| Output File | OutputFilerequired |
The name of the file to write, as an absolute path or relative to the command file location. Can be specified using processor ${Property}. |
None – must be specified. |
Append |
Whether to append to an existing file (True) or write a new file (False). |
False |
|
WriteHeaderComments |
Indicates whether to write the file header comments, True or False. File header comments include information about the creator of the file. Comments are written as HTML <!-- --> comment, which typically passes through software that converts Markdown to HTML for viewing. The comments are therefore included in the markdown file for information but are not visible but are not visible in a markdown viewer. |
False |
Examples
See the automated tests.
Troubleshooting
See the main TSTool Troubleshooting documentation.
See Also
WriteTableToDelimitedFilecommand