Recent Changes - Search:

add Cookbook page

hide

Cookbook


hide

Topics


show

Changed

Visitor's book Site map pmwiki-2.3.2

Chord Pro

  • change skiwi twice
  • update revision history
  • remove this comment
ChordPro version 2022-02-01
Summary: Display ChordPro-formatted song sheets in a wiki page
Version: 2022-01-22
Prerequisites: PmWiki version: 2.3.1 or greater; PHP 7.4 or greater
Status: Stable
Maintainer: skiwi
Licence: GPL3[1]
Discussion: ChordPro-Talk
Categories: Editing, Layout, Markup, PHP55, PHP72
License: GPL3+

Description

Use ChordPro formatted lyrics and tablature in a PmWiki page to embed and display ChordPro-formatted song sheets into a wiki page.

Markup

ChordPro is an early text format which was used to quickly generate song list with the chords mixed in with the lyrics. In many ways it is very wiki-like. Its goal is to make a machine-readable songsheet syntax, suitable for pretty-printing, which is also relatively easy on human eyes.

This recipe adds custom markup - ||: text :|| - for embedding ChordPro text within a wiki page. Within the custom markup ChordPro directives consist of keywords encapsulated in braces (curly brackets), viz "{keyword}", and text representing lyrics, within which chords, signified by square brackets, viz "[C#m7]", are embedded.

See ChordPro markup for details.

Formatting

All formatting is controlled by CSS. By default the chords and lyrics text is monospaced and the same size, however this is not necessary.

The spacing between the chording and the lyrics is controlled by the line-height CSS property. The spacing between each line of the song is controlled by padding above the chords and padding below the lyrics.

Modify chordpro.css to change colours, font-size, font-family, spacing etc. It is quite easy to do so and the CSS file is commented.

Installation

Download and unzip the archive chordpro-2022-01-22.zip Δ.

  • move the chordpro.php file to the /cookbook/ directory
  • move the chordpro.css file to the /pub/css/ directory unless you have customised it previously

Add the following line to config.php

@include_once("$FarmD/cookbook/chordpro.php");

Notes

PmSyntax

Releases

2022-02-02
add Custom Syntax markup formatting
2022-01-22
namespace, strict_types=1, use type hints, requires PHP 7.4 or greater
2022-01-01
Fix Array and string offset access syntax with curly braces is deprecated, use Semantic elements
2017-09-04
use Markup for PHP 7.2 compatibility
2015-07-01
use relative font sizes in CSS
2014-08-10
GPL3. Use Markup_e for PHP5 compatibility
2009-10-01
Change handling of Title, Subtitle, and Album. Better cope with two directives on one line. Add CSS for page breaks and page directives. Adjust CSS for line-height and song line spacing.
2009-08-20
A significant release providing css controlled formatting for wiki pages and printing, with correct handling of blank lines

Contributors

See also

Related pages

References

(:template each:)

Page last modified on 2022 Jan 31 21:20

Edit - History - Recent Changes - WikiHelp - Search - email page as link -> mailto:?Subject=KiwiWiki: Chord Pro&Body=From KiwiWiki: Chord Pro (https://kiwiwiki [period] co [period] nz/pmwiki/pmwiki [period] php/Cookbook/ChordPro) - Display ChordPro-formatted song sheets in a wiki page