Skip to main content
Internal notes
TitleWorking with variables
Statusdraft ✏
Reader Goalgoal
Preview Link... with-variables

Working with variables

Backgorund

We will support white-labeling for selected manufacturers. They might want to use their product name instead of ours. Good document design would make sure that the docs is not tied to a specific product if possible. But where it is tied to a specific product, we can use variable substitution to support white-labeling.

Here's how you do it

  • Syntax: VAR::COMPANY (without backticks)
  • Example: VAR::COMPANY <-- look at page source to understand this example

COMPANY has to be added in /DOCS-CONSTANTS.js like so:

const DOCS_CONSTANTS = {
COMPANY: 'ACME Inc.',
ANOTHER_VARIABLE: 'some kind of label'
}

module.exports = DOCS_CONSTANTS;

With this, you can write VAR::COMPANY and VAR::ANOTHER_VARIABLE anywhere in the docs. It is replaced with whatever is set in /DOCS-CONSTANTS.js

If unclear whether something should be a variable or not, talk to the head writer.