Template:Source/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Documentation subpage}} __NOTOC__ ==Usage== {{tl|source}} creates a link to source code in the <tt>mozilla-central</tt> Mercurial tree via Mozilla France's web service [...") |
(Added template link.) |
||
Line 45: | Line 45: | ||
==See also== | ==See also== | ||
* {{tl|c-c}}: links to a revision in the <tt>comm-central</tt> tree in Mercurial. | |||
* {{tl|hg}}: links to a revision in the <tt>mozilla-central</tt> tree in Mercurial. | * {{tl|hg}}: links to a revision in the <tt>mozilla-central</tt> tree in Mercurial. | ||
* {{tl|rev}}: links to a revision in a custom repository in Mercurial. | * {{tl|rev}}: links to a revision in a custom repository in Mercurial. |
Revision as of 09:17, 8 December 2014
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 | {{source|browser/Makefile.in}} |
browser/Makefile.in
|
Custom link text | {{source|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.