How it all works

Find traditional instrumental music
Jump to: navigation, search

This page offers an overview of how tune data is represented and used in the Traditional Tune Archive.

The main page for a tune stores structured tune data in the Wikitext page source. The data is structured as a set of named fields with associated values.

For example:

|f_tune_title=Abair Léi Go bhFuil Mé
|f_aka=Tell Her I Am

This syntax is a template "call" that references the Abctune template. The template parameters define values for fields. This style of template is called an infobox style template, in reference to the Wikipedia infobox concept. The tune page may also include free text, located after the template invocation. Typically, the tune page contains transcriptions of the tune using abc notation.

The template serves multiple functions:

  • Templates are expanded and transcoded to create the HTML used to display a Wiki page. Therefore, it is the Abctune template definition that defines how this data is displayed.
  • The Page Forms extension uses the template definition to create a form based editor for creating and editing tune pages.

The Abctune template expands into a Wikitext table, which is transcoded into an HTML table. The MediaWiki markup for a table is:

{| ... |}

Within the table, field values are obtained in this manner:

[[Was published in year::{{{f_year|}}}]]

The triple brace syntax accesses template parameters. The double bracket syntax defines a Semantic MediaWiki annotated value. Was published in year is a Semantic MediaWiki property name. The use of an annotated value in the template links the template parameter f_year to the Semantic MediaWiki property Was published in year.

The Page Forms extension is used to support the creation and editing of pages that use templates to represent data. It also adds support for interpreting text as a list of values. Editing is supported by the formedit action, implemented by Page Forms. This is an alternative edit page that provides a form-like UI for displaying and entering field values in the template. The free text of the page is edited normally.

The form is defined by a separate Wiki page called a form definition. The Abc_tune form contains the Wikitext for the edit page for a tune page. The data is presented as a table, using the MediaWiki markup:

{| ... |}

This markup is specified in a section delimited by:

{{{for template|Abctune|label=Tune Properties}}}


{{{end template}}}

Here the form is linked to the template used to represent the data in the tune page. The table markup contains special template calls that define fields. For example:


These template calls provide metadata to the Page Forms extension. The field template calls expand into the HTML for the field editors.

The form definition also contains this line:


This is a call to a parser function #forminput. It expands into a UI that allows the user to enter the name of a page, when creating a new page.