website/gems/lib/asciidoctor/musicbrainz-link-inline-macro/README.adoc

46 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-05-27 08:24:10 +00:00
= Musicbrainz link inline macro
:toc:
An inline macro for easily linking objects from link:https://musicbrainz.org/doc/MusicBrainz_Database[Musicbrainz database].
== Synopsis
[source, asciidoc]
----
musicbrainz:$ID[$CAPTION, $TYPE]
----
- `$ID` is the database identifier for that object (e.g., `9adcff14-7dba-4ccf-a6a6-298bcde3dd46`).
- `$CAPTION` is the link text.
By default, it will be the name of the database object (if valid).
Take note it will use the MusicBrainz API to query the title/name of the object.
In other words, it costs an additional network request.
- `$TYPE` is the database object type.
It defaults to 'Release' object type.
== Attributes
The macro can also accept some attributes.
- `caption` is the link text to be used.
This can be used instead of the first positional attribute.
- `type` is the database object type to be queried.
This can be used instead of the second positional attribute.
== Example usage
- `musicbrainz:9adcff14-7dba-4ccf-a6a6-298bcde3dd46[]` should have a link to the link:https://musicbrainz.org/release/9adcff14-7dba-4ccf-a6a6-298bcde3dd46[Musicbrainz page for The Bindings of Isaac Rebirth] with 'The Bindings of Isaac: Rebirth' as the link caption.
- `musicbrainz:9adcff14-7dba-4ccf-a6a6-298bcde3dd46[Ridiculon's Rebirth soundtrack]` same as above but with the link text replaced with 'Ridiculon's Rebirth Soundtrack'.
- `musicbrainz:b7c7f603-4c42-45a4-b364-3ddba82da412[type=release-group]` links to the link:https://musicbrainz.org/release-group/b7c7f603-4c42-45a4-b364-3ddba82da412[Musicbrainz page for The Bindings of Isaac Rebirth release group] with 'The Bindings of Isaac: Rebirth' as the link text.
- `musicbrainz:f07c6afe-ee84-4cd5-9b11-5c541d1dff3b[type=artist]` links to link:https://musicbrainz.org/artist/f07c6afe-ee84-4cd5-9b11-5c541d1dff3b[Musicbrainz page for Ridiculon] with their name as the caption.