Difference between revisions of "Template:Api repository link/doc"
From Roll20 Wiki
(Created page with "Links to a file on the [https://github.com/Roll20/roll20-api-scripts API Script Repository] == Parameters == {| class="wikitable" |- ! Name ! Description |- || directory || D...") |
Andreas J. (Talk | contribs) m |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Links to a file on the | + | {{documentation subpage|override=api repository link/doc|Api repository link}} |
+ | Links to a file on the {{api-gh| Roll20 API Script Repository}}. | ||
+ | |||
+ | |||
+ | {{tlx|api-gh}}, {{tlx|repo}} are simpler versions of this. | ||
== Parameters == | == Parameters == | ||
Line 11: | Line 15: | ||
|- | |- | ||
|| file | || file | ||
− | || File within the <code>directory</code> to link to. Defaults to the | + | || File within the <code>directory</code> to link to. Defaults to the second anonymous parameter. |
|- | |- | ||
− | || | + | || 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. | ||
− | |||
− | |||
− | |||
|} | |} | ||
+ | |||
+ | 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 25: | Line 28: | ||
! Wikitext | ! Wikitext | ||
! Output | ! Output | ||
+ | ! Notes | ||
|- | |- | ||
− | || <code><nowiki>{{api repository link| | + | || <code><nowiki>{{api repository link|Foo}}</nowiki></code> |
− | || {{api repository link| | + | || {{api repository link|Foo}} |
+ | || This links to <code>/tree/master/Foo</code> | ||
|- | |- | ||
− | || <code><nowiki>{{api repository link| | + | || <code><nowiki>{{api repository link|Foo|Bar}}</nowiki></code> |
− | || {{api repository link| | + | || {{api repository link|Foo|Bar}} |
+ | || This links to <code>/blob/master/Foo/Bar</code> | ||
+ | |- | ||
+ | || <code><nowiki>{{api repository link|Foo|ext=md}}</nowiki></code> | ||
+ | || {{api repository link|Foo|ext=md}} | ||
+ | || This links to <code>/blob/master/Foo/Foo.md</code> | ||
+ | |- | ||
+ | || <code><nowiki>{{api repository link|Foo|Bar|json}}</nowiki></code> | ||
+ | || {{api repository link|Foo|Bar|json}} | ||
+ | || This links to <code>/blob/master/Foo/Bar.json</code> | ||
|} | |} | ||
+ | |||
+ | <includeonly>[[Category:API Templates]]</includeonly> |
Latest revision as of 10:30, 26 September 2021
This is a documentation subpage for Api repository link. It contains usage information, categories and other content that is not part of the original template page. |
{{api-gh}}
, {{repo}}
are simpler versions of this.
[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
|