<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.telosrealms.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ASound%2Fdoc</id>
	<title>Module:Sound/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.telosrealms.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ASound%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.telosrealms.com/index.php?title=Module:Sound/doc&amp;action=history"/>
	<updated>2026-06-22T06:50:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.telosrealms.com/index.php?title=Module:Sound/doc&amp;diff=14972&amp;oldid=prev</id>
		<title>Willow: the mass documenting</title>
		<link rel="alternate" type="text/html" href="https://wiki.telosrealms.com/index.php?title=Module:Sound/doc&amp;diff=14972&amp;oldid=prev"/>
		<updated>2026-06-20T11:55:00Z</updated>

		<summary type="html">&lt;p&gt;the mass documenting&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Module:Sound creates a small clickable volume icon that plays an uploaded audio file when clicked.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
This module powers {{tl|Sound}}. Given the name of an audio file uploaded to the wiki, it outputs a volume-icon button that the wiki&amp;#039;s JavaScript turns into a play control. It does this by resolving the file&amp;#039;s URL and storing it on the button as a &amp;lt;code&amp;gt;data-sound-file&amp;lt;/code&amp;gt; attribute; a site gadget/script then plays that URL when the icon is clicked. It does not play audio by itself — it only builds the button markup and supplies the file URL.&lt;br /&gt;
&lt;br /&gt;
Editors use the {{tl|Sound}} template rather than calling the module directly.&lt;br /&gt;
&lt;br /&gt;
== Functions / entry points ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Function (#invoke) !! What it does !! Called by&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;p.main&amp;lt;/code&amp;gt; || Reads the file name (arg 1) and optional icon size (arg 2, default &amp;lt;code&amp;gt;20px&amp;lt;/code&amp;gt;) from the parent template, resolves the file&amp;#039;s URL via the &amp;lt;code&amp;gt;filepath&amp;lt;/code&amp;gt; parser function, and returns a &amp;lt;code&amp;gt;&amp;lt;span class=&amp;quot;sound-button&amp;quot; data-sound-file=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/code&amp;gt; containing a &amp;lt;code&amp;gt;File:Icon-Volume.png&amp;lt;/code&amp;gt; image. Returns a red error message if no file name is given. || {{tl|Sound}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== How it&amp;#039;s used ==&lt;br /&gt;
&lt;br /&gt;
{{tl|Sound}} is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#invoke:Sound|main}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So on a page an editor writes, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Sound|MyBossRoar.ogg}}&lt;br /&gt;
{{Sound|MyBossRoar.ogg|32px}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Argument 1&amp;#039;&amp;#039;&amp;#039; — the audio file name as uploaded (e.g. &amp;lt;code&amp;gt;MyBossRoar.ogg&amp;lt;/code&amp;gt;). Read from the parent template&amp;#039;s parameters.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Argument 2&amp;#039;&amp;#039;&amp;#039; (optional) — the size of the volume icon, default &amp;lt;code&amp;gt;20px&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Editors should use {{tl|Sound}}; the raw &amp;lt;code&amp;gt;{{#invoke:Sound|main}}&amp;lt;/code&amp;gt; only appears inside that template.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* The play behaviour depends on an external site script/gadget that reads &amp;lt;code&amp;gt;data-sound-file&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;sound-button&amp;lt;/code&amp;gt; class. The module only emits the markup and the resolved URL; if that script isn&amp;#039;t loaded, clicking does nothing.&lt;br /&gt;
* The file URL comes from &amp;lt;code&amp;gt;{{filepath:...}}&amp;lt;/code&amp;gt;. Protocol-relative URLs (starting &amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;) are prefixed with &amp;lt;code&amp;gt;https:&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The clickable icon is &amp;lt;code&amp;gt;File:Icon-Volume.png&amp;lt;/code&amp;gt;, rendered with &amp;lt;code&amp;gt;link=&amp;lt;/code&amp;gt; (no link target) so the click is handled by the script, not by following a link.&lt;br /&gt;
* Newlines/carriage returns are stripped from the output so it can be used inline.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Related:&amp;#039;&amp;#039;&amp;#039; {{tl|Sound}}.&lt;/div&gt;</summary>
		<author><name>Willow</name></author>
	</entry>
</feed>