====== Syntaxe de formatage ====== [[doku>DokuWiki]] prend en charge un langage de balisage simple, qui s'efforce de rendre les fichiers de données aussi lisibles que possible. Cette page contient toutes les syntaxes que vous pouvez utiliser lors de l'édition des pages. Jetez simplement un œil au code source de cette page en cliquant sur « Modifier cette page ». Si vous voulez essayer quelque chose, utilisez simplement la page [[playground:playground|bac à sable (playground)]]. Le balisage le plus simple est également facilement accessible via les [[doku>toolbar|boutons de la barre d'outils]]. ===== Formatage de base du texte ===== DokuWiki prend en charge le texte en gras, //italique//, souligné et en ''chasse fixe (monospacé)''. Bien entendu, vous pouvez //''combiner''// tous ces formats. DokuWiki prend en charge le texte en gras, //italique//, souligné et en ''chasse fixe (monospacé)''. Bien entendu, vous pouvez //''combiner''// tout cela. Vous pouvez également utiliser des indices subscript et des exposants superscript. Vous pouvez également utiliser des indices et des exposants. Vous pouvez tout aussi bien marquer un élément comme supprimé. Vous pouvez tout aussi bien marquer un élément comme supprimé. Les **paragraphes** sont créés par des lignes vides. Si vous souhaitez **forcer un retour à la ligne** sans créer de paragraphe, vous pouvez utiliser deux barres obliques inverses (antislashs) suivies d'un espace ou de la fin de la ligne. Ceci est un texte avec des retours à la ligne\\ Notez que les deux antislashs ne sont reconnus qu'en fin de ligne\\ ou suivis par\\ un espace \\ceci se produit sans cela. Ceci est un texte avec des retours à la ligne\\ Notez que les deux antislashs ne sont reconnus qu'en fin de ligne\\ ou suivis par\\ un espace \\ceci se produit sans cela. Vous ne devriez utiliser les retours à la ligne forcés que si cela est vraiment nécessaire. ===== Liens ===== DokuWiki prend en charge plusieurs méthodes pour créer des liens. ==== Liens externes ==== Les liens externes sont reconnus automatiquement (par magie) : http://www.google.com ou simplement www.google.com - Vous pouvez également définir le texte du lien : [[http://www.google.com|Ce lien pointe vers Google]]. Les adresses e-mail comme celle-ci : andi@splitbrain.org sont également reconnues. DokuWiki prend en charge plusieurs méthodes pour créer des liens. Les liens externes sont reconnus automatiquement : http://www.google.com ou simplement www.google.com - Vous pouvez également définir le texte du lien : [[http://www.google.com|Ce lien pointe vers Google]]. Les adresses e-mail comme celle-ci : andi@splitbrain.org sont également reconnues. ==== Liens internes ==== Les liens internes sont créés en utilisant des crochets. Vous pouvez soit indiquer simplement un [[pagename]], soit utiliser en plus un [[pagename|texte de lien]]. Les liens internes sont créés en utilisant des crochets. Vous pouvez soit indiquer simplement un [[pagename]], soit utiliser en plus un [[pagename|texte de lien]]. Les [[doku>pagename|noms de pages Wiki]] sont automatiquement convertis en minuscules, et les caractères spéciaux ne sont pas autorisés. Vous pouvez utiliser des [[some:namespaces|espaces de noms]] en insérant deux-points dans le nom de la page. Vous pouvez utiliser des [[some:namespaces]] en insérant des deux-points dans le nom de la page. Pour plus de détails sur les espaces de noms, consultez [[doku>namespaces|les espaces de noms]]. Créer un lien vers une section spécifique est également possible. Il suffit d'ajouter le nom de la section derrière un caractère dièse (#) comme en HTML. Ceci mène à [[syntax#internal|cette section]]. Ceci mène à [[syntax#internal|cette section]]. Notes: * Les liens vers les [[syntax|pages existantes]] s'affichent dans un style différent des liens vers les pages [[nonexisting|non existantes]]. * DokuWiki n'utilise pas le [[wp>CamelCase]] pour créer des liens automatiquement par défaut, mais ce comportement peut être activé dans le fichier de [[doku>config]]. Astuce : si DokuWiki est un lien, alors c'est activé. * Lorsque le titre d'une section est modifié, son ancrage change aussi. Ne comptez donc pas trop sur les liens vers les sections. ==== Interwiki ==== DokuWiki prend en charge les liens [[doku>Interwiki]]. Il s'agit de liens rapides vers d'autres wikis. Par exemple, voici un lien vers la page de Wikipédia concernant les wikis : [[wp>Wiki]]. DokuWiki prend en charge les liens [[doku>Interwiki]]. Il s'agit de liens rapides vers d'autres wikis. Par exemple, voici un lien vers la page de Wikipédia concernant les wikis : [[wp>Wiki]]. ==== Partages Windows ==== Les partages Windows comme [[\server\share|celui-ci]] sont également reconnus. Veuillez noter que ceux-ci n'ont de sens que dans un groupe d'utilisateurs homogène tel qu'un [[wp>Intranet]] d'entreprise. Les partages Windows comme [[\server\share|celui-ci]] sont également reconnus. Notes: * Pour des raisons de sécurité, l'accès direct aux partages Windows ne fonctionne par défaut que dans Microsoft Internet Explorer (et uniquement dans la « zone locale »). * Pour Mozilla et Firefox, cela peut être activé via différentes solutions de contournement mentionnées dans la [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|base de connaissances Mozilla]]. Cependant, un avertissement JavaScript concernant la tentative d'ouverture d'un partage Windows s'affichera toujours. Pour supprimer cet avertissement (pour tous les utilisateurs), ajoutez la ligne suivante dans le fichier ''conf/lang/fr/lang.php'' (plus de détails sur la page [[doku>localization#changing_some_localized_texts_and_strings_in_your_installation|localisation]]) : ==== Liens sur image ==== Vous pouvez également utiliser une image pour pointer vers une autre page interne ou externe en combinant la syntaxe des liens et celle des [[#images_and_other_files|images]] (voir ci-dessous) comme ceci : [[http://php.net|{{wiki:dokuwiki-128.png}}]] [[http://php.net|{{wiki:dokuwiki-128.png}}]] Veuillez noter : le formatage d'image est la seule syntaxe de formatage acceptée dans les noms de liens. L'ensemble de la syntaxe des [[#images_and_other_files|images]] et des [[#links|liens]] est pris en charge (y compris le redimensionnement des images, les images internes et externes, les URL et les liens interwiki). ===== Notes de bas de page ===== Vous pouvez ajouter des notes de bas de page ((Ceci est une note de bas de page)) en utilisant des doubles parenthèses. Vous pouvez ajouter des notes de bas de page ((Ceci est une note de bas de page)) en utilisant des doubles parenthèses. ===== Niveaux de titres ===== Vous pouvez utiliser jusqu'à cinq niveaux de titres différents pour structurer votre contenu. Si vous avez plus de trois titres, une table des matières est générée automatiquement -- cela peut être désactivé en incluant la chaîne ''~~NOTOC~~'' dans le document. ==== Titre niveau 3 ==== === Titre niveau 4 === == Titre niveau 5 == ==== Titre niveau 3 ==== === Titre niveau 4 === == Titre niveau 5 == En utilisant quatre tirets ou plus, vous pouvez créer une ligne horizontale : ---- ===== Media Files ===== You can include external and internal [[doku>images|images, videos and audio files]] with curly brackets. Optionally you can specify the size of them. Real size: {{wiki:dokuwiki-128.png}} Resize to given width: {{wiki:dokuwiki-128.png?50}} Resize to given width and height((when the aspect ratio of the given width and height doesn't match that of the image, it will be cropped to the new ratio before resizing)): {{wiki:dokuwiki-128.png?200x50}} Resized external image:           {{https://www.php.net/images/php.gif?200x50}} Real size: {{wiki:dokuwiki-128.png}} Resize to given width: {{wiki:dokuwiki-128.png?50}} Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} Resized external image:           {{https://www.php.net/images/php.gif?200x50}} By using left or right whitespaces you can choose the alignment. {{ wiki:dokuwiki-128.png}} {{wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png}} {{wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png }} Of course, you can add a title (displayed as a tooltip by most browsers), too. {{ wiki:dokuwiki-128.png |This is the caption}} {{ wiki:dokuwiki-128.png |This is the caption}} For linking an image to another page see [[#Image Links]] above. ==== Supported Media Formats ==== DokuWiki can embed the following media formats directly. | Image | ''gif'', ''jpg'', ''png'' | | Video | ''webm'', ''ogv'', ''mp4'' | | Audio | ''ogg'', ''mp3'', ''wav'' | | Flash | ''swf'' | If you specify a filename that is not a supported media format, then it will be displayed as a link instead. By adding ''?linkonly'' you provide a link to the media without displaying it inline {{wiki:dokuwiki-128.png?linkonly}} {{wiki:dokuwiki-128.png?linkonly}} This is just a link to the image. ==== Fallback Formats ==== Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility. For example consider this embedded mp4 video: {{video.mp4|A funny video}} When you upload a ''video.webm'' and ''video.ogv'' next to the referenced ''video.mp4'', DokuWiki will automatically add them as alternatives so that one of the three files is understood by your browser. Additionally DokuWiki supports a "poster" image which will be shown before the video has started. That image needs to have the same filename as the video and be either a jpg or png file. In the example above a ''video.jpg'' file would work. ===== Lists ===== Dokuwiki supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a ''*'' for unordered lists or a ''-'' for ordered ones. * This is a list * The second item * You may have different levels * Another item - The same list but ordered - Another item - Just use indention for deeper levels - That's it * This is a list * The second item * You may have different levels * Another item - The same list but ordered - Another item - Just use indention for deeper levels - That's it Also take a look at the [[doku>faq:lists|FAQ on list items]]. ===== Text Conversions ===== DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML. The text to image conversion is mainly done for smileys. And the text to HTML conversion is used for typography replacements, but can be configured to use other HTML as well. ==== Text to Image Conversions ==== DokuWiki converts commonly used [[wp>emoticon]]s to their graphical equivalents. Those [[doku>Smileys]] and other images can be configured and extended. Here is an overview of Smileys included in DokuWiki: * 8-) %% 8-) %% * 8-O %% 8-O %% * :-( %% :-( %% * :-) %% :-) %% * =) %% =) %% * :-/ %% :-/ %% * :-\ %% :-\ %% * :-? %% :-? %% * :-D %% :-D %% * :-P %% :-P %% * :-O %% :-O %% * :-X %% :-X %% * :-| %% :-| %% * ;-) %% ;-) %% * ^_^ %% ^_^ %% * m( %% m( %% * :?: %% :?: %% * :!: %% :!: %% * LOL %% LOL %% * FIXME %% FIXME %% * DELETEME %% DELETEME %% ==== Text to HTML Conversions ==== Typography: [[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters. -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." The same can be done to produce any kind of HTML, it just needs to be added to the [[doku>entities|pattern file]]. There are three exceptions which do not come from that pattern file: multiplication entity (640x480), 'single' and "double quotes". They can be turned off through a [[doku>config:typography|config option]]. ===== Quoting ===== Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: I think we should do it > No we shouldn't >> Well, I say we should > Really? >> Yes! >>> Then lets do it! I think we should do it > No we shouldn't >> Well, I say we should > Really? >> Yes! >>> Then lets do it! ===== Tables ===== DokuWiki supports a simple syntax to create tables. ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | Row 2 Col 1 | some colspan (note the double pipe) || | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | Table rows have to start and end with a ''|'' for normal rows or a ''^'' for headers. ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | Row 2 Col 1 | some colspan (note the double pipe) || | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators! Vertical tableheaders are possible, too. | ^ Heading 1 ^ Heading 2 ^ ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | ^ Heading 4 | no colspan this time | | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | As you can see, it's the cell separator before a cell which decides about the formatting: | ^ Heading 1 ^ Heading 2 ^ ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | ^ Heading 4 | no colspan this time | | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | You can have rowspans (vertically connected cells) by adding ''%%:::%%'' into the cells below the one to which they should connect. ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | Row 2 Col 1 | ::: | Row 2 Col 3 | | Row 3 Col 1 | ::: | Row 2 Col 3 | Apart from the rowspan syntax those cells should not contain anything else. ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | Row 2 Col 1 | ::: | Row 2 Col 3 | | Row 3 Col 1 | ::: | Row 2 Col 3 | You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text. ^ Table with alignment ^^^ | right| center |left | |left | right| center | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | This is how it looks in the source: ^ Table with alignment ^^^ | right| center |left | |left | right| center | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | Note: Vertical alignment is not supported. ===== No Formatting ===== If you need to display text exactly like it is typed (without any formatting), enclose the area either with ''%%%%'' tags or even simpler, with double percent signs ''%%''. This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. The same is true for %%//__this__ text// with a smiley ;-)%%. This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. The same is true for %%//__this__ text// with a smiley ;-)%%. ===== Code Blocks ===== You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags ''%%%%'' or ''%%%%''. This is text is indented by two spaces. This is preformatted code all spaces are preserved: like <-this This is pretty much the same, but you could use it to show that you quoted a file. Those blocks were created by this source: This is text is indented by two spaces. This is preformatted code all spaces are preserved: like <-this This is pretty much the same, but you could use it to show that you quoted a file. ==== Syntax Highlighting ==== [[wiki:DokuWiki]] can highlight sourcecode, which makes it easier to read. It uses the [[http://qbnz.com/highlighter/|GeSHi]] Generic Syntax Highlighter -- so any language supported by GeSHi is supported. The syntax uses the same code and file blocks described in the previous section, but this time the name of the language syntax to be highlighted is included inside the tag, e.g. '''' or ''''. /** * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } } The following language strings are currently recognized: //4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada aimms algol68 apache applescript apt_sources arm asm asp asymptote autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl batch bf biblatex bibtex blitzbasic bnf boo caddcl cadlisp ceylon cfdg cfm chaiscript chapel cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt cpp-winapi csharp css cuesheet c_winapi dart dcl dcpu16 dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria ezt f1 falcon fo fortran freebasic freeswitch fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell haxe hicest hq9plus html html4strict html5 icon idl ini inno intercal io ispfpanel java5 java javascript jcl j jquery julia kixtart klonec klonecpp kotlin latex lb ldif lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic mathematica matlab mercury metapost mirc mk-61 mmix modula2 modula3 mpasm mxml mysql nagios netrexx newlisp nginx nimrod nsis oberon2 objc objeck ocaml-brief ocaml octave oobas oorexx oracle11 oracle8 oxygene oz parasail parigp pascal pcre perl6 perl per pf phix php-brief php pic16 pike pixelbender pli plsql postgresql postscript povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon pys60 python qbasic qml q racket rails rbs rebol reg rexx robots roff rpmspec rsplus ruby rust sas sass scala scheme scilab scl sdlbasic smalltalk smarty spark sparql sql sshconfig standardml stonescript swift systemverilog tclegg tcl teraterm texgraph text thinbasic tsql twig typoscript unicon upc urbi uscript vala vbnet vb vbscript vedit verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch wolfram xbasic xml xojo xorg_conf xpp yaml z80 zxbasic// There are additional [[doku>syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers. ==== Downloadable Code Blocks ==== When you use the ''%%%%'' or ''%%%%'' syntax as above, you might want to make the shown code available for download as well. You can do this by specifying a file name after language code like this: If you don't want any highlighting but want a downloadable file, specify a dash (''-'') as the language code: ''%%%%''. ===== RSS/ATOM Feed Aggregation ===== [[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http://simplepie.org/|SimplePie]] is used. All formats understood by SimplePie can be used in DokuWiki as well. You can influence the rendering by multiple additional space separated parameters: ^ Parameter ^ Description ^ | any number | will be used as maximum number items to show, defaults to 8 | | reverse | display the last items in the feed first | | author | show item authors names | | date | show item dates | | description| show the item description. All HTML tags will be stripped | | nosort | do not sort the items in the feed | | //n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). | The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. [[wiki:DokuWiki]] will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells [[wiki:DokuWiki]] to re-render the page if it is more than //refresh period// since the page was last rendered. By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the ''reverse'' parameter, or display the feed as is with ''nosort''. **Example:** {{rss>http://slashdot.org/index.rss 5 author date 1h }} {{rss>http://slashdot.org/index.rss 5 author date 1h }} ===== Control Macros ===== Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble: ^ Macro ^ Description | | %%~~NOTOC~~%% | If this macro is found on the page, no table of contents will be created | | %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%%% syntax above is used), adding this macro will force DokuWiki to rerender a page on every call | ===== Syntax Plugins ===== DokuWiki's syntax can be extended by [[doku>plugins|Plugins]]. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular DokuWiki installation: ~~INFO:syntaxplugins~~