Difference between revisions of "Template:FileSource"

m
m

1 Usage[edit]

The FileSource template is used to indicate the source of any file used in this wiki. It should be added at the bottom of each page of the file namespace.

It puts a message box with a "light blue database" icon in the page, and adds this page to the File source category.

If the file source is located in STMicroelectronics intranet (restricted access), only logged-in users who have writing permissions, can see this location.

Usage:  {{FileSource | <source ID> | <file ID> | <comment>}}

Where:

  • <source ID> is the mandatory identifier of source of the file (see table below for the possible values)
  • <file ID> is the mandatory identifier of the file. Its values depend on the source identifier (see table below)
  • <comment> is an optional comment (see table below)
File source <source ID> <file ID> <comment>
STMicroelectronics Digital Assets Library (intranet - restricted access) Digital Assets Library Number of the document in this Library
Any space is replaced by a "%20" character
Not used
STMicroelectronics user guide files library (intranet - restricted access) User guide Relative path of the file source from the user guide files library root directory
Any space is replaced by a "%20" character
Not used
STMicroelectronics training files library (intranet - restricted access) Training Relative path of the file source from the training files library root directory
Any space is replaced by a "%20" character
Not used
STMicroelectronics UML diagrams' Git repository (intranet - restricted access) UML diagram Relative path of the UML diagram from the UML diagrams' Git repository root directory
Any space is replaced by a "%20" character
Not used
Internet Internet URL of the file source
Any space is removed
Optional link text
The file is "self-contained" (to modify the file, it is enough to download it) NA Optional comment Not used

2 Basic examples[edit]

You type You get
File source: document 7331 of the Digital Assets Library
{{FileSource | Digital Assets Library | 7331}}
Source.png

Source → STMicroelectronics

File source: document STM32MP157x-DKx.pptx of the user guide files library
{{FileSource | User guide | Boards/STM32MP157x-DKx.pptx}}
Source.png

Source → STMicroelectronics

File source: document STM32MP15-Software-Software architecture.pptx of the training files library
{{FileSource | Training | STM32MP15-Software-Software architecture.pptx}}
Source.png

Source → STMicroelectronics

File source: UML diagram quadrature_x4_encoding.txt of the UML diagrams' Git repository
{{FileSource | UML diagram | timers/quadrature_x4_encoding.txt}}
Source.png

Source → STMicroelectronics

