Skip to main content

Sphinx lilypond extension

Project description

sphinxcontrib-lilypond license sphinxcontrib-lilypond python version

sphinxcontrib-lilypond last version

This plugin implements a lily role and directive to include Music score formatted by Lilypond.


  • 2017-xx SVG format is waiting a cropping solution

  • 2017-11 Cleanup for Python 3



Using pip:

pip install sphinxcontrib-lilypond


  • A lily role to include a standalone music markup. For example, a G clef can be inserted by:

    :lily:`\musicglyph #"clefs.G"`

    The purpose of the ‘lily’ role is writing music comments or learning notes. So only one markup is allowed.

  • A lily directive to include a score, for example:

    .. lily::
       \relative c'' {
         c4 a d c


The lilypond_fontsize variable can be used to set the font size:

lilypond_fontsize = [6, -3]
  • The first value is for lily role setting in absolute font size.

  • The second value is for lily directive setting in relative font size.

Default settings:

lilypond_preamble = ''
lilypond_fontsize = [10, -3]
lilypond_command = 'lilypond'
lilypond_args = []

Project details

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page