Template:Source

From MozillaWiki
Jump to: navigation, search

{{{1}}}

Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{source}} creates a link to source code in the mozilla-central Mercurial tree via Mozilla France's web service Mozilla Cross-Reference (MXR). It works similar to mdc:Template:Source at Mozilla Developer Network.

Note

MXR also contains the older mozilla CVS tree.

Parameters

There are 2 parameters, both unnamed, of which 1 is required and 1 is optional.

Syntax

The template's syntax is

  • {{source|sub-path|custom link text}}

Required parameter

1

Sub-path under /mozilla-central

Path to the resource under mozilla-central, to which you wish to link. The parameter is unnamed, so no parameter name needs to be specified.

Usage
  • {{source|sub-path}}

Optional parameter

2

Custom link text

If you want the link to display something other than the input for parameter 1. The parameter is unnamed, so no parameter name needs to be specified.

Note
  • This parameter must be placed after the 1st parameter.
Usage
  • {{source|1|custom link text}}

Examples

Correct use

Case What you type What you see
Sub-path browser/Makefile.in}} browser/Makefile.in
Custom link text browser/Makefile.in|The browser's Makefile.in file}} The browser's Makefile.in file

See also

  • {{c-c}}: links to a revision in the comm-central tree in Mercurial.
  • {{hg}}: links to a revision in the mozilla-central tree in Mercurial.
  • {{rev}}: links to a revision in a custom repository in Mercurial.
  • {{SVN}}: links to a revision in Mozilla's source code browsing website for SVN.