Template:Userscript/doc: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 7:
<code><nowiki>{{ userscript |name= [script name] |code= [.js address] |doc= [documentation page address] }}</nowiki></code>
 
* All parameters are optional except for "name", however the template is not of much use without at least a .js path or a documentation path.
=== Notes ===
<hr>
* If a documentation page exists with a name that matches the code page name (without its .js extension), that documentation page will be linked automatically, with no <code>|doc=</code> parameter required. You can still enter a <code>|doc=</code> parameter explicitly if you want to override the automatic link.
'''Example:''' <code><nowiki>{{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}</nowiki></code>
 
'''Produces:''' {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}
* All parameters are optional except for "name", however the template is not of much use without at least a .js path or a documentation path.
 
* If a documentation page exists with a name that matches the code page name (without its .js extension), that documentation page will be linked automatically, with no <code>|doc=</code> parameter required. You can still enter a <code>|doc=</code> parameter explicitly if you want to override the automatic link.
=== Examples ===
<code><nowiki>{{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}</nowiki></code>
 
'''Produces:''' {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js|doc=User:TheDJ/Sharebox}}
 
'''Example:''' <code><nowiki>{{userscript|name=Sharebox|code=User:TheDJ/sharebox.js}}</nowiki></code>
 
'''Produces:''' {{userscript|name=Sharebox|code=User:TheDJ/sharebox.js}}