Template:Repo link: Difference between revisions

Jump to navigation Jump to search
Improvements, fixes and simplifications for the GitHub URL and text generation. The 'type=git' option now appends '.git', and the 'view=raw' option was simplified as the URL raw.githubusercontent.com is the result of a redirect from a github.com URL.
(Added many GitHub c172p-detailed examples from {{github source}}.)
(Improvements, fixes and simplifications for the GitHub URL and text generation. The 'type=git' option now appends '.git', and the 'view=raw' option was simplified as the URL raw.githubusercontent.com is the result of a redirect from a github.com URL.)
Line 141: Line 141:
| github = <!--
| github = <!--
-->{{{protocol|https}}}://<!--                                      URL protocol (default = https).
-->{{{protocol|https}}}://<!--                                      URL protocol (default = https).
-->{{#ifeq: {{{view|tree}}} | raw <!--                              The URL. -->
-->github.com/<!--                                                 The URL.
    | raw.githubusercontent.com/
    | github.com/
  }}<!--
-->{{#if: {{{user|}}} <!--                                          Project or user? -->
-->{{#if: {{{user|}}} <!--                                          Project or user? -->
     | {{{user}}}
     | {{{user}}}
Line 151: Line 148:
-->{{{repo|flightgear}}}<!--                                        The version control repository.
-->{{{repo|flightgear}}}<!--                                        The version control repository.
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
     | git = <!--                                                   Nothing more to do -->
     | git = .git<!--                                               Append '.git' to the base repository URL. -->
     | git web = /<!--
     | git web = /<!--
     -->{{#ifeq: {{{view|tree}}} | raw <!--                         The repository view. -->
     -->{{{view|tree}}}/<!--                                       The repository view.
          |
          | {{{view|tree}}}/
        }}<!--
     -->{{{commit|{{{branch|master}}}}}}<!--                        The branch or commit.
     -->{{{commit|{{{branch|master}}}}}}<!--                        The branch or commit.
     -->{{#if: {{{path|}}} | /{{{path}}}}}<!--                      The file or directory path.
     -->{{#if: {{{path|}}} | /{{{path}}}}}<!--                      The file or directory path.
Line 171: Line 165:
                     -->{{{user|{{{proj|}}}}}}/<!--                The user or project name
                     -->{{{user|{{{proj|}}}}}}/<!--                The user or project name
                     -->{{{repo|flightgear}}}/<!--                  The repository name.
                     -->{{{repo|flightgear}}}/<!--                  The repository name.
                     -->{{{commit|{{{branch|HEAD}}}}}}<!--         The repository branch.-->
                     -->{{{commit|{{{branch|master}}}}}}<!--       The repository branch.-->
                     }}
                     }}
                 }}<!--
                 }}<!--
             -->{{#if: {{{path|}}} | /{{{path}}}}}<!--              The file or directory path.
             -->{{#if: {{{path|}}} | /{{{path}}}}}<!--              The file or directory path.
             -->{{#if: {{{line|}}} | &#35;L{{{line}}}}} <!--        The optional line number(s). -->
             -->{{#if: {{{line|}}} | &#35;L{{{line}}}}} <!--        The optional line number(s).
            -->{{#ifeq: {{{type|}}} | zip
                  | <nowiki></nowiki> zip file<!--                  The link description. -->
                  | {{#switch: {{{view|tree}}} <!--                The view description. -->
                      | blob =
                      | blame = <nowiki></nowiki> blame view
                      | commit = <nowiki></nowiki> commit view
                      | commits = <nowiki></nowiki> history view
                      | raw = <nowiki></nowiki> raw view
                      | tree =
                    }}
                }}
             }}
             }}
         }}
         }}
Line 208: Line 213:
-->{{#if: {{{repo|}}} | /{{{repo}}} }}<!--                          The version control repository.
-->{{#if: {{{repo|}}} | /{{{repo}}} }}<!--                          The version control repository.
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
     | git = .git<!--                                              Append '.git' for the base repository URL. -->
     | git = .git<!--                                              Append '.git' to the base repository URL. -->
     | git web = <big style="color:red">The GitLab web interface is not implemented for {{tl|repo link}}</big>
     | git web = <big style="color:red">The GitLab web interface is not implemented for {{tl|repo link}}</big>
     | zip = /repository/archive.zip<!--                            The base zip file URL.
     | zip = /repository/archive.zip<!--                            The base zip file URL.
Line 239: Line 244:
-->{{{repo|flightgear}}}<!--                                        The version control repository.
-->{{{repo|flightgear}}}<!--                                        The version control repository.
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
-->{{#switch: {{{type|git web}}} <!--                              Web interface or base URL. -->
     | git = .git<!--                                              Append '.git' for the base repository URL. -->
     | git = .git<!--                                              Append '.git' to the base repository URL. -->
     | git web = ?<!--
     | git web = ?<!--
       -->p={{{proj|fg}}}<!--                                        The project and repository names, with '.git' appended.
       -->p={{{proj|fg}}}<!--                                        The project and repository names, with '.git' appended.
Line 381: Line 386:
; view:  View to display:
; view:  View to display:
:* For SourceForge use one of '''tree''', '''log''', '''commit''', or '''rss'''.  The default is '''tree'''.
:* For SourceForge use one of '''tree''', '''log''', '''commit''', or '''rss'''.  The default is '''tree'''.
:* For GitHub use one of '''blob''', '''blame''', '''commits''' or '''raw'''.  The default is '''tree''' (which switches to '''raw''').
:* For GitHub use one of '''blob''', '''blame''', '''commit''', '''commits''' or '''raw'''.  The default is '''tree'''.
:* For the Gitorious archive use one of '''summary''', '''shortlog''', '''log''', '''blob''', '''commit''', '''commitdiff''', '''tree''', '''history''', or '''raw'''.  The default is '''blob''' if a path is given, '''commit''' if a commit is given, or '''summary''' otherwise.
:* For the Gitorious archive use one of '''summary''', '''shortlog''', '''log''', '''blob''', '''commit''', '''commitdiff''', '''tree''', '''history''', or '''raw'''.  The default is '''blob''' if a path is given, '''commit''' if a commit is given, or '''summary''' otherwise.


Navigation menu