Template:Source: Difference between revisions
Jump to navigation
Jump to search
m (better example) |
(Added Template:Documentation.) |
||
Line 1: | Line 1: | ||
<code>[http://mxr.mozilla.org/mozilla-central/source/{{{1}}} {{{2|{{{1}}}}}}]</code><noinclude> | |||
{{documentation}} | |||
<!-- Add categories to the /doc subpage, not here! --> | |||
</noinclude> | |||
Latest revision as of 15:00, 7 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 | 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
The above documentation is transcluded from Template:Source/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |