v1.1
|
|
To add a style template to Renga, you will need to build it using the RstBuilder.exe console utility included in the Style Template Developer Kit. When running RstBuilder.exe with the necessary options, the utility verifies the input files and generates an RST file that can be imported into the Categories window in Renga Professional.
To run the utility from the command line, you need to specify the startup options, a parameter and port file, and a script file in the following form:
Option | Description |
---|---|
-h , --help | Display the utility help. |
-v , --version | Display the utility version information. |
--configuration path_to_configuration_file | Specify the location of the file in JSON format. |
--executable_lua path_to_executable_lua_file | Specify the location of the Lua-script file. |
-s stdl_version , --stdlVersion stdl_version | Set the STDL version. |
-o path_to_output_file , --output path_to_output_file | Specify the location of the created category file in RST format. |
-i path_to_include_lua_file , --include path_to_include_lua_file | Specify the location of additional Lua scripts and modules. |
Examples:
When using different options with RstBuilder, various results will be obtained. To build an RST file, set in the options:
Example:
The -s stdl_version or –stdlVersion stdl_version parameter is required to set the STDL version. Defines the validation rules and STDL version for the style template. Whenever possible, use the older version of STDL to maintain forward compatibility with older versions of Renga.
Upon starting up, RstBuilder verifies input files. If the check fails, the utility will not create the resulting file and will display a message about the failed check. If the check is successful, you will receive a style template file in RST format that can be used for further testing and added to your Renga project.
If the -o file or –output file option is not specified, you will only receive the check result. For instance, if the format of the version is incorrect, the following error message will be displayed:
If you use the require
function to include third-party modules, you should add them using the -i file or –include file option. It is important to ensure that module names must be unique.
If you add modules in the script as shown below, for example:
the line to call RstBuilder to get a file in RST format looks like this:
Please note that when using the require
function in a script, the module path should not be specified, whereas for template building, specifying the path is required.
When starting RstBuilder:
When RstBuilder is complete, it returns the following values:
Please note that checking with RstBuilder does not detect errors of using the Renga Template API. To debug a style template, refer to Testing and Debugging.
To add a building integration from VS Code, include the tasks.json file in the .vscode folder of the current project.
To build a style template, run Terminal - Run Build Task (Ctrl+Shift+B).