<%
// Insert a link to a file in the mozilla-central source repository.
//
//  $0 - File to link to
//  $1 - (OPTIONAL) text for the link
//
// If $1 isn't provided, the link itself is the link text

var url = "http://mxr.mozilla.org/mozilla-central/source/" + $0;
var text = ($1 || $0);
var styleStart = "";
var styleEnd = "";

if (text == $0) {
    styleStart = "<code>";
    styleEnd = "</code>";
}

%><%-styleStart%><a rel="custom" href="<%=url%>"><%=text%></a><%-styleEnd%>
Search for pages that use Template:source to see example use cases and how many pages use this macro.

Document Tags and Contributors

Last updated by: Sheppy,