Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

RainDoc syntax

Sceleri edited this page Apr 24, 2021 · 11 revisions

Categories

;@Type | Property Value | Property Value

Categories will include all variables until the next category.

Category types : Default, About, Topic

Category properties : Name, Description, Icon

Variables

;?Type | Property Value | Property Value

Variables will use the next uncommented line as their key and value.

Variable types : String, Integer, Color, Toggle, Info

Variable properties : Name, Description, Icon, Link

Properties

Properties are defined with pipe syntax eg. ;?String | Name <name> | Description <long description> | Property Value | Property Value

Property values can contain spaces.

Any string after | until the next space is parsed as a property key. This is useful for creating your own Templates (will write a guide on this later)

General properties

Name

|Name <value>|

Name is used for variable titles, category titles and the category list.

Description

Description is the subtitle, below the title.

|Description <value>|

Icon

|Icon [\x<hex>]|

Settings uses the Segoe MDL 2 Assets font for Icons. You can change this from the internal settings (to Font Awesome for example, but then you'll have to include Font Awesome in your skin).

Refer to Microsoft's documentation for a complete list of the hex codes and Icons you can use.

You must include the opening [\x and closing ] as shown in the syntax. Icon [\xE790] is valid, Icon E790 is not valid.

Category properties

All general properties apply.

Variable properties

All general properties apply.

Link

| Link <0 or 1 or unset>|

MouseOverActions on any type of variable:

  • If Link is not set, the variable will be bolded and change colour to s_ActiveColor
  • If Link is set to 0, all MouseOverActions are disabled.
  • If Link is set to 1, the variable will be underlined and change colour to s_ActiveColor

LeftMouseUpActions on Info variables:

  • If Link is not set, the LeftMouseUpAction will be disabled
  • If Link is set to 0, the LeftMouseUpAction will be disabled.
  • If Link is set to 1, the LeftMouseUpAction will not be disabled

eg:

;This generates a string variable with a value that doesn't appear as selected when hovered over.
;(but is able to be clicked)
;?String| Name Font face | Link 0
FontFace=Segoe UI

;This generates an info variable with a value of "read on GitHub" and opens the wiki link when clicked.
;?Info | Name Settings wiki | Link 1
read on Github=https://github.com/sceleri/settings/wiki

Types

;@Type or ;?Type

Category types

If a category type is not declared or is invalid, eg. ;@ | or ;@Aboot | Settings will automatically use Default.

Default

;@Default

Default categories are clickable in the category list.

About

;@About

The list item for About categories is large, bold and clickable.

About categories are usually used as the first category, with Info variables to provide information about the host skin.

Topic

;@Topic

The list item for Topic categories is small and not clickable.

Topic categories are usually used as dividers in the category list.

Variable types

If a variable type is not declared or is invalid, eg. ;? | or ;@Strong | Settings will automatically use String.

String

;?String or ;?

String variables are displayed using a String meter and controlled with InputText.

Integer

;?Integer

Integer variables are displayed using a String meter and controlled with InputText.

Integer variables have InputNumber set to 1 which will make the InputText measure only accept numbers.

Notice:

  • This doesn't stop the user from typing a . decimal point.
  • This does stop the user from typing a - negative sign.
  • Yes this does make the Type name of Integer very unclear.

Color

;?Color

Color variables are displayed using a Shape meter and controlled with RainRGB

Notice:

  • RainRGB will keep the current Alpha value of your color. I'm looking into better options.

Toggle

;?Toggle

Color variables are displayed using a Shape meter and controlled with the same Shape meter.

Toggle variables rely on the value being 0 or 1 and Toggle variables can only change the value to 0 or 1.

Notice:

Sometimes your variable is called something like "Enable WebParser" but it will control, for example a Disabled option. This leads to conflict when the variable value is 1, the measure is Disabled=1 (aka OFF) and the Toggle meter displaying the ON state.

To get around this, add another variable, let Settings control that one and use it inverted in your original variables value. Settings will not parse a meter for the original variable and you don't have to change your code. This works because settings only uses the first Key=Value pair under the variable declaration.

Example:

;?Toggle | Name Enable WebParser 
s_DisableWebParser=1
EnableWebParser=(#s_DisableWebParser# - 1)

Info

;?Info

Info variables are special, they do not generate a way to control their value.

Instead, info variables create a string meter that displays the variable key and runs the value on click. This works surprisingly well since Rainmeter doesn't consider whitespace, nor \,/,? or any other character as invalid in variable keys.

Example:

;?Info | Name GitHub | Link 1
Settings on GitHub=https://github.com/sceleri/settings

See Link to control how your Info variables appear.

Syntax caveats

You can use normal comments (lines that begin with ;). Just avoid using ;@ and ;? in the comment.

You can use both @ and ? anywhere in the variable file, in comments, properties, variable keys and even in variable values. Just don't use ;@ or ;? in the comment, property or value.

If a variable file has variables before the first category declaration, those variables are ignored. This could be called a feature.

If a declared variable has undeclared variables under it, those variables are ignored. This could be called a feature.

If the variable file doesn't contain a category declaration, Settings will not generate a skin. Or it will but it'll just be a rectangle. Can't remember which.