<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
  <siteinfo>
    <sitename>ZMOG test wiki (master branch)</sitename>
    <dbname>mediawiki-test</dbname>
    <base>http://mw-master.test.jon.geek.nz/wiki/Main_Page</base>
    <generator>MediaWiki 1.39.0</generator>
    <case>first-letter</case>
    <namespaces>
      <namespace key="-2" case="first-letter">Media</namespace>
      <namespace key="-1" case="first-letter">Special</namespace>
      <namespace key="0" case="first-letter" />
      <namespace key="1" case="first-letter">Talk</namespace>
      <namespace key="2" case="first-letter">User</namespace>
      <namespace key="3" case="first-letter">User talk</namespace>
      <namespace key="4" case="first-letter">ZMOG test wiki (master branch)</namespace>
      <namespace key="5" case="first-letter">ZMOG test wiki (master branch) talk</namespace>
      <namespace key="6" case="first-letter">File</namespace>
      <namespace key="7" case="first-letter">File talk</namespace>
      <namespace key="8" case="first-letter">MediaWiki</namespace>
      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
      <namespace key="10" case="first-letter">Template</namespace>
      <namespace key="11" case="first-letter">Template talk</namespace>
      <namespace key="12" case="first-letter">Help</namespace>
      <namespace key="13" case="first-letter">Help talk</namespace>
      <namespace key="14" case="first-letter">Category</namespace>
      <namespace key="15" case="first-letter">Category talk</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
    <revision>
      <id>28</id>
      <parentid>25</parentid>
      <timestamp>2022-12-15T02:41:33Z</timestamp>
      <contributor>
        <username>Johnno</username>
        <id>1</id>
      </contributor>
      <origin>28</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="2916" sha1="o1sihxzdihxpb63cq2oxq97cshkpq05" xml:space="preserve">This is a MediaWiki instance running 1.39 LTS, mainly for testing the [https://www.mediawiki.org/wiki/Extension:Score Score extension] and anything else I might be working on.
Using the excellent skin from the [https://starcitizen.tools/ Star Citizen] wiki.

== Score Extension ==

'''''See also:''''' ''for more SVG music output testing, see testing pages: [[score examples]], [[Tim paste]].''

Using a patched version of the Score extension to render music as SVG; see [https://phabricator.wikimedia.org/T49578 T49578] and the [https://gitlab.com/doctorlard/mediawiki-extension-score/-/merge_requests/2/diffs patch] mirrored on GitLab. LilyPond version [https://gitlab.com/lilypond/lilypond/-/releases/v2.23.82 2.23.82] (a release candidate for the 2.24 release, scheduled for December 2022) includes libcairo support for producing SVG and PNG directly, rather than via PS, GhostScript, and ImageMagick.

;Note: To yoink Lilypond snippets from Wikipedia articles, see [https://en.wikipedia.org/wiki/Special:PagesWithProp?propname=score&amp;namespace=0 Special:PagesWithProp] and search for the "score" property in Article space.

Here's a Wagner excerpt for [https://en.wikipedia.org/wiki/Contrabass_trombone contrabass trombone], from Wikipedia.

First, the score block looks like this:

&lt;syntaxhighlight lang="Tex"&gt;
 &lt;score lang="lilypond"&gt;
 \layout { ragged-right = ##t \context { \Score \omit BarNumber } }
 \relative g {
    \override DynamicTextSpanner.style = #'none
    \override Hairpin.minimum-length = #5
    \clef bass \key c \major
    g2~ \ff g8 f8 e8. d16
    c4 b a g  f e d c4 \break
    b a g f  e1~ \dim\!  &lt;&lt; e1~ { s2 s4 s4 \&gt; } &gt;&gt;  e4 \! \p r4 r2
 }
 &lt;/score&gt;
&lt;/syntaxhighlight&gt;

Which normally generates a PNG image:

[[File:Score.png|none|Standard PNG output, using PostScript from Lilypond 2.22 --ps rendered by GhostScript|class=mw-ext-score]]

The patch produces good SVG output:

&lt;score lang="lilypond"&gt;
\layout { ragged-right = ##t \context { \Score \omit BarNumber } }
\relative g {
    \override DynamicTextSpanner.style = #'none
    \override Hairpin.minimum-length = #5
    \clef bass \key c \major
    g2~ \ff g8 f8 e8. d16
    c4 b a g  f e d c4 \break
    b a g f  e1~ \dim\!  &lt;&lt; e1~ { s2 s4 s4 \&gt; } &gt;&gt;  e4 \! \p r4 r2
}
&lt;/score&gt;

With a PNG fall-back generated using Lilypond's built-in libcairo support. As you can see, it almost identical; I think it is slightly clearer and more fine-grained than the GhostScript output:

[[File:nku68xzt.png|none|New PNG output, directly using Lilypond 2.24 directly with --png and libcairo|class=mw-ext-score]]

Cropping is done with the new LilyPond ''-dno-use-paper-size-for-page'' option ([https://lilypond.org/doc/v2.23/Documentation/usage/command_002dline-usage#advanced-command-line-options-for-lilypond docs]), which precludes having to do it the old way with an extra ImageMagick ''convert'' shell command, and achieves the same result.</text>
      <sha1>o1sihxzdihxpb63cq2oxq97cshkpq05</sha1>
    </revision>
  </page>
</mediawiki>
