Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
239 stars 39 forks source link

Alphabetize all format contributions by format site #1450

Closed trevorbaca closed 2 years ago

trevorbaca commented 2 years ago

Here is what it looks like to alphabetize tags:

staff = abjad.Staff("c'4 d' e' f'")
markup = abjad.Markup(r"\markup Allegro")
tag = abjad.Tag("RED:BLUE:GREEN")
abjad.attach(markup, staff[0], tag=tag)
string = abjad.lilypond(staff, tags=True)

OLD. Tags preserve order of contents:

>>> print(string)
\new Staff
{
    c'4
    %! RED
    %! GREEN
    %! BLUE
    - \markup Allegro
    d'4
    e'4
    f'4
}

NEW. Tags alphabetize order of contents:

>>> print(string)
\new Staff
{
    c'4
    %! BLUE
    %! GREEN
    %! RED
    - \markup Allegro
    d'4
    e'4
    f'4
}

Alphabetized output helps standardize LilyPond output and make it possible to check LilyPond output visually.