Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (38 sloc) 2.42 KB

The definitions on this page use some elements defined in Markup spec/BNF/Fundamental elements.

Table of Contents

Canonical article title

The canonical article title is the version stored in the database. It has stricter rules about what it can contain than <article-title></article-title>, which can be used in page markup and other situations but must be converted to a canonical title for most other uses.

&lt;canonical-sub-pages&gt;		::= &lt;canonical-sub-page&gt; [&lt;canonical-sub-pages&gt;]
&lt;canonical-sub-page&gt;		::= &lt;sub-page-separator&gt; &lt;canonical-page-chars&gt;
 
&lt;canonical-page&gt;		::= &lt;canonical-page-first-char&gt; [&lt;canonical-page-chars&gt;]
&lt;canonical-page-chars&gt;		::= &lt;canonical-page-char&gt; [&lt;canonical-page-chars&gt;]
 
&lt;canonical-page-first-char&gt;	::= &lt;ucase-letter&gt; | &lt;digit&gt; | &lt;underscore&gt; | ...?
&lt;canonical-page-char&gt;		::= &lt;letter&gt; | &lt;digit&gt; | &lt;underscore&gt; | ...?

&lt;sub-page-separator&gt;		::= "/"

There is not a native concept of subpages in MediaWiki. That's a cute add-on extra, and no such things is enforced in titles. --Brion VIBBER 04:05, 29 May 2006 (UTC)
The reason I have added them is so that when it comes to translating between forms we will need to be able to refer to the sub-page element (e.g. when generating the links list at the top of the page in HTML, or when converting a relative wiki-link to a canonical page title). --HappyDog 13:49, 29 May 2006 (UTC)

Article title

This is the description of an article title, as used in links and other similar situations. It must be converted to a <canonical-article-title></canonical-article-title> for most other uses though. The structure is basically the same as <canonical-article-title></canonical-article-title>, except for the final page-char terminals.

&amp;amp&#59;lt&amp;&#35;59&#59;page&amp;&#35;45&#59;first&amp;&#35;45&#59;char&amp;amp&#59;gt&amp;&#35;59&#59;		&amp;&#35;58&#59;&amp;&#35;58&#59;&amp;&#35;61&#59; &amp;amp&#59;lt&amp;&#35;59&#59;canonical&amp;&#35;45&#59;page&amp;&#35;45&#59;first&amp;&#35;45&#59;char&amp;amp&#59;gt&amp;&#35;59&#59; &amp;&#35;124&#59; &amp;amp&#59;lt&amp;&#35;59&#59;lcase&amp;&#35;45&#59;letter&amp;amp&#59;gt&amp;&#35;59&#59; &amp;&#35;124&#59; ...?
&amp;amp&#59;lt&amp;&#35;59&#59;page&amp;&#35;45&#59;char&amp;amp&#59;gt&amp;&#35;59&#59;		&amp;&#35;58&#59;&amp;&#35;58&#59;&amp;&#35;61&#59; &amp;amp&#59;lt&amp;&#35;59&#59;canonical&amp;&#35;45&#59;page&amp;&#35;45&#59;char&amp;amp&#59;gt&amp;&#35;59&#59; &amp;&#35;124&#59; &amp;amp&#59;lt&amp;&#35;59&#59;space&amp;amp&#59;gt&amp;&#35;59&#59; &amp;&#35;124&#59; ...?

Transformations

Transform <article-title></article-title> to <canonical-article-title></canonical-article-title>

<canonical-page-first-char></canonical-page-first-char> = ucase(<page-first-char></page-first-char>)
<underscore></underscore> => " "

BNF/Article title