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"

From Roll20 Wiki

Jump to: navigation, search
m
(simplify template)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
<includeonly><span class="plainlinks">[https://github.com/Roll20/roll20-api-scripts/{{#if: {{{ext|{{{file|{{{3|{{{2|}}}}}}}}}}}}|blob|tree}}/master/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}{{#if: {{{file|{{{2|}}}}}}|/{{urlencode:{{{file|{{{2}}}}}}|PATH}}{{#if: {{{ext|{{{3|}}}}}}|.{{{ext|{{{3}}}}}}}}|{{#if: {{{ext|}}}|/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}.{{{ext}}}}}}} {{#if: {{{file|{{{2|}}}}}}|{{{file|{{{2}}}}}}|{{#if: {{{directory|{{{1|}}}}}}|{{{directory|{{{1}}}}}}|repository link}}}}]</span></includeonly>
+
<includeonly>[https://github.com/Roll20/roll20-api-scripts/{{#if: {{{ext|{{{file|{{{3|{{{2|}}}}}}}}}}}}|blob|tree}}/master/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}{{#if: {{{file|{{{2|}}}}}}|/{{urlencode:{{{file|{{{2}}}}}}|PATH}}{{#if: {{{ext|{{{3|}}}}}}|.{{{ext|{{{3}}}}}}}}|{{#if: {{{ext|}}}|/{{urlencode:{{{directory|{{{1}}}}}}|PATH}}.{{{ext}}}}}}} {{#if: {{{file|{{{2|}}}}}}|{{{file|{{{2}}}}}}|{{#if: {{{directory|{{{1|}}}}}}|{{{directory|{{{1}}}}}}|repository link}}}}]</includeonly><noinclude>
 
+
[[Category:External Link Templates]]
<noinclude>
+
[[Category:Navigation Templates]]
+
 
{{documentation}}</noinclude>
 
{{documentation}}</noinclude>

Latest revision as of 10:22, 23 October 2021

[view] [edit] [history] [purge] Documentation icon Template documentation
Links to a file on the GitHubLogo.png.


{{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