-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Conditional directives
All directives can be equipped with a selector by appending a selector name to the name of the directive, separated by a dash (hyphen) -. If the selector fails, the directive is skipped.
For example:
{define-ukulele Dm base-fret 1 frets 2 2 1 0}
{define-guitar Dm base-fret 1 frets x 0 3 2 3 1}
This will define the appropriate Dm chord for either ukulele or guitar.
Selection can be reversed by appending a ! to the selector.
How selectors are defined depends on the ChordPro processing tool. The ChordPro program uses the config values for instrument.type and user.name.
See https://www.chordpro.org/chordpro/chordpro-directives/#conditional-directives
- parse selector on
Tag - store selector on
LineandParagraph - allow testing the condition
- allow
!for reversing the selector - render sections conditionally based on selector
- set metadata conditionally based on selector
- return chord definitions conditionally
Reactions are currently unavailable
Metadata
Metadata
Assignees
Projects
Status
Backlog