Template:Mdnbox/doc: Difference between revisions
No edit summary |
|||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
==Usage== | ==Usage== | ||
{{tl|mdnbox}} produces a right-hand adjusted, floating message box, telling the reader there | {{tl|mdnbox}} produces a right-hand adjusted, floating message box, telling the reader there are documents on a certain subject on [https://developer.mozilla.org Mozilla Developer Network] (MDN). | ||
==Parameters== | ==Parameters== | ||
There are | There are 4 named parameters (see the table below), none of which is required for the template to work, but one of which has to be used together with one or more of the other parameters. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Parameter !! Description | ! Parameter !! Description | ||
|- | |- | ||
| <code>lang</code> || Language code | | <code>lang</code> || Language code | ||
|- | |- | ||
| <code> | | <code>zone</code> || MDN zone | ||
|- | |- | ||
| <code> | | <code>wpla</code> || MDN web platform | ||
|- | |- | ||
| <code> | | <code>tool</code> || MDN developer tool | ||
|} | |} | ||
;<big>Copy-paste | ;<big>Copy-paste template</big> | ||
* <code><nowiki>{{mdnbox|lang= |zone= |wpla= |tool= }}</nowiki></code> | |||
===Language=== | ===Language=== | ||
''Conditional'' | |||
;<big>lang</big> | ;<big>lang</big> | ||
It is possible to specify a MDN locale code for the link (e.g. <tt>de</tt> for German or <tt>sv-SE</tt> for Swedish). If this parameter is left out, the link will be redirected at MDN to either the locale of the user's Firefox browser, or (if there is no translation of that webpage for the user's locale) to the English default locale (<tt>en-US</tt>). An up-to-date list of Mozilla's web locale codes can be found at the [https://l10n.mozilla-community.org/webdashboard/ Mozilla Web Localization Dashboard]. | It is possible to specify a MDN locale code for the link (e.g. <tt>de</tt> for German or <tt>sv-SE</tt> for Swedish). If this parameter is left out, the link will be redirected at MDN to either the locale of the user's Firefox browser, or (if there is no translation of that webpage for the user's locale) to the English default locale (<tt>en-US</tt>). An up-to-date list of Mozilla's web locale codes can be found at the [https://l10n.mozilla-community.org/webdashboard/ Mozilla Web Localization Dashboard]. | ||
;Limitation | |||
* Cannot be used on its own, it will only have an effect if used together with one or more of the other three parameters. | |||
;Usage: | ;Usage: | ||
* <code><nowiki>{{mdnbox|</nowiki>lang=''locale code''<nowiki>}}</nowiki></code> | * <code><nowiki>{{mdnbox|</nowiki>lang=''locale code''<nowiki>}}</nowiki></code> | ||
=== | ===MDN zone=== | ||
;<big> | ;<big>zone</big> | ||
MDN sort the major Mozilla application projects into "zones". You can choose to link to a certain zone, or to the overview page for Mozilla projects, by entering the parameter <code>zone</code> and set it to one of the values in the table '''Zone codes''' below. In addition to the zones specified at MDN, I have added a few common applications. | |||
;Usage: | ;Usage: | ||
* <code><nowiki>{{mdnbox|</nowiki> | * <code><nowiki>{{mdnbox|</nowiki>zone=''zone code''<nowiki>}}</nowiki></code> | ||
=== | ====Zone codes==== | ||
{| class="wikitable" | |||
|- | |||
! Value !! MDN zone !! Comment | |||
|- | |||
| add || Add-ons || | |||
|- | |||
| app || Apps || | |||
|- | |||
| cal || Calendar/Lightning || | |||
|- | |||
| ff || Firefox || | |||
|- | |||
| ffa || Firefox for Android || | |||
|- | |||
| fos || Firefox OS || | |||
|- | |||
| fxa || Firefox Accounts || | |||
|- | |||
| mp || Marketplace || | |||
|- | |||
| per || Persona || | |||
|- | |||
| tb || Thunderbird || | |||
|- | |||
| moz || Mozilla || for all other Mozilla projects | |||
|} | |||
; | ===Web Platform=== | ||
;<big>wpla</big> | |||
MDN have documentation for all of the web platform used by Mozilla and Mozilla products. You can choose to link to a certain platform, or to the overview page for the web technologies you may find in the Mozilla projects you work with, by entering the parameter <code>wpla</code> and set it to one of the values in the table '''Platform codes''' below. | |||
;Usage: | ;Usage: | ||
* <code><nowiki>{{mdnbox|</nowiki> | * <code><nowiki>{{mdnbox|</nowiki>wpla=''platform code''<nowiki>}}</nowiki></code> | ||
==== | ====Platform codes==== | ||
{| class="wikitable" | |||
|- | |||
! Value !! Web platform !! Comment | |||
|- | |||
| api || APIs and DOM || | |||
|- | |||
| css || CSS || | |||
|- | |||
| css3 || CSS3 || | |||
|- | |||
| graph || Graphics || | |||
|- | |||
| html || HTML || | |||
|- | |||
| html5 || HTML5 || | |||
|- | |||
| js || JavaScript || | |||
|- | |||
| mml || MathML || | |||
|- | |||
| all || ''Web technology for developers'' || for all other web platforms | |||
|} | |||
===Developer Tools=== | |||
;<big>tool</big> | |||
; | In addition to documentation on applications designed to run as stand-alone programs, MDN have documentation for Mozilla's web tools and in-application developer tools. You can choose to link to a certain tool, or to the overview page for the developer tools in Firefox, by entering the parameter <code>tool</code> and set it to one of the values in the table '''Tool codes''' below. | ||
;Usage: | ;Usage: | ||
* <code><nowiki>{{ | * <code><nowiki>{{</nowiki>mdnbox|tool=''tool code''<nowiki>}}</nowiki></code> | ||
=== | ====Tool codes==== | ||
{| class="wikitable" | |||
|- | |||
! Value !! Developer tool !! Comment | |||
|- | |||
| appm || App Manager || | |||
|- | |||
| jsdeb || JavaScript Debugger || | |||
|- | |||
| pagin || Page Inspector || | |||
|- | |||
| wcon || Web Console || | |||
|- | |||
| all || ''Firefox Developer Tools'' || for all other developer tools | |||
|} | |||
==Examples== | ==Examples== | ||
Line 106: | Line 128: | ||
;<big>No parameters</big> | ;<big>No parameters</big> | ||
<code><nowiki>{{mdnbox}}</nowiki></code> gives | <code><nowiki>{{mdnbox}}</nowiki></code> gives | ||
<br><br><br> | <br><br><br><br> | ||
{{mdnbox| | {{mdnbox|zone=ff}} | ||
;<big> | ;<big>zone</big> | ||
<code><nowiki>{{mdnbox| | <code><nowiki>{{mdnbox|zone=ff}}</nowiki></code> gives | ||
<br><br><br> | <br><br><br><br> | ||
{{mdnbox| | {{mdnbox|wpla=html5}} | ||
;<big> | ;<big>wpla</big> | ||
<code><nowiki>{{mdnbox| | <code><nowiki>{{mdnbox|wpla=html5}}</nowiki></code> gives | ||
<br><br><br> | <br><br><br><br> | ||
{{mdnbox| | {{mdnbox|tool=jsdeb}} | ||
<big> | ;<big>tool</big> | ||
<code><nowiki>{{mdnbox|tool=jsdeb}}</nowiki></code> gives | |||
<code><nowiki>{{mdnbox| | <br><br><br><br> | ||
<br><br><br> | {{mdnbox|lang=de}} | ||
< | ;<big>lang</big> (only) | ||
{{mdnbox| | <code><nowiki>{{mdnbox|lang=de}}</nowiki></code> gives | ||
<br><br><br><br> | |||
{{mdnbox|lang=de}} | |||
;<big>lang</big> (with another parameter) | |||
<code><nowiki>{{mdnbox|lang=de|zone=ff}}</nowiki></code> gives | |||
<br><br><br><br> | |||
{{mdnbox|zone=ff|wpla=html5|tool=jsdeb}} | |||
<br> | ;<big>Combo</big> | ||
<code><nowiki>{{mdnbox|zone=ff|wpla=html5|tool=jsdeb}}</nowiki></code> gives | |||
<br><br><br> | |||
{{mdnbox| | |||
<big> | |||
<code><nowiki>{{mdnbox| | |||
<br><br><br> | |||
{{mdnbox| | |||
<big> | |||
<code><nowiki>{{mdnbox| | |||
==See also== | ==See also== |
Revision as of 21:29, 27 November 2014
Usage
{{mdnbox}} produces a right-hand adjusted, floating message box, telling the reader there are documents on a certain subject on Mozilla Developer Network (MDN).
Parameters
There are 4 named parameters (see the table below), none of which is required for the template to work, but one of which has to be used together with one or more of the other parameters.
Parameter | Description |
---|---|
lang |
Language code |
zone |
MDN zone |
wpla |
MDN web platform |
tool |
MDN developer tool |
- Copy-paste template
{{mdnbox|lang= |zone= |wpla= |tool= }}
Language
Conditional
- lang
It is possible to specify a MDN locale code for the link (e.g. de for German or sv-SE for Swedish). If this parameter is left out, the link will be redirected at MDN to either the locale of the user's Firefox browser, or (if there is no translation of that webpage for the user's locale) to the English default locale (en-US). An up-to-date list of Mozilla's web locale codes can be found at the Mozilla Web Localization Dashboard.
- Limitation
- Cannot be used on its own, it will only have an effect if used together with one or more of the other three parameters.
- Usage
{{mdnbox|lang=locale code}}
MDN zone
- zone
MDN sort the major Mozilla application projects into "zones". You can choose to link to a certain zone, or to the overview page for Mozilla projects, by entering the parameter zone
and set it to one of the values in the table Zone codes below. In addition to the zones specified at MDN, I have added a few common applications.
- Usage
{{mdnbox|zone=zone code}}
Zone codes
Value | MDN zone | Comment |
---|---|---|
add | Add-ons | |
app | Apps | |
cal | Calendar/Lightning | |
ff | Firefox | |
ffa | Firefox for Android | |
fos | Firefox OS | |
fxa | Firefox Accounts | |
mp | Marketplace | |
per | Persona | |
tb | Thunderbird | |
moz | Mozilla | for all other Mozilla projects |
Web Platform
- wpla
MDN have documentation for all of the web platform used by Mozilla and Mozilla products. You can choose to link to a certain platform, or to the overview page for the web technologies you may find in the Mozilla projects you work with, by entering the parameter wpla
and set it to one of the values in the table Platform codes below.
- Usage
{{mdnbox|wpla=platform code}}
Platform codes
Value | Web platform | Comment |
---|---|---|
api | APIs and DOM | |
css | CSS | |
css3 | CSS3 | |
graph | Graphics | |
html | HTML | |
html5 | HTML5 | |
js | JavaScript | |
mml | MathML | |
all | Web technology for developers | for all other web platforms |
Developer Tools
- tool
In addition to documentation on applications designed to run as stand-alone programs, MDN have documentation for Mozilla's web tools and in-application developer tools. You can choose to link to a certain tool, or to the overview page for the developer tools in Firefox, by entering the parameter tool
and set it to one of the values in the table Tool codes below.
- Usage
{{mdnbox|tool=tool code}}
Tool codes
Value | Developer tool | Comment |
---|---|---|
appm | App Manager | |
jsdeb | JavaScript Debugger | |
pagin | Page Inspector | |
wcon | Web Console | |
all | Firefox Developer Tools | for all other developer tools |
Examples
(By parameter)
- No parameters
{{mdnbox}}
gives
- zone
{{mdnbox|zone=ff}}
gives
- wpla
{{mdnbox|wpla=html5}}
gives
- tool
{{mdnbox|tool=jsdeb}}
gives
- lang (only)
{{mdnbox|lang=de}}
gives
- lang (with another parameter)
{{mdnbox|lang=de|zone=ff}}
gives
- Combo
{{mdnbox|zone=ff|wpla=html5|tool=jsdeb}}
gives
See also
- {{mozlink}}