Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Template:Api repository link/doc"

From Roll20 Wiki

Jump to: navigation, search
(Usage)
m
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 +
{{documentation subpage|override=api repository link/doc|Api repository link}}
 
Links to a file on the [https://github.com/Roll20/roll20-api-scripts API Script Repository]
 
Links to a file on the [https://github.com/Roll20/roll20-api-scripts API Script Repository]
  
Line 11: Line 12:
 
|-
 
|-
 
|| file
 
|| file
|| File within the <code>directory</code> to link to. Defaults to the first anonymous parameter. This ''does'' mean that if neither <code>directory</code> nor <code>file</code> are specified, the linked file will be something to the effect of <code>foo/foo.js</code> (file and directory with the same name).
+
|| File within the <code>directory</code> to link to. Defaults to the second anonymous parameter.
 
|-
 
|-
|| extension
+
|| ext
 
|| File extension of the file to link to. Defaults to the third anonymous parameter.
 
|| File extension of the file to link to. Defaults to the third anonymous parameter.
|-
 
|| display name
 
|| Name to display for the link. Defaults to the second anonymous parameter, which in turn defaults to <code>file</code>.
 
 
|}
 
|}
 +
 +
If <code>ext</code> is supplied, the link is guaranteed to link to a file; if <code>file</code> is ''not'' supplied (for example, <code><nowiki>{{api repository link|ext=js|Foo}}</nowiki></code>), the <code>directory</code> will be used for the file name as well.
  
 
== Usage ==
 
== Usage ==
Line 44: Line 44:
 
|}
 
|}
  
<includeonly>[[Category:API Templates]]</includeonly><noinclude>[[Category:Template Documentation]]</noinclude>
+
<includeonly>[[Category:API Templates]]</includeonly>

Latest revision as of 22:45, 14 January 2015

Links to a file on the API Script Repository

[edit] Parameters

Name Description
directory Directory from the root of the repository that the file is located in. Defaults to the first anonymous parameter.
file File within the directory to link to. Defaults to the second anonymous parameter.
ext File extension of the file to link to. Defaults to the third anonymous parameter.

If ext is supplied, the link is guaranteed to link to a file; if file is not supplied (for example, {{api repository link|ext=js|Foo}}), the directory will be used for the file name as well.

[edit] Usage

Wikitext Output Notes
{{api repository link|Foo}} Foo This links to /tree/master/Foo
{{api repository link|Foo|Bar}} Bar This links to /blob/master/Foo/Bar
{{api repository link|Foo|ext=md}} Foo This links to /blob/master/Foo/Foo.md
{{api repository link|Foo|Bar|json}} Bar This links to /blob/master/Foo/Bar.json