While it has by now been determined that music.SE wants ABC music markup, and the SE community managers have taken note, the integration remains to be implemented. A crucial point where this touches the users is: how can we best include ABC snippets within the Markdown of answers?
$ is a good delimiter character – it is long established on other SE sites for LaTeX / MathJax notation, and is not hard-wired in ABC syntax. However, I would vote for using the doubled variant
$$, for the following reasons:
- ABC allows assigning characters as line-delimiters, and
$is the recommended choice for this (though
!is also possible). Unless there's a good reason, we should not undermine this.
- Music snippets will always be “displays”, i.e. set apart from the surrounding text rather than inline with words of that text. This is analogous to the
$$TeX math display delimiter, whereas
$delimits simple inline maths expressions. It would be somewhat inconsistent if we now used single
$for music displays.
Example of how a ABC-featuring post could look in Markdown editor. $$ M: 4/4 L: 1/8 K: Dmaj |:D3 EFGFC|D2 A2 AF2E|D4 B2C2:| $$ This should then be easy to parse, and process using the existing ABCjs plugin, and give nice notation output!
We already have jTab support that works without any delimiter. So we will now have 2 different "languages". There might also potentially be need for having support for other stuff in the future.
So would it be smart to name the plugin?
X: 1 M: 4/4 L: 1/8 K: Dmaj |:D3 EFGFC|D2 A2 AF2E|D4 B2C2:|
And for consistency, also support specifying jTab block:
(but keep jTab as default if needed for backward-compability - see comments)
C E F
If we need to keep jTab as default, there are also use cases where you want to have a monospace code block, but not parsed with jTab. Even though it might not be the most common case, it should be really easy to implement, and I found at least three feature requests for this (here, here and here).
It could be something like this:
C B A F G Eb C B A
Sing along a song with notation without display chords here and there, lalala...
Status: Almost complete....
OK, as ABCjs is now implemented, this is quite good, but I still miss the possibility to mark code block with just letters like the last example. I guess we could use inline coding like I have done above.
The best alternative is probably to use
<pre> like this:
C B A F G Eb C B A Sing along a song with notation without display chords here and there C G Emaj7 B C A C A C but still position the chord names at the right position above lyrics.
Note: based on comments below I am effectively withdrawing my answer as a recommendation, but am leaving up in case anyone else has a similar thought.
Markdown uses a suffix description of the language that is to follow. Here's an example, using the $ symbol that seems to be popular here:
$$$abc music markup here more music markup here the line beneath this closes this block statement $$$
Personally, I'd prefer to use the grave symbol (which is often the same key as tilde ~ ) for several reasons
- it's what is used in Markdown
- the $ symbol is usually reserved for variable names in many computer programming languages
- the grave symbol looks more eloquent when editing
```abc music markup here more music markup here the line beneath this closes this block statement ```