« Utilisateur:LMischler/EIG-wiki-syntax-2016 » : différence entre les versions

De Guide de l'Installation Electrique
Aller à :navigation, rechercher
(page moved to english wiki)
 
(3 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
= Text formatting markup =
page has been moved to [[:en:User:LMischler/EIG-wiki-syntax-2016|english wiki]]
 
{| class="wikitable"
! Description !! You type !! You get
|-
| colspan="3" {{Table_HC1}} | '''Character (inline) formatting – ''applies anywhere'''''
|-
|Italic text
| <code><nowiki>''italic''</nowiki></code>
|''italic''
|-
| Bold text
| <code><nowiki>'''bold'''</nowiki></code>
|'''bold'''
|-
| Bold and italic
| <code><nowiki>'''''bold & italic'''''</nowiki></code>
|'''''bold & italic'''''
|-
|Escape wiki markup
| <code><nowiki><nowiki>no ''markup''&lt;/nowiki></nowiki></code>
|<nowiki>no ''markup''</nowiki>
|-
| colspan="3" {{Table_HC1}} | '''Section formatting – ''only at the beginning of the line'''''
|-
|Headings of different levels
| <pre>=level 1=
==level 2==
===level 3===
====level 4====
=====level 5=====
======level 6======</pre>
An article with 4 or more headings automatically creates a [[wikipedia:Wikipedia:Section#Table of contents (TOC)|table of contents]].
 
|<!-- hack to prevent TOC viewing for h1 - h6 elements: their style is hardcopied here -->
<div style="font-size: 188%; margin: 0; padding-top: .5em; padding-bottom: .17em; border-bottom: 1px solid #aaa">Level 1</div>
<div style="font-size: 150%; margin: 0; padding-top: .5em; padding-bottom: .17em; border-bottom: 1px solid #aaa">Level 2</div>
<div style="font-size: 132%; font-weight: bold">Level 3</div><!--
--><b>Level 4</b><!--
--><div style="font-size: 86%; font-weight: bold">Level 5</div><!--
--><b style="font-size: 80%">Level 6</b>
|-
|Horizontal rule
| <code>----</code>
|
----
|-
|Bullet list
|
<pre>
* one
* two
* three
** three point one
** three point two
</pre>
Inserting a blank line will end the first list and start another.
|
* one
* two
* three
** three point one
** three point two
|-
| indent text
|
<pre>: Single indent
:: Double indent
::::: Multiple indent</pre>
This workaround may be controversial from the viewpoint of accessibility.
|
: Single indent
:: Double indent
::::: Multiple indent
|}
 
 
= special characters =
 
== less than or equal ==
Replace the GraphSch character used in the book by standard existing character: &le;
 
You can just paste it in a wiki page (you can copy it from here), or when editing you can use the code <code>&amp;le;</code>
 
== star and delta symbols ==
* for star I migrated the source from figB20.ai, insert it using <nowiki>[[File:star_symbol.svg]]</nowiki> which gives this result: [[File:star_symbol.svg]]
* for delta you can paste directly this character: Δ or use the code <code>&amp;Delta;</code> which gives the same result: &Delta;
 
= Paragraphs =
 
MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tags <code>&lt;br /></code>.
 
 
= Titles, sub-titles ... =
 
The wiki page title (defined when creating a page) is using the first title level (h1)
 
So when the book content to migrate includes "paragraphs", "sub-paragraphs" ... their titles should use wiki syntax for level 2 (== title ==), level 3 (=== sub-paragraph ===) etc
 
 
= bullet lists - details =
 
'''''This is the revised syntax of Nov 2016, after modification od CSS for bullet and definition lists'''''
 
{| class="wikitable"
|-
|Bullet list
|
<pre>
* one
* two
** two point one
** two point two
* three
: continued
:* three point one (:* syntax rather than **)
* four
: text paragraph inside bullet four
: several continued sentences is possible
: can also be used for an image that is part of bullet point
:[[File:Blogs icon.png|none]]
:* four point one (:* syntax rather than **)
</pre>
Inserting a blank line will end the first list and start another.
 
nota: there is a small bug with wiki CSS, so inside tables following text does not have proper font size  ==>  not a problem as should never happen in tables
|
* one
* two
** two point one
** two point two
* three
: continued
:* three point one (:* syntax rather than **)
* four
: text paragraph inside bullet four
: several continued sentences is possible
: can also be used for an image that is part of bullet point
:[[File:Blogs icon.png|none]]
:* four point one (:* syntax rather than **)
|}
 
'''It is not recommended to have more than 2 nested levels of bullet lists'''.
 
If there are more than 2 bullet list levels (maybe sometimes also for 2 levels), it is recommended to change the first level of bullet list to a sub-paragraph level
 
 
= "Highlight Boxes" (green boxes in the book, grey in wiki) =
 
These are the "boxes" added in the left column of the book, to highlight a point. Most are green in the book, except the "french specifc" ones which are grey
 
* syntax for "normal" ones:
 
<pre style="color:black; font-size:14px;">{{Highlightbox |
This is the text for the highlight box
}}</pre>
 
example:
{{Highlightbox |
This is the text for the highlight box
}}
 
* syntax for "french-specific" ones:
 
<pre style="color:black; font-size:14px;">{{Highlightbox-specific |
This is the text for the french specific highlight box
}}</pre>
 
example:
{{Highlightbox-specific |
This is the text for the french specific highlight box
}}
 
 
= Manual TOCs (table of contents) =
 
These small manual TOCs are used in "introductory pages", eg pages with a short text introduction (or not), followed by this small manual TOC  =  links to pages included in this "section"
 
syntax:
 
<pre style="color:black; font-size:14px;">{{Manual_TOC |
* [[General method for cable sizing]]
* [[Recommended simplified approach for cable sizing]]
* [[Sizing of busbar trunking systems (busways)|Example where visible text is different from page name]]
}}</pre>
 
example:
{{Manual_TOC |
* [[General method for cable sizing]]
* [[Recommended simplified approach for cable sizing]]
* [[Sizing of busbar trunking systems (busways)|Example where visible text is different from page name]]
}}
 
 
= Images =
The syntax is now using templates, to facilitate and standardize the formating, as shown below
 
 
== Image = ONE FIGURE ==
 
<nowiki>{{FigImage|<fig-ID>|<fig-extension>|<fig-num>|<fig-title>}}</nowiki>
example:
<nowiki>{{FigImage|DB422002_FR|svg|A11|Application du facteur de simultanéité (ks) à un immeuble de 4 étages + rez-de-chaussée (correspondant à la norme NF C 14-100)}}</nowiki>
 
where:
* '''<fig-ID>'''        is like:  DB422001  (= image file name, without the file extension)
* '''<fig-extension>'''  is like:  svg, jpg ...
* '''<fig-num>'''        is like:  A11, B42a ...
* '''<fig-title>'''      is like:  Application of the diversity factor (ks) to an apartment block of 5 storeys
 
result:
{{FigImage|DB422002_FR|svg|A11|Application du facteur de simultanéité (ks) à un immeuble de 4 étages + rez-de-chaussée (correspondant à la norme NF C 14-100)}}
 
 
nota: '''<fig-title>''' normally is just text, and does not include any formatting, unless it is required, like to add a link inside the title. Example:
<nowiki>{{FigImage|<fig-ID>|<fig-extension>|A11|Circuit-breaker type <nowiki>'''[http://www.xxxxxxx Masterpact]'''</nowiki> from Schneider-Electric}}</nowiki>
 
 
== Image = ONE FIGURE with NOTES ==
 
<nowiki>{{FigImage|<fig-ID>|<fig-extension>|<fig-num>|<fig-title>|
add figure notes here ...<br>
... more
}}</nowiki>
example:
<nowiki>{{ FigImage|DB422002_FR|svg|A11|Application du facteur de simultanéité (ks) à un immeuble de 4 étages + rez-de-chaussée (correspondant à la norme NF C 14-100)|
add figure notes here ...<br>
... more
}}</nowiki>
 
 
Giving:
{{ FigImage|DB422002_FR|svg|A11|Application du facteur de simultanéité (ks) à un immeuble de 4 étages + rez-de-chaussée (correspondant à la norme NF C 14-100)|
add figure notes here ...<br>
... more
}}
 
 
== Image without frame and title ==
 
Syntax is very simple here:
<nowiki>[[File:<image-name-with-extension>]]
example:  |[[File:Pen-icon.png]]</nowiki>
 
Giving for exemple, if integrated in a small table:
{| class="wikitable"
|-
! table header
! header 2
|-
|[[File:Pen-icon.png]]
| This icon is a pen icon
|}
 
= Gallery of images =
 
== NEW syntax to use with dedicatedf template ==
 
=== template is now OK upto 8 images, but with 4 images per row as mandatory ===
Syntax to use:
* the parameter <widths-px> should be +- 5 px larger than biggest width of all images in the gallery, and expressed like 150px
<pre>
{{ Gallery | <1=fig-num> | <2=fig-title> |<3=widths>|<4=images-per-row>
|<5=image-filename-1> | <6=image-letter-1> |  <7=image-title-1>
|<8=image-filename-2> | <9=image-letter-2> |  <10=image-title-2>
...
|<17=image-filename-5> | <18=image-letter-5> |  <19=image-title-5> }}
</pre>
 
Where the global gallery parameters are:
<fig-num>          is like:  A11, B42a ...
<fig-title>        is like:  Application of the diversity factor (ks) to an apartment block of 5 storeys
<widths>            is like:  220px  (the common width applied to all gallery "cells", should be bigger than the largest image in the gallery)
<4=images-per-row>  is like:  1..4  (default if value not provided = 4)
 
and then for each image in the gallery :
<image-filename> is like:  DB422001.svg  (= image file name WITH the file extension)
<image-letter>  is like:  a  (it will be enclosed in squared brackets, like [a], and highlighted eg bold)
<image-title>    is like:  this is the title related to this image
 
maximum number of images taken:
if 1 per row  =  4
if 2 per row  =  8
if 3 per row  =  9
if 4 per row  =  16
 
 
Example:
{{Gallery|F78|Situations augmentant le risque d'incendie|165px|
|DB422266a.svg||Cordon d’alimentation trop sollicité (par un meuble ou une position)
|DB422266a.svg||Cordon d’alimentation défectueux suite à manoeuvres inappropriées ou trop nombreuses
|DB422266a.svg||Câble affaibli lors du raccordement
|DB422266a.svg||Endommagement accidentel d’un câble
|DB422266a.svg||Prises en mauvais état
|DB422266a.svg||Vieillissement des protections de câbles
|DB422266a.svg||Connexions desserrées
|DB422266a.svg||Câbles endommagés par leur environnement : UV, vibrations, humidité, rongeurs}}
 
=== if needeed to have less than 4 images per row, use 2 or more "image galleries", one "gallery" per row of images, with only the last one with fignum and title ===
See example below
{{Gallery|||335px|
|DB422032a_FR.svg||'''Configuration initiale''' : Tableau BT sous tension.<br/>Interrupteur MT fermé. Disjoncteur BT fermé. Sectionneur de terre ouvert et verrouillé. Clé O prisonnière. Clé S prisonnière.
|DB422032a_FR.svg||'''Etape 1''' : interrupteur fermé.<br/>Disjoncteur BT ouvert et verrouillé. Sectionneur de terre ouvert et verrouillé. Clé O libre. Clé S prisonnière.
|DB422032a_FR.svg||'''Etape 2''' : interrupteur ouvert.<br/>Disjoncteur BT ouvert et verrouillé. Sectionneur de terre déverrouillé. Clé O prisonnière. Clé S prisonnière.}}
{{Gallery|B19b|Exemple de système d'interverrouillage MT/BT|335px|
|DB422032a_FR.svg||'''Etape 3''' : interrupteur ouvert.<br/>Disjoncteur BT ouvert et verrouillé. Sectionneur de terre fermé et verrouillé. Clé O prisonnière. Clé S libre.
|DB422032a_FR.svg||'''Etape 4''' : interrupteur ouvert.<br/>Disjoncteur BT ouvert et verrouillé. Sectionneur de terre fermé et verrouillé, porte du compartiment transformateur ouverte. Clé O prisonnière. Clé S prisonnière.
|DB422032a_FR.svg||'''Légende'''}}
 
 
{{Gallery|E30|Tableaux de distribution terminale|170px|
|PB116718.jpg|a|Prisma Plus G Pack and what if the title is really very but really very very long ?
|PB116719.jpg|b|Kaedra
|PB116720.jpg|c|Mini-Pragma}}
 
 
== FOR MEMORY ONLY - OLD syntax using standard wiki Gallery ==
 
It has been replaced by specific template, mainly because the default gallery is resizing images to fill the image "boxes"  ==>  not OK for the wiki as we want to keep original image size
 
The syntax to use is shown below.
* '''Important''': you have to choose the "width" and "height" to use for the gallery, according to image sizes = it should correspond to the max width and maw height of all images in the gallery, + 5px
* for the example below, the images are 223×247 pixels and 210×252 pixels respectively, so max width = 223 + 5px = 228 I rounded to 230px, and max height = 252 + 5px = 257 I rounded to 260px
* the title for each image can include some wiki formatting (to put part of the text in bold, like the [a] ...
 
<pre style="color:black; font-size:14px;">
<gallery widths=230px> heights=260px>
File:<image-file-name>|<title for first image in the gallery>
File:<image-file-name>|<title for 2nd image in the gallery>
...
</gallery>
{{FigTitle|<fignum>|<figtitle>}}
</pre>
 
And here is an example
 
<gallery widths=230px heights=260px>
File:PB116705.jpg|'''[a]''' TGBT avec une arrivée par canalisation électrique préfabriquée (Prisma P)
File:PB116706.jpg|'''[b]''' TGBT (Okken)
</gallery>
{{FigTitle|E28|Tableau Général BT (TGBT) - examples}}
 
= Table =
 
== Standard Tables, with a title and without notes ==
 
The final syntax to use requires to REPLACE the usual starting and ending syntax of tables by specific templates with proper parameters:
 
<nowiki>{{TableStart|<table-ID>|<cols-in-book>}}    IMPORTANT: This line is REPLACING the usual table starting syntax: {| class="wikitable"
... table syntax as usual here ...
... continued ...
{{TableEnd|<table-ID>|<fig-num>|<table-title>}}    IMPORTANT: This line is REPLACING the usual table ending syntax: |}</nowiki>
where:
<nowiki><table-ID>      =  table ID  (Tab1001)</nowiki>
<cols-in-book>  =  1col 2col 3col 4col or 5col, according to nr of "book columns" required for the table width in the book
<fig-num>      =  figure number (A5)
 
Example:
<nowiki>{{TableStart|Tab1001|2col}}</nowiki>
|-
! header
! header
|-
| the table syntax is as usual
| the rest is as usual I believe
|-
| another cell
<nowiki>{{TableEnd|Tab1001|A5|This is my table title}}</nowiki>
 
Result:
 
{{TableStart|Tab1001|2col}}
|-
! header
! header
|-
| the table syntax is as usual
| the rest is as usual I believe
|-
| another cell
{{TableEnd|Tab1001|A5|This is my table title}}
 
== Table without TITLE ==
 
Similar syntax, just don't put any parameter in TableEnd  (TableEnd is always required !)
<nowiki>{{TableStart|<table-ID>|<cols-in-book>}}</nowiki>
... table syntax as usual here ...
... continued ...
<nowiki>{{TableEnd}}</nowiki>
 
== Table with TEXT-ONLY table notes ==
 
Syntax: the table start is the same, the table end similar but extended with the table notes
 
<nowiki>{{TableStart|<table-ID>|<cols-in-book>}}</nowiki>
... table syntax as usual here ...
... continued ...
<nowiki>{{TableEnd|<table-ID>|<fig-num>|<table-title></nowiki>
|| The text of my note here. It can be long with several sentences. Do not use "br" in this text
<nowiki>|| ... do like this to continue text on a new line}}</nowiki>
 
Example:
<nowiki>{{TableStart|Tab1002|2col}}</nowiki>
|-
! header
! header
|-
| the table syntax is as usual
| the rest is as usual I believe
|-
| another cell
<nowiki>{{TableEnd|Tab1002|A6|This is my table title</nowiki>
|| The text of my note here. It can be long with several sentences. Do not use "br" in this text
<nowiki>|| ... do like this to continue text on a new line}}</nowiki>
 
Result:
{{TableStart|Tab1002|2col}}
|-
! header
! header
|-
| the table syntax is as usual
| the rest is as usual I believe
|-
| another cell
{{TableEnd|Tab1002|A6|This is my table title
|| The text of my note here. It can be long with several sentences. Do not use "br" in this text
|| ... do like this to continue text on a new line}}
 
== Table with REFERENCES [a] ... and table notes ==
 
This is for reference inside a table, like this in the book: 3.3<sup>(1)</sup>. These references in the book use numbers (1, 2, 3 ...) which have to be changed to small capital letters in the wiki: a, b, c, d ... to differentiate the table notes (added just after the table) from the footnotes (added at the end of the page).
 
Syntax to add a reference in the content of the table:
<nowiki>{{TabRef|<table-ID>|<ref-letter>}}    Example: {{TabRef|Tab1001|a}}  to add a ref looking like: [a]</nowiki>
 
 
Complete example:
<nowiki>{{TableStart|Tab1003|2col}}</nowiki>
|-
! header
! header
|-
| here a cell with a ref<nowiki>{{TabRef|Tab1003|a}}</nowiki>
| the rest is as usual I believe
|-
| another cell
<nowiki>{{TableEnd|Tab1003|A7|This is my table title</nowiki>
|a|this is the text of my note a
|b|this is now the much longer text which is not a problem, for note b
|| I can also mix with text only table notes. Don't forget to put the 2 <nowiki>||</nowiki> at the beginning<nowiki>}}</nowiki>
 
Result:
{{TableStart|Tab1003|2col}}
|-
! header
! header
|-
| here a cell with a ref{{TabRef|Tab1003|a}}
| the rest is as usual I believe
|-
| and another ref{{TabRef|Tab1003|b}}
{{TableEnd|Tab1003|A7|This is my table title
|a|this is the text of my note a
|b|this is now the much longer text which is not a problem, for note b
|| I can also mix with text only table notes. Don't forget to put the 2 <nowiki>||</nowiki> at the beginning}}
 
 
= Footnotes =
 
Syntax to add a footnote  (no space before, to be placed just after the last charatcer of the related word)
<nowiki>{{fn|<footnote-number>}}</nowiki>
where:
<footnote-number>  = 1 2 3 4 ...
 
Syntax to add the Notes at the end of the page:
<pre style="color:black; font-size:14px;">
{{footnotes}}
<references>
{{fn-detail|1|This is text for note 1}}
{{fn-detail|2|This is text for note 2}}
</references>
</pre>
 
Example:
 
This is my text with footnote one{{fn|1}}. This is some more text, referencing note two{{fn|2}}
 
And this is another place referencing nte one{{fn|1}}.
 
{{footnotes}}
<references>
{{fn-detail|1|This is text for note 1}}
{{fn-detail|2|This is text for note 2}}
</references>
 
 
= Math formulas =
 
Use the same syntax as previous wikis  (copy / paste formulas). Just see below § "Special characters"
 
To know more, see  '''[http://en.wikipedia.org/wiki/Help:Displaying_a_formula Help page about Mathematical formulas]'''
 
 
== Multiplication sign ==
In synthesis, the rules to apply for the multiplication sign are:
* for formula written with <code><nowiki><math> ... </math></nowiki></code> syntax:
** use <code>\cdot</code> for formulas with variable names (Ib, ka, ...). Example: <code><nowiki><math>\sqrt 3\cdot U_0</math></nowiki></code> gives <math>\sqrt 3\cdot U_0</math>
** use <code>\times</code> for formulas where you only have figures. Example: <code><nowiki><math>X = 0.08 \times 5</math></nowiki></code> gives <math>X = 0.08 \times 5</math>
* for formula written in normal text:
** use special character (symbol) • for formulas with variable names. Example: I<sub>n</sub> = Σ (Ib • k<sub>s</sub>)
** use standard letter x for formulas where you only have figures. Example: 123 x 8.2
 
 
== Special characters ==
 
Important: the following symbols are '''reserved characters''' that either have a special meaning under LaTeX or are unavailable in all the fonts. If you enter them directly in your text, they will normally not render, but rather do things you did not intend.
 
Important in particular for the % sign, which is used in some formulas (it works in the wiki, but then does not work during PDF exportation)
 
# $ % ^ & _ { } ~ \
 
These characters can be entered by adding a prefix backslash:
 
\# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}
 
 
== Syntax to avoid (for export) ==
 
While exporting the French wiki, in a few cases a formula that looks OK in the wiki is not rendered properly, due to syntax that is probably "boderline" or not OK in TeX
 
Here are the problematic syntax cases detected:
* <code>X^'d</code> : pb is that not only the ' is considered as the exponent, but also all following characters (here would result as X<sup>'d</sup>)
** '''solution''': use the syntax <code>X{'}d</code>
* <code>65%</code> : % is a special characters, as mentioned in previous paragraphs, and should always be preceded by a \
** '''solution''': use the syntax <code>65\%</code>
* <code>\vartriangle</code> : this works in the wiki but not in export (not found in TeX reference doc also)
** '''solution''': as it is used for a Delta symbol, use the syntax <code>\Delta</code>
 
 
== Vertical alignment of formulas with text ==
 
For vertical alignment of formulas that are included "inline" with text:
* use a syntax like: <nowiki><math </nowiki>'''style="vertical-align:-70%;"'''...> and play with the value in %
* for more details: '''[https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Alignment_with_normal_text_flow check here]'''
 
 
= Specific French contents =
 
== Just for a small text ==
 
<nowiki>{{FR-specific-text|<this is the specific text>}}</nowiki>
 
{{FR-specific-text|this is the specific text}}
 
 
== For a long specific section ==
 
<nowiki>{{FR-specific-section-start}}</nowiki>
this is the migrated content wich is french specific ...
... use usual syntax for wiki contents ...
....
....
<nowiki>{{FR-specific-section-end}}</nowiki>
 
 
{{FR-specific-section-start}}
this is the migrated content wich is french specific ...<br>
... use usual syntax for wiki contents ...<br>
....<br>
....
{{FR-specific-section-end}}
 
 
This formatting is not 100% validated, see other tests here: [[Utilisateur:LMischler/TestFRSpecificFormats]]
'''NOTA: also need to fully validate the syntax, depending on final format chosen. For math formulas in particular, it will be a problem if we want to use a non-white background color in the FR-specific section
 
 
= Other points =
 
== "parameters" like table note texts, table or figure titles with an = sign in it ==
 
Any time there is an '''=''' sign in the content of a table title, figure title, table note ... passed using one of my templates, (for example '''<nowiki>{{TableEnd ...}}</nowiki>''')<br>
you will need to replace the '''=''' sign by '''<nowiki>{{=}}</nowiki>'''

Dernière version du 15 mai 2018 à 07:36

page has been moved to english wiki