Counter and Splits
The counter is a small block in front of a line in the document that can display text (usually counter for an objective). It is also used to set up splits for speedrunning.
Configuring a Counter
To configure the style of the counter block, define a new tag:
config:
- tags:
my-counter:
color: black
background: orangeThen, use the counter property and this tag to add a counter:
route:
- Example Section:
- Line with counter:
counter: .my-counter(woooo)
TIP
Counters can also have real functionality - automatically increment and display the count of something. Check out the Variable Plugin for how to do that.
Splitting
Counters are also used for configuring split types for speedruns. Let's turn the my-counter tag into a split type!
First, add a description for the split type in the tag definition. This will tell Celer that you want to use this tag for splitting.
config:
- tags:
my-counter:
color: black
background: orange
split-type: My Counters # <- add thisYou can see what split types are available in the document in the settings:
- Click on
Settingsin the Toolbar. - Choose the
Documentcategory. - Scroll to the
Splitssection.
Checking the My Counters checkbox will enable splitting on counters tagged with the my-counter tag.
TIP
You can give the same split-type to multiple tags. Checking the box will enable splitting on all tags with that name.
Default Split Types
The split settings allow people who are viewing your route decide themselves where they want to split. As the route maker, you can also define a set of splits that should be on by default using the splits config:
config:
- splits:
- my-counterNow, go to the split settings and click on Reset. You should see the My Counters type getting checked by default.
Export Split Files
See Export
Format Split Names
TIP
This section explains how split names are set manually with the split-name property. Most of the time, it's easier to use the split-format plugin to set this property automatically based on the split type.
By default, the split names in the exported split files are the same as the primary text of the line. You can change it with the split-name property.
route:
- Example Section:
# This split will have name "Split 1"
- Split 1:
counter: my-counter
# This split will have name "Split 2"
- Some text:
counter: my-counter
split-name: Split 2The variables plugin can be used to interpolate variables into the split name
config:
- plugins:
- use: variables
route:
- Example Section:
# This split will have name "Split 1"
- Split 1:
counter: my-counter
vars:
x: 1
# This split will have name "x is 1"
- Some text:
counter: my-counter
split-name: x is .var(x)