<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnLinking</title><revhistory><revision><revnumber>1</revnumber><date>2021-04-08 10:47:24</date><authorinitials>independence</authorinitials></revision></revhistory></articleinfo><section><title>Linking Reference</title><para>There are two fundamental linking types on MoinMoin. </para><itemizedlist><listitem><para>Brackets (<code>[[  ]]</code>) are used to <emphasis>link</emphasis> to a target (a local wiki page, an external URL, a file, etc). </para></listitem><listitem><para>Braces (<code>{{  }}</code>) are used to <emphasis>embed</emphasis> (transclude/include/show) some target (often an image, but can be text). </para></listitem></itemizedlist><para>Targets are very flexible in that they support virtually any style you can with regular HTML (relative or absolute paths, anchors, etc). </para><section><title>Linking</title><para>Properly-formed URLs (i.e. <code>http://example.net</code>), <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/InterWiki#">InterWiki</ulink> pages, email addresses, and <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/CamelCase#">CamelCase</ulink> pagenames are automatically recognized as targets even without using brackets. </para><informaltable><tgroup cols="3"><colspec colname="col_0" colwidth="25*"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Syntax</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Comment</emphasis> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link </para></entry><entry colsep="1" rowsep="1"><para><code>WikiName</code> </para></entry><entry colsep="1" rowsep="1"><para><ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/CamelCase#">CamelCase</ulink> page name </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal free link </para></entry><entry colsep="1" rowsep="1"><para><code>[[free link]]</code> </para></entry><entry colsep="1" rowsep="1"><para>any page name </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link to sub page </para></entry><entry colsep="1" rowsep="1"><para><code>/SubPage</code> or <code>[[/sub page]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link to sister page </para></entry><entry colsep="1" rowsep="1"><para><code>../SisterPage</code> or <code>[[../SisterPage|link text]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link with linktext </para></entry><entry colsep="1" rowsep="1"><para><code>[[SomePage|some Page]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link to a section </para></entry><entry colsep="1" rowsep="1"><para><code>[[SomePage#subsection|subsection of Some Page]]</code> </para></entry><entry colsep="1" rowsep="1"><para> See <link linkend="Anchors">#Anchors</link> section below </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link with linktext &amp; parameter </para></entry><entry colsep="1" rowsep="1"><para><code>[[SomePage|some Page|target=&quot;_blank&quot;]]</code> </para></entry><entry colsep="1" rowsep="1"><para>see below for parameter configurations </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link using a graphic as button </para></entry><entry colsep="1" rowsep="1"><para><code>[[SomePage|{{attachment:imagefile.png}}]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>internal link using graphic button, open new window </para></entry><entry colsep="1" rowsep="1"><para><code>[[SomePage|{{attachment:samplegraphic.png}}|target=&quot;_blank&quot;]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>link to attachment </para></entry><entry colsep="1" rowsep="1"><para><code>[[attachment:image.png]]</code> </para></entry><entry colsep="1" rowsep="1"><para>links to attachment image </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>link to attachment of another page </para></entry><entry colsep="1" rowsep="1"><para><code>[[attachment:SomePage/image.png]]</code> </para></entry><entry colsep="1" rowsep="1"><para>links to image attached to a different page </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>interwiki link </para></entry><entry colsep="1" rowsep="1"><para><code>Otherwiki:somepage</code> </para></entry><entry colsep="1" rowsep="1"><para>requires uppercase wikiname </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>interwiki free link </para></entry><entry colsep="1" rowsep="1"><para><code>[[otherwiki:somepage]]</code> </para></entry><entry colsep="1" rowsep="1"><para>any wikiname in the map works </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>external link </para></entry><entry colsep="1" rowsep="1"><para><code>http://example.net/</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>external link with linktext </para></entry><entry colsep="1" rowsep="1"><para><code>[[http://example.net/|example site]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>external link with linktext, open new window </para></entry><entry colsep="1" rowsep="1"><para><code>[[http://example.net/|example site|target=&quot;_blank&quot;]]</code> </para></entry><entry colsep="1" rowsep="1"><para>see below for parameter configurations </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>external link using a graphic as button </para></entry><entry colsep="1" rowsep="1"><para><code>[[http://example.net/|{{attachment:samplegraphic.png}}]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>external link using graphic button, open new window </para></entry><entry colsep="1" rowsep="1"><para><code>[[http://example.net/|{{attachment:samplegraphic.png}}|target=&quot;_blank&quot;]]</code> </para></entry><entry colsep="1" rowsep="1"/></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>border of internal link </para></entry><entry colsep="1" rowsep="1"><para><code>WikiName``s</code> </para></entry><entry colsep="1" rowsep="1"><para>2 backticks - for when a WikiName ends in the middle of a word </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>avoid an internal link </para></entry><entry colsep="1" rowsep="1"><para><code>!WikiName</code> </para></entry><entry colsep="1" rowsep="1"><para>configurable function </para></entry></row></tbody></tgroup></informaltable></section><section><title>Embedding</title><para>Embedding/Transclusion is used if you want to include an external file within your wiki.  Most commonly, this will be a graphic. But it can also be a text file or any other file that the wiki understands (for example, you can provide link for downloading <emphasis>and</emphasis> display the contents of that file on the page!). </para><para><emphasis>see <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/HelpOnImages#">HelpOnImages</ulink> for examples.</emphasis> </para><informaltable><tgroup cols="3"><colspec colname="col_0" colwidth="25*"/><colspec colname="col_1"/><colspec colname="col_2"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para><emphasis role="strong">Description</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Syntax</emphasis> </para></entry><entry colsep="1" rowsep="1"><para><emphasis role="strong">Comment</emphasis> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an attached graphics </para></entry><entry colsep="1" rowsep="1"><para><code>{{attachment:image.png}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show attached image file <code>image.png</code> </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an attached graphics and give alt text </para></entry><entry colsep="1" rowsep="1"><para><code>{{attachment:image.png|alt text}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show attached image file <code>image.png</code> with alternative text saying <code>alt text</code> (recommended for accessibility) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an attached graphics and define alignment </para></entry><entry colsep="1" rowsep="1"><para><code>{{attachment:image.png|alt text|align=&quot;position&quot;}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show attached image file <code>image.png</code> with alternative text <code>alt text</code> and  aligned to <emphasis>position</emphasis>, where <emphasis>position</emphasis> can be one of <emphasis role="strong">top</emphasis>, <emphasis role="strong">middle</emphasis>, <emphasis role="strong">bottom</emphasis>, <emphasis role="strong">right</emphasis> or <emphasis role="strong">left</emphasis> (do not omit alt text) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an attached graphics and resize it </para></entry><entry colsep="1" rowsep="1"><para><code>{{attachment:image.png|alt text|width=100 height=150}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show attached image file <code>image.png</code> with alternative text <code>alt text</code> and resize it to 100px width and 150px high (do not omit alt text) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an external graphics </para></entry><entry colsep="1" rowsep="1"><para><code>{{http://example.net/image.png}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show target image inline </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an external graphics and give alt text </para></entry><entry colsep="1" rowsep="1"><para><code>{{http://example.net/image.png|alt text}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show target image inline with alternative text saying <code>alt text</code> (recommended for accessibility) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an external graphics and define alignment </para></entry><entry colsep="1" rowsep="1"><para><code>{{http://example.net/image.png|alt text|align=&quot;position&quot;}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show target image inline with alternative text <code>alt text</code> and aligned to <emphasis>position</emphasis>, where <emphasis>position</emphasis> can be one of <emphasis role="strong">top</emphasis>, <emphasis role="strong">middle</emphasis>, <emphasis role="strong">bottom</emphasis>, <emphasis role="strong">right</emphasis>, or <emphasis role="strong">left</emphasis> (do not omit alt text) </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>embed an external graphics and resize it </para></entry><entry colsep="1" rowsep="1"><para><code>{{http://example.net/image.png|alt text|width=100}}</code> </para></entry><entry colsep="1" rowsep="1"><para>show target image inline with alternative text <code>alt text</code> and resize it to 100px width (do not omit alt text) </para></entry></row></tbody></tgroup></informaltable></section></section><section><title>Explanations</title><section><title>URLs</title><para>If you enter URLs into normal text, there is the problem of detecting what belongs to the URL and what not. There are four ways to force the ending of an URL: </para><itemizedlist><listitem><para>put a space after the URL, </para></listitem><listitem><para>use the <ulink url="http://c2.com/cgi/wiki?SixSingleQuotes#">SixSingleQuotes</ulink> escaping, </para></listitem><listitem><para>use the double bracketed URL syntax. </para></listitem></itemizedlist><para>The supported URL schemes are: <code>http</code>, <code>https</code>, <code>ftp</code>, <code>file</code> and some others. The administrator of your wiki can extend the supported schemes by using the <code>url_schemas</code> variable (see <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/HelpOnConfiguration#">HelpOnConfiguration</ulink>). </para><para>In addition to the standard schemes, there are <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/MoinMoin#">MoinMoin</ulink>-specific ones: <code>attachment</code> and <code>drawing</code>, these are related to file attachments and are explained on <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/HelpOnActions/AttachFile#">HelpOnActions/AttachFile</ulink>. </para></section><section><title>Spaces</title><para>You can use double-brackets (or double-braces) syntax to link to a page or file name with spaces. This will even work for interwiki links, provided the target wiki understands standard url quoting (spaces will become <code>%20</code>). </para><para>However, best practice is to try to avoid spaces in URLs, as you may find it's more difficult to work with that URL. For example, if you try copying and emailing that URL link, the receiver may have difficulty landing on the page you specified. </para><para><anchor id="Anchors"/> </para></section><section><title>Anchors</title><para>To <emphasis>insert</emphasis> anchors into a page you need the <emphasis>Anchor</emphasis> macro (see <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/HelpOnMacros#">HelpOnMacros</ulink>): <code>&lt;&lt;Anchor(anchorname)&gt;&gt;</code>, where &quot;anchorname&quot; is the actual identifier of the anchor. </para><para>To link to an anchor on the same wiki page use <code>[[#anchorname]]</code> or <code>[[#anchorname|label text]]</code>. </para><para>To link to an anchor on another wiki page write <code>[[PageName#anchorname]]</code> or <code>[[PageName#anchorname|label text]]</code>, where &quot;<ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/PageName#">PageName</ulink>&quot; is the name of the other page and &quot;anchorname&quot; is the identifier of the anchor on that page. </para></section><section><title>Preventing Automatically Generated Links</title><para>To keep a word like <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/PageName#">PageName</ulink> from automatically being turned into a link,  you can suppress <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/CamelCase#">CamelCase</ulink> linking by putting an exclamation mark (<code>!</code>) before the word, i.e. <code>!PageName</code>. This method will not interfere with most searches (the exception is certain quoted phrases and regular expressions).  </para><para>Alternatively, you can insert two back-ticks <code>Page``Name</code>.  However, the problem with doing this is that it will prevent a simple search for the word &quot;PageName&quot; from matching <code>Page``Name</code> in a page, due to the inserted characters. </para><para>To prevent automatic URL linking, use either <code>`http://...`</code> or <code>{{{http://...}}}</code>. </para></section><section><title>Using link parameters</title><para>Sometimes you may want to give additional parameters for a link, influencing how it looks like, how it behaves and how exactly it links to the target - this is what the <emphasis role="strong">params</emphasis> part of <code>[[target|text|params]]</code> is for. </para><para>e.g. if you want a direct download link you want to enter as <code>param &amp;do=get</code> <code>[[attachment:HelpOnImages/pineapple.jpg|a pineapple|&amp;do=get]]</code> <ulink url="http://ipv6.blinkenshell.org/wiki/HelpOnLinking/wiki/HelpOnImages?action=AttachFile&amp;do=get&amp;target=pineapple.jpg">a pineapple</ulink> </para><section><title>Setting attributes of the &lt;a&gt; tag</title><para>Available attributes: class, title, target, accesskey (see some html reference if you want to know what they mean). </para><para>Example: <code>[[http://moinmo.in/|MoinMoin Wiki|class=green dotted,accesskey=1]]</code> </para><para>Renders as: <ulink url="http://moinmo.in/">MoinMoin Wiki</ulink> </para><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://ipv6.blinkenshell.org/moin_static1911/mandarin/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> Pressing the access key should jump to that link target (for Firefox 2.x and the example above it is Alt-Shift-1). </para></section><section><title>Creating a query string for the target URL</title><para>What is possible for this depends on the target site. </para><para>Example: <code>[[MoinMoin:MoinMoinWiki|MoinMoin Wiki|&amp;action=diff,&amp;rev1=1,&amp;rev2=2]]</code> </para><para>Renders as: <ulink url="http://moinmo.in/MoinMoinWiki%3Frev1%3D1%26action%3Ddiff%26rev2%3D2#">MoinMoin Wiki</ulink> </para><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://ipv6.blinkenshell.org/moin_static1911/mandarin/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> Please remember: </para><itemizedlist><listitem><para>If you want to give a key=value item for the query string, don't forget the ampersand (&amp;). </para></listitem><listitem><para>Giving query string items does not work when you give a URL as target (but for links to pages or attachments). </para></listitem><listitem><para>If you give a URL as target, you can include a query string directly in that target, no need for params. </para></listitem><listitem><para>You don't need to encode and url_quote the query string stuff, moin does this automatically for you. </para></listitem></itemizedlist></section></section><section><title>Images</title><para>You may use </para><screen><![CDATA[{{attachment:imagefile.png|text describing image|width=100}}]]></screen><para>to have the attached file <code>imagefile.png</code> displayed with a width of 100px; the graphics' height will be reduced/ enlarged proportionally (e.g. if <code>imagefile.png</code> was actually 200px width and 400px heigh, height would be reduced in this example to 200px). You may also use </para><screen><![CDATA[{{attachment:imagefile.png|text describing image|height=100}}]]></screen><para>to have the attached file <code>imagefile.png</code> displayed with a height of 100px, and the graphics' width will be reduced/ enlarged proportionally. Use </para><screen><![CDATA[{{attachment:imagefile.png|text describing image|width=100 height=150}}]]></screen><para>to have the attached file <code>imagefile.png</code> displayed with a width of 100px and a height of 150px. Please do not omit the alternative text in neither case. </para><para>Note this does not alter the attached file itself, in only makes the browser scale the image down/ up to the value given while displaying it. </para><section><title>Thumbnails</title><para>You may combine the transclusion with the linking syntax, leading to an image displayed in reduced size that links to itself in actual size, e.g. </para><screen><![CDATA[[[attachment:imagefile.png|{{attachment:imagefile.png|text describing image|width=100}}]]]]></screen></section></section></section></article>