Skip to content
On this page

Configuration

The config property in project.yaml is an array of configuration objects. You can load configuration from another file using the use property (See File Structure). Or make your own configuration.

Properties

Most of the time, you can use config presets provided by Celer or a 3rd party. In case you want to make your own, here are the available properties:

PropertyDescription
iconsAdd icon definition. See Icons for detail
tagsAdd tag definition for use in Rich Text. See Tags for details
presetsAdd preset definition. See Presets for details
pluginsAdd plugin definition. See Plugins for details
mapDefine map properties. See Map for details
includesInclude other config objects. See Include below for details

Configurations are meant to be composed and reused with other configurations. So most properties in all configurations are combined. An exception to this is map. The compiler will give an error if multiple configurations define the map.

Example

yaml
# project.yaml
config:
- use: Pistonite/celer/presets/botw/map.yaml
- use: someone/someones-preset/awesome.yaml
- use: ./path/to/local.yaml
- icons:
    example-icon:
      use: hello/world/example.png
  tags:
    colorful:
      color: blue

# path/to/local.yaml
presets:
  HelloWorld:
    text: Hello, world!

Configuration Files

The configuration files that are loaded by use should be a YAML file that defines a mapping on the root level. For example:

yaml
# something.yaml
icons:
  foo:
    use: bar/biz/boo.png
tags:
  colorful:
    color: blue

WARNING

Note that properties in something.yaml (icons and tags) don't have a - in front because the file needs to contain a mapping, not an array at the root level.

Be careful that top-level use is not permitted. The following config file is invalid for others to include with use:

yaml
# something.yaml
use: another/file/something.yaml

If you need a config to include other configs, check out the include property below.

WARNING

CAUTION: The example above is for what is NOT supported

TIP

You can still use use in the config properties themselves, like the example above in the icons property

Include

If you are distributing config files, it may be helpful to split up the "source files" of the presets into smaller, more maintainable chunks. However, it could lead to situations where users need to use a lot of files in their config to get started.

yaml
# project.yaml
config:
- use: foo/bar/core.yaml
- use: foo/bar/basic.yaml
- use: foo/bar/items.yaml
- use: foo/bar/enenmies.yaml 

# ^ that's a lot of `use`s!

This is when the includes property can be helpful. It defines an array of config objects that can nest inside the parent config:

yaml
# project.yaml
config:
- use: foo/bar/all.yaml

# foo/bar/all.yaml
includes:
- use: ./core.yaml
- use: ./basic.yaml
- use: ./items.yaml
- use: ./enenmies.yaml

In the example above, all.yaml is a config file that includes the content of all the individual config chunks. When distributing these configs, users can simply include all.yaml and not worry about the internals.