Difference between revisions of "Template:Api repository link"
From Roll20 Wiki
Line 1: | Line 1: | ||
− | <includeonly><span class="plainlinks">[{{#if: {{{file|{{{1|}}}}}}|https://github.com/Roll20/roll20-api-scripts/blob/master/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}/{{urlencode:{{{file|{{{1}}}}}}|PATH}}{{#if: {{{extension|{{{3|}}}}}}|.}}{{{extension|{{{3|}}}}}}|https://github.com/Roll20/roll20-api-scripts/tree/master/{{urlencode:{{{directory|{{{1}}}}}}}}}} {{{display name|{{{2|{{{file|{{{1}}}}}}}}}}}}]</span></includeonly><noinclude>{{documentation}}</noinclude> | + | <includeonly><span class="plainlinks">[{{#if: {{{file|{{{1|}}}}}}|https://github.com/Roll20/roll20-api-scripts/blob/master/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}/{{urlencode:{{{file|{{{1}}}}}}|PATH}}{{#if: {{{extension|{{{3|}}}}}}|.}}{{{extension|{{{3|}}}}}}|https://github.com/Roll20/roll20-api-scripts/tree/master/{{urlencode:{{{directory|{{{1}}}}}}}}}}{{#if: {{{display name|{{{2|{{{file|{{{1|}}}}}}}}}}}}|{{{display name|{{{2|{{{file|{{{1}}}}}}}}}}}}}}]</span></includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 22:00, 7 January 2015
Links to a file on the .
{{api-gh}}
, {{repo}}
are simpler versions of this.
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.
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
|
The above documentation is transcluded from Template:Api repository link/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. |