Variables
Variables are named entities with a defined value that you can use across your documentation. Use them for things that must be consistent, such as the product or company name, version number, contact information.
Global variables
Declare global variables in the v.list file, for example:
This variable will be available in all topics of the module with the v.list file.
Local variables
Declare a local variable in a topic or any specific element. It will exist only within this element. You can also override the value of a global variable if it should be different in some specific scope.
Built-in variables
Writerside includes several built-in variables:
Variable interpolation
To escape a %var%
variable and insert it literally, add a backslash after the first percent character: %\var%
. Alternatively, you can use the HTML entity code instead of the percent character: %var%
.
Some code blocks and URLs may have percent characters that should be used literally. However, by default Writerside tries to interpolate them as variables. To avoid this, add ignore-vars="true"
to code blocks, external links, and image references:
You can also change the default behavior using the <smart-ignore-vars> element in writerside.cfg.
Variables in snippets
If you use a variable in a <snippet>
, set its value as a child of the <include>
element.
Here is how to include this snippet with the default value of OK
:
Here is how you can include it with a different variable value:
Conditional variables
You can add filters to set different values for the same variable based on instance.
When you add this %product%
variable in reusable content throughout your documentation, it will resolve to MyWebApp
for the web
instance and to MyMobApp
for the mob
.