Template:BSD/doc

From Anarchaserver
< Template:BSD
Revision as of 16:09, 4 February 2022 by B01 (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:bsd/doc|-1|-2}}|doc|1|0}} and {{#if:en|1|0}} ) )|1|}}

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Template:BSD
                  | [[Category:{{#switch:Template
                          | Template | Project = Template
                          | Module   = Module
                          | User     = User
                          | #default = MediaWiki
                      }} documentation pages{{#translation:}}]]
                  | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
                 }}
        }}
    | 
   }}

| #default=

 {{#switch:

| = {{#if:{{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:bsd/doc|-1|-2}}|doc|1|0}} and {{#if:en|1|0}} ) )|1|}}

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Template:BSD
                  | [[Category:{{#switch:Template
                          | Template | Project = Template
                          | Module   = Module
                          | User     = User
                          | #default = MediaWiki
                      }} documentation pages{{#translation:}}]]
                  | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
                 }}
        }}
    | 
   }}

| #default=

 Lua error: expandTemplate: template loop detected.

}} }}

Usage

This template defaults to the 3-clause version, but may be used for any of the w:BSD licenses, by adding a parameter:

{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|Page Template:Nowrap/styles.css has no content.}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:BSD|BSD]]{{#if:4||4}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} — This will show the original 4-clause license.

{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|Page Template:Nowrap/styles.css has no content.}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:BSD|BSD]]{{#if:3||3}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} — This is the same as {{BSD}}, and will show the new 3-clause license.

{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|Page Template:Nowrap/styles.css has no content.}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:BSD|BSD]]{{#if:2||2}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} — This will show the FreeBSD 2-clause license.

{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|Page Template:Nowrap/styles.css has no content.}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:BSD|BSD]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}     — This will show the same as {{BSD|3}}, and will show the new 3-clause license.

The text of the license may be customized with the year, owner and organization parameters:

{{BSD|4|year=2009|owner=[[User:Jimbo Wales|Jimbo Wales]]|organization=the Wikimedia Foundation}} gives:

{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Template|File
   | file
   | other
   }} 
 }}

| file | image =

| other | #default = }}

{{BSD|3|year=2009|owner=[http://en.wikipedia.org/wiki/User:Jimbo_Wales Jimbo Wales]}} gives:

{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Template|File
   | file
   | other
   }} 
 }}

| file | image =

| other | #default = }}

{{BSD|2|year=2009}} gives:

{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Template|File
   | file
   | other
   }} 
 }}

| file | image =

| other | #default = }}

{{BSD}} gives:

{{#switch:

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Template|File
   | file
   | other
   }} 
 }}

| file | image =

| other | #default = }}

See also