File source: URL for OpenEmbedded
{{FileSource | Internet | http://www.openembedded.org/ | OpenEmbedded}}
Source.png

Source → OpenEmbedded

"Self-contained" file
{{FileSource | NA | (archive file)}}
Source.png

Source → not applicable (archive file)

3 More examples[edit]

You type You get
No <source ID>
{{FileSource}}
Source.png

Source → STMicroelectronics

Unsupported value for <source ID>
{{FileSource | Unsupported value}}
Source.png

Source → STMicroelectronics

No <file ID> for the Digital Assets Library
{{FileSource | Digital Assets Library}}
Source.png

Source → STMicroelectronics

No <file ID> for the user guide files library
{{FileSource | User guide}}
Source.png

Source → STMicroelectronics

No <file ID> for the training files library
{{FileSource | Training}}
Source.png

Source → STMicroelectronics

No <file ID> for the UML diagrams' Git repository
{{FileSource | UML diagram}}
Source.png

Source → STMicroelectronics

No <file ID> for the Internet
{{FileSource | Internet}}
Source.png

Source → No URL supplied!

No <comment> for the Internet
{{FileSource | Internet | http://www.openembedded.org/}}
Source.png

Source → http://www.openembedded.org/

No <file ID> for the NA
{{FileSource | NA}}
Source.png

Source → not applicable

Check that the spaces before and after the message

BEFORE{{FileSource | NA}}AFTER<br>
BEFORE
{{FileSource | NA}}
AFTER

BEFORE

Source.png

Source → not applicable

AFTER

BEFORE

Source.png

Source → not applicable

AFTER

4 Code[edit]

Source.png

Source → STMicroelectronics

<noinclude>

==Usage==
The [[Template:FileSource|FileSource]] template is used '''to indicate the source of any file used in this wiki'''.  It should be added at the bottom of each page of the file namespace.

It puts a message box with a "light blue database" icon in the page, and adds this page to the [[:Category:File source|File source]] category.

If the file source is located in STMicroelectronics intranet (restricted access), '''only logged-in users who have writing permissions, can see this location'''.

 Usage:  <nowiki>{{</nowiki>FileSource | {{HighlightParam|<source ID>}} | {{HighlightParam|<file ID>}} | {{HighlightParam|<comment>}}}}
Where:
* {{HighlightParam|<source ID>}} is the '''mandatory''' identifier of source of the file (see table below for the possible values)
* {{HighlightParam|<file ID>}} is the '''mandatory''' identifier of the file. Its values depend on the source identifier (see table below)
* {{HighlightParam|<comment>}} is an '''optional''' comment (see table below)

{| class="st-table"
! File source !! {{HighlightParam|<source ID>}} !! {{HighlightParam|<file ID>}} !! {{HighlightParam|<comment>}}
|-
| STMicroelectronics Digital Assets Library (intranet - restricted access)
{{InternalInfo|[https://medialib.st.com/index.php Digital Assets Library]}}
| {{HighlightParam|Digital Assets Library}} || Number of the document in this Library<br />Any space is replaced by a "%20" character || Not used
|-
| STMicroelectronics user guide files library (intranet - restricted access)
{{InternalInfo|[http://best-collab.st.com/ws/MCD_Embedded_SW_MPU/Support/OurDocuments/User%20Guide/Sources%20files/ User guide files library]}}
| {{HighlightParam|User guide}} || Relative path of the file source from the user guide files library root directory<br />Any space is replaced by a "%20" character || Not used
|- 
| STMicroelectronics training files library (intranet - restricted access)
{{InternalInfo|[https://epm-st.st.com/ProjectServerST/Wildcat%20APPLI%20Introduction%20Package/Working%20Documents/Support%20and%20Application/Trainings/ Training files library]}}
| {{HighlightParam|Training}} || Relative path of the file source from the training files library root directory<br />Any space is replaced by a "%20" character || Not used
|-
| STMicroelectronics UML diagrams' Git repository (intranet - restricted access)
{{InternalInfo|[https://codex.cro.st.com/plugins/git/mpu/oe/st/plantum UML diagrams' Git repository]}}
| {{HighlightParam|UML diagram}} || Relative path of the UML diagram from the UML diagrams' Git repository root directory<br />Any space is replaced by a "%20" character || Not used
|-
| Internet || {{HighlightParam|Internet}} || URL of the file source<br />Any space is removed || Optional link text
|-
| The file is "self-contained" (to modify the file, it is enough to download it) || {{HighlightParam|NA}} || Optional comment || Not used
|}

==Basic examples==
{| class="st-table"
! You type !! You get
|-
| File source: document 7331 of the Digital Assets Library<pre style="white-space: pre-wrap;">

{{FileSource | Digital Assets Library | 7331}}</pre>

|
{{FileSource | Digital Assets Library | 7331}}
|-
| File source: document STM32MP157x-DKx.pptx of the user guide files library<pre style="white-space: pre-wrap;">

{{FileSource | User guide | Boards/STM32MP157x-DKx.pptx}}</pre>

|
{{FileSource | User guide | Boards/STM32MP157x-DKx.pptx}}
|-
|  File source: document STM32MP15-Software-Software architecture.pptx of the training files library<pre style="white-space: pre-wrap;">

{{FileSource | Training | STM32MP15-Software-Software architecture.pptx}}</pre>

|
{{FileSource | Training | STM32MP15-Software-Software architecture.pptx}}
|-
|  File source: UML diagram quadrature_x4_encoding.txt of the UML diagrams' Git repository<pre style="white-space: pre-wrap;">

{{FileSource | UML diagram | timers/quadrature_x4_encoding.txt}}</pre>

|
{{FileSource | UML diagram | timers/quadrature_x4_encoding.txt}}
|-
| File source: URL for OpenEmbedded<pre style="white-space: pre-wrap;">

{{FileSource | Internet | http://www.openembedded.org/ | OpenEmbedded}}</pre>

|
{{FileSource | Internet | http://www.openembedded.org/ | OpenEmbedded}}
|-
| "Self-contained" file<pre style="white-space: pre-wrap;">

{{FileSource | NA | (archive file)}}</pre>

|
{{FileSource | NA | (archive file)}}
|}

==More examples==
{| class="st-table"
! You type !! You get
|-
| No  {{HighlightParam|<source ID>}}<pre style="white-space: pre-wrap;">

{{FileSource}}</pre>

|
{{FileSource}}
|-
| Unsupported value for {{HighlightParam|<source ID>}}<pre style="white-space: pre-wrap;">

{{FileSource | Unsupported value}}</pre>

|
{{FileSource | Unsupported value}}
|-
| No {{HighlightParam|<file ID>}} for the Digital Assets Library<pre style="white-space: pre-wrap;">

{{FileSource | Digital Assets Library}}</pre>

|
{{FileSource | Digital Assets Library}}
|-
| No {{HighlightParam|<file ID>}} for the user guide files library<pre style="white-space: pre-wrap;">

{{FileSource | User guide}}</pre>

|
{{FileSource | User guide}}
|-
| No {{HighlightParam|<file ID>}} for the training files library<pre style="white-space: pre-wrap;">

{{FileSource | Training}}</pre>

|
{{FileSource | Training}}
|-
| No {{HighlightParam|<file ID>}} for the UML diagrams' Git repository<pre style="white-space: pre-wrap;">

{{FileSource | UML diagram}}</pre>

|
{{FileSource | UML diagram}}
|-
| No {{HighlightParam|<file ID>}} for the Internet<pre style="white-space: pre-wrap;">

{{FileSource | Internet}}</pre>

|
{{FileSource | Internet}}
|-
| No {{HighlightParam|<comment>}} for the Internet<pre style="white-space: pre-wrap;">

{{FileSource | Internet | http://www.openembedded.org/}}</pre>

|
{{FileSource | Internet | http://www.openembedded.org/}}
|-
| No {{HighlightParam|<file ID>}} for the NA<pre style="white-space: pre-wrap;">

{{FileSource | NA}}</pre>

|
{{FileSource | NA}}
|-
| Check that the spaces before and after the message<pre style="white-space: pre-wrap;">

BEFORE{{FileSource | NA}}AFTER<br>

BEFORE
{{FileSource | NA}}
AFTER</pre>

|
BEFORE{{FileSource | NA}}AFTER<br>

BEFORE
{{FileSource | NA}}
AFTER
|}

==Code==</noinclude>{| class="st-table" style="border-color: {{STLightBlue}};"
| style="border-right-width: 0px;}

==Code==</noinclude>{|
| style="border-width: 1px 0px 1px 1px; border-style: solid; border-color: {{STLightBlue}}; background-color: transparent; color: #58585A; font-weight: normal; text-align:left;" | [[File:Source.png|40px|link=]]
| style="border-left-width: 0px;1px 1px 1px 0px; border-style: solid; border-color: {{STLightBlue}}; background-color: transparent; color: #58585A; font-weight: normal; text-align:left; font-family:Arial;" |
{{#switch: {{{1}}}
 | Internet = Source → {{#if: {{{2|}}}|[{{#replace:{{{2|}}}| |}} {{{3|{{{2}}}}}}]|{{Highlight|No URL supplied!}}}}
 | NA = Source → not applicable {{{2|}}}
 | Source → STMicroelectronics {{#tag:secureTransclude||
src=ProtectedTemplate:FileSource|
params={{{1|}}} {{!}} {{{2|}}}
}}
}}
|}<includeonly>[[Category:File source]]</includeonly>
Line 150: Line 150:
 
|
 
|
 
{{FileSource | NA}}
 
{{FileSource | NA}}
  +
|-
  +
| Check that the spaces before and after the message
  +
<pre style="white-space: pre-wrap;">
  +
BEFORE{{FileSource | NA}}AFTER<br>
  +
BEFORE
  +
{{FileSource | NA}}
  +
AFTER
  +
</pre>
  +
|
  +
BEFORE{{FileSource | NA}}AFTER<br>
  +
BEFORE
  +
{{FileSource | NA}}
  +
AFTER
 
|}
 
|}
   
 
==Code==
 
==Code==
</noinclude>{|
+
</noinclude>{| class="st-table" style="border-color: {{STLightBlue}};"
| style="border-width: 1px 0px 1px 1px; border-style: solid; border-color: {{STLightBlue}}; background-color: transparent; color: #58585A; font-weight: normal; text-align:left;" | [[File:Source.png|40px|link=]]
+
| style="border-right-width: 0px;" | [[File:Source.png|40px|link=]]
| style="border-width: 1px 1px 1px 0px; border-style: solid; border-color: {{STLightBlue}}; background-color: transparent; color: #58585A; font-weight: normal; text-align:left; font-family:Arial;" |
+
| style="border-left-width: 0px;" |
 
{{#switch: {{{1}}}
 
{{#switch: {{{1}}}
 
  | Internet = Source → {{#if: {{{2|}}}|[{{#replace:{{{2|}}}| |}} {{{3|{{{2}}}}}}]|{{Highlight|No URL supplied!}}}}
 
  | Internet = Source → {{#if: {{{2|}}}|[{{#replace:{{{2|}}}| |}} {{{3|{{{2}}}}}}]|{{Highlight|No URL supplied!}}}}

Attachments

Discussions