Skip to main content

Ukedown package

Ukedown is a series of extensions to the standard Markdown library, version 3 and higher using the Extensions API, documented here

It is intended to simplify songsheet (and songbook) generation for ukulele (although it works well for other stringed instruments too), allowing songsheets to be written as plain text, which will be converted to HTML (via markdown) and thence to PDF.

All output styling will be done using CSS - examples of this are available (with a toolset to use ukedown) from the ukebook-md repository

Basic CSS to demonstrate is to be found in the 'css' subdir of the ukedown package itself.

This package uses Semantic Versioning

What are these extensions anyway?

The following formatting is supported by ukedown:

Titles and Artists

These are parsed from the first non-blank line in a ukedown file, and is expected to follow the format of

Down Under - Men at Work

Where the separator is a normal ASCII hyphen (any Unicode m-dash and n-dash nonsense will be converted to ASCII).

These are rendered as <h1> elements in HTML

<h1>Down Under - Men at Work</h1>

Chord Names

Chord names appear inline with lyrics and are enclosed in parentheses. These should be chord names only, with the exception that characters such as '*' are supported - we use these in places to indicate single strums or stabs.

At (Dm)first I was afraid, I was (Dm)petrified

These are rendered as <span class="chord"> elements,as follows

At<span class="chord">Am</span>
First I was afraid I was <span class="chord">Dm</span>petrified,<br/>

Section headings

Basically song section titles like "verse 1" and "chorus".

These are enclosed in square brackets, like this:

[intro]

They are rendered as <span class="section_header"> elements. Because they are inline, they can have chords and other items on the same line if required.

<span class="section_header">intro<span>

Performance notes

Things like slowly or single strums or fade out

These are enclosed in curly braces

{slowly}

and they appear in rendered documents as

<span class="notes">slowly</span>

Backing vocals

Currently these are delimited in the same fashion as chords, and are distinguished by not matching a known chord pattern.

This is likely to change (most probably to <> or ::) to simplify the rendering and to allow nesting of elements, which currently doesn't work properly (e.g. chords inside backing vox)

An example of backing vocal in context is

(you're gonna wish you, never had met me)

boxed sections

when certain sections of a song repeat, it's quite common to put them into 'boxes' - this is done using | (pipe) characters. Any line starting with (and optionally ending with) a '|' character will be rendered as a 'boxout'

Boxes can also contain section headings, as shown

| [chorus]
| But I'm a (G)creep
| I'm a (B7)weirdo
| What the hell am I doing (C)here
| I don't be(Cm)long here

which will render as

<div class="box">
  <p><span class="section_header">chorus</span><br/>
  But I'm a <span class="chord">G</span>creep<br/>
  I'm a <span class="chord">B7</span>weirdo<br/>
  What the hell am I doing <span class="chord">C</span>here<br/>
  I don't be<span class="chord">Cm</span>long here</p>
  </div>

current limitations

  • repeated boxes (i.e. 2 boxed sections in a row, which occasionally happens) must have a blank line between them, or they get merged into one box.

  • because chords and backing vocals share markup, they cannot be nested.

Hang on, where are all my brackets/parentheses/braces etc?

ukedown itself only uses these to identify chords/backing vocals etc - it is up to you to decide if they should be in the final output.

In fact if you want to render them completely differently you can, as they can be styled using CSS.

CSS providing brackets

The following renders chord names with the delimiting () parentheses, without the :before and :after parts they would just be chord names.

.chord {
    font-weight: bold;
}

.chord:before {
    content: "(";
}
.chord:after {
    content: ")";
}

Style

Ukedown only produces HTML elements with named classes, it does no styling itself - this should be done using CSS. A sample CSS example follows:

@charset 'utf-8';

.indexlink {
    text-decoration: none;
    font-size: 0.9em;
    color: inherit;
}

.chord {
    font-weight: bold;
}

.chord:before {
    content: "(";
}
.chord:after {
    content: ")";
}

.section_header {
    font-weight: bold;
    font-size: 1em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-bottom: 0.5em;
}

.section_header:before {
    content: '[';
}

.section_header:after {
    content: ']';
}

.vox {
    font-weight: normal;
    font-style: italic;
}

.vox:before {
    content: "(";
}

.vox:after {
    content: ")";
}

.notes {
    font-style: normal;
    font-weight: bold;
}
.notes:before {
    content: "[";
}
.notes:after {
    content: "]";
}

p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Box call-outs (repeated chorus etc) */
.box {
    padding: 5px;
    padding-top: 0;
    padding-bottom:0;
    border-left: 2px solid black;
    width: auto;
    max-width: 98%;
    margin: 2px;
    margin-bottom: 0.5em;
}

.box > p {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 5px;
}

.box > p:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.box > h2, .section_header {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* End box definitions*/

Metadata

Release files for ukedown 2.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ukedown 2.2.3
File Size Uploaded Provenance Actions
ukedown-2.2.3.tar.gz 29.9 kB With provenance Details for ukedown-2.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ukedown 2.2.3
File Interpreter ABI Platform Actions
ukedown-2.2.3-py3-none-any.whl Python 3 none any Details for ukedown-2.2.3-py3-none-any.whl

Total release size: 52.4 kB

Release files / ukedown-2.2.3.tar.gz

Download URL ukedown-2.2.3.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2d45dcb309bb7a7fc4b360e9ab9e3d8d5a26f162f76b3e885b304c6f5642da48
BLAKE2b-256 checksum
How to use checksums
5a23566368fd16209272f2906f6a486fbb45b4d2ce5251122dc0fc6165a94350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / ukedown-2.2.3-py3-none-any.whl

Download URL ukedown-2.2.3-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39dd085ca656ea09ffce513500544d2b46ea19de74109f0c27ff56545a7a5467
BLAKE2b-256 checksum
How to use checksums
0c749f3013d6aa21f23837bf0bda79b5c003d8b63733a158bb597be7b5a0ab7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for ukedown 2.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ukedown-2.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page