Layout architecture of MediaWiki pages and Talk:Wikipedia DTD: Difference between pages

From Meta, a Wikimedia project coordination wiki
(Difference between pages)
Content deleted Content added
No edit summary
 
Evan (talk | contribs)
Need a rationale for creating a custom DTD
 
Line 1: Line 1:
''There was I discussion on general aspects of what should be marked up in wikipedia (names, places, dates/times...). since [[Wikipedia DTD]] is about an XML representation of the current syntax I moved it to [[Talk:Simple ideology of Wikitax]]'' --[[User:Nichtich|Nichtich]] 01:36 Feb 7, 2003 (UTC)
== Basic DOM ==
----
The basic structure is:
''&lt;nowiki>&lt;![CDATA[do [not] parse <this>]]>&lt;/nowiki>''
* body element
** header id
** main id (just a wrapper)
*** content id - the actual rendered wiki text
*** linkbar id
** footer id


:I've never been quite clear on how CDATA sections work. If my data includes a raw "]]>", how do I encode it? --[[User:Brion VIBBER|Brion VIBBER]] 06:44 Jan 23, 2003 (UTC)
With [[en:CSS]], this allows several different basic layouts. For example, the linkbar can be lined up with the top of the page, or the bottom of the header.


:*<nowiki><![CDATA[just]]></nowiki>''']]&amp;gt;'''<nowiki><![CDATA[split]]></nowiki>
[http://wiki.beyondunreal.com/misc/wp/scaffold.html This scaffold document] shows the basic structure, with three alternate stylesheets to show possible visual layouts. On Mozilla, use View -> Use Style to change between them. Some crappy browsers may display all the alternate stylesheets which will look terrible.


----
The location of individual elements within the scaffold may vary: the Wikipedia logo can go in header or linkbar. Some however, should not: the element with id="content" should always hold the rendered wiki text of the page.


''<link system="wiki" href="image:Wiki.png"/>''
== Hooks ==
Consistent class and id names used across all templates allow us to use global stylesheets (for print, for example). They also allow certain user preferences (such as having the sidebar on the left or right) to work independently of any particular layout.


Image links are functionally different from regular wiki links, as they embed images. It would be best to use a distinct tag. --[[User:Brion VIBBER|Brion VIBBER]] 07:03 Jan 23, 2003 (UTC)
The use of two classes in one element may be replaced with something else if it turns out that some browsers can't handle it. (Netscape 4 is a culprit, for example: Netscape users will simply have always have the sidebar on the left.)


:You're right. I suggest:
=== Print hooks ===
These classes label elements, wherever they appear in the DOM. This allows the print stylesheet to easily hide online links. Each class may occur several times in the document, and an element may have several classes applied to it. If a class is applied to several elements, but the template needs to position only one, use an ID on it, or use two different elements.


Link to the '''page''' of the image:
If a section has a header, the classes do not need to be applied to the header. (Headers can be hidden in print by a "#linkbar h2" selector, for example.)
<tt><nowiki>[[:image:Wiki.png]]
<link system="wiki" href="image:Wiki.png"/></nowiki></tt>


Embed image/media/file/...
In global stylesheets, no element name should be used in the selector: use ".search" rather than "div.search", since each template may apply the classes to any kind of HTML element (P, DIV, etc).


<tt><nowiki>[[image:Wiki.png]] <media href="image:Wiki.png"/></nowiki></tt>
* search - search form and links
* pagelinks - "edit", "watch", "discuss" etc
* sitelinks - "main page", "RC", etc
* userlinks - "my watchlist", IP, Log in, Preferences etc
* pagestats - "last modified" and GFDL text
* languages - language links
* fromwp - the "from Wikipedia" text


I prefer <tt>media</tt> because we only embed media objects and
<tt>embed</tt> could mean something link "embed the content of another page".
See also discussion on special pages below.


----
=== System hooks ===
The body background colour is used to distinguish encyclopedia articles from meta and user pages. This hook may also be used to change colours, page title font, etc.
&lt;body class="encyclopedia">
&lt;body class="meta">


''<nowiki><link system="wiki" href="Wikipedia FAQ"/></nowiki>''
=== Preference hooks ===
...
Position of the sidebar:
''<nowiki><url href="http://www.wikipedia.org"/></nowiki>''
&lt;body class="leftbar">
...
&lt;body class="rightbar">
''<nowiki><mail to="webmaster@wikipedia.org"/></nowiki>''


These seem overcomplicated. Wouldn't it be simpler (in an XML way) to use the same tag for all links, and just have a wiki-specific URI? eg:
This is applied on the body level, because several elements need to set their margins to make room for the sidebar. (This is an unfortunate consequence of the current CSS box model.) If this is problematic with bad browsers, an alternative solution would be to make a div wrapper immediately inside the body element.
*local wiki link: [[Main Page]]
**<link href="wiki:Main_Page">Main Page</link>
*interwiki link: [[MeatBall:CommunityExpectation]]
**<link href="wiki://MeatBall/CommunityExpectation">MeatBall:CommunityExpectation</link>
*interlanguage link: <nowiki>[[eo:DTD de Vikipedio]]</nowiki>
**<link href="wiki://EsperantoWikipedia/DTD_de_Vikipedio" rel="language" lang="eo" />
*remote non-wiki link: [http://slashdot.org/ Slashdot]
**<nowiki><link href="http://slashdot.org/">Slashdot</link></nowiki>
*ISBN: ISBN 0-201-89683-4
**<nowiki><link href="isbn:0201896834">ISBN 0-201-89683-4</link></nowiki>


Upon (possible) reconversion to wiki syntax, the parser could use the most efficient form of representation available in that particular wiki syntax for that type of link.
Combined, the sidebar and body background colour hook might give:
&lt;body class="encyclopedia leftbar">


----
The sidebar can also be fixed relative to the browser window:

&lt;div id="linkbar" class="fixed">
*No redundancy please
Some browsers (notoriously IE/Win) break spectacularly on this. The proposed solution is to place a warning about this on the preferences page.
*An XML syntax should code information in tags and attributes. parsing strings is ugly and less efficient.
*The difference between interwiki links and local wiki links depends on the application. Try to edit <tt>test:baz</tt> since now it's a valid name but maybe there will be a "test"-wiki in the future.
*interlanguage links are a special topic. We could use a special tag: <pre><interlanguage href="eo:DTD_de_Vikipedio"/></pre>
*How about <tt>link system="url"</tt> for external links instead of <tt>url</tt> and <tt>email</tt>?

--[[User:Nichtich|Nichtich]] 22:34 Feb 2, 2003 (UTC)

It could be useful to code

<pre>User:Foo => <link system="wiki" space="user" href="Foo"/>
Talk:Bar => <link system="wiki" space="talk" href="Bar"/></pre>

and in other languages

<pre>Benutzer:Foo => <link system="wiki" space="user" href="Foo"/>
Diskussion:Bar => <link system="wiki" space="talk" href="Bar"/></pre>

But how to handle a page like:
<pre>Talk:User:Foo</pre>

Also possible (for instance in the german Wikipedia):

<pre>Diskussion:Talk:User:Foo</pre>

--[[User:Nichtich|Nichtich]] 21:59 Feb 2, 2003 (UTC)
----
===notes on paragraphs===
Manual Paragraphs with the <tt>p</tt> tag are pretty ugly to handle.
Try:

<pre><p>Hi! This is a paragraph

with an empty line in it.</p></pre>

You get:

<pre><p>Hi! This is a paragraph
<p>
with an empty line in it.</p>
</pre>

but the valid syntax is

<pre><p>Hi! This is a paragraph</p>
<p>with an empty line in it.</p></pre>

Why can't we just remove all invalid HTML-Tags? :-(


-----

IMHO the interlanguage-link would be better like
<pre><interlanguage lang="eo" href="DTD_de_Vikipedio"/></pre>

That way you give more information without the need of parsing
the content of href. [[User:Lothar Kimmeringer|Lothar Kimmeringer]] 02:37, 15 Sep 2003 (UTC)
----
How about a definition of the term DTD right up front as in this external link:<BR>
http://www.hyperdictionary.com/dictionary/Document+Type+Definition

== Need a rationale for creating a custom DTD ==

Why would we create and support a fit-to-purpose DTD, when everything we use in MediaWiki is already available in [http://www.oasis-open.org/docbook/xml/4.2/ DocBook XML] or even [http://nwalsh.com/docbook/simple/ Simplified DocBook]?

There are many excellent tools for converting Docbook XML to various other document formats -- HTML, RTF, PostScript and PDF. It's a well-accepted standard for document markup, and it would thus be useful for readers and for downstream publishers.

Creating a custom DTD would mean that we'd have to create processors from scratch. If DocBook (or another existing XML document format) meets our needs, what's the point? --[[User:Evan|Evan]] 00:43, 16 Dec 2003 (UTC)

Revision as of 00:43, 16 December 2003

There was I discussion on general aspects of what should be marked up in wikipedia (names, places, dates/times...). since Wikipedia DTD is about an XML representation of the current syntax I moved it to Talk:Simple ideology of Wikitax --Nichtich 01:36 Feb 7, 2003 (UTC)


<nowiki><![CDATA[do [not] parse <this>]]></nowiki>

I've never been quite clear on how CDATA sections work. If my data includes a raw "]]>", how do I encode it? --Brion VIBBER 06:44 Jan 23, 2003 (UTC)
  • <![CDATA[just]]>]]&gt;<![CDATA[split]]>

<link system="wiki" href="image:Wiki.png"/>

Image links are functionally different from regular wiki links, as they embed images. It would be best to use a distinct tag. --Brion VIBBER 07:03 Jan 23, 2003 (UTC)

You're right. I suggest:

Link to the page of the image: [[:image:Wiki.png]] <link system="wiki" href="image:Wiki.png"/>

Embed image/media/file/...

[[image:Wiki.png]] <media href="image:Wiki.png"/>

I prefer media because we only embed media objects and embed could mean something link "embed the content of another page". See also discussion on special pages below.


<link system="wiki" href="Wikipedia FAQ"/> ... <url href="http://www.wikipedia.org"/> ... <mail to="webmaster@wikipedia.org"/>

These seem overcomplicated. Wouldn't it be simpler (in an XML way) to use the same tag for all links, and just have a wiki-specific URI? eg:

  • local wiki link: Main Page
    • <link href="wiki:Main_Page">Main Page</link>
  • interwiki link: MeatBall:CommunityExpectation
    • <link href="wiki://MeatBall/CommunityExpectation">MeatBall:CommunityExpectation</link>
  • interlanguage link: [[eo:DTD de Vikipedio]]
    • <link href="wiki://EsperantoWikipedia/DTD_de_Vikipedio" rel="language" lang="eo" />
  • remote non-wiki link: Slashdot
    • <link href="http://slashdot.org/">Slashdot</link>
  • ISBN: ISBN 0-201-89683-4
    • <link href="isbn:0201896834">ISBN 0-201-89683-4</link>

Upon (possible) reconversion to wiki syntax, the parser could use the most efficient form of representation available in that particular wiki syntax for that type of link.


  • No redundancy please
  • An XML syntax should code information in tags and attributes. parsing strings is ugly and less efficient.
  • The difference between interwiki links and local wiki links depends on the application. Try to edit test:baz since now it's a valid name but maybe there will be a "test"-wiki in the future.
  • interlanguage links are a special topic. We could use a special tag:
    <interlanguage href="eo:DTD_de_Vikipedio"/>
  • How about link system="url" for external links instead of url and email?

--Nichtich 22:34 Feb 2, 2003 (UTC)

It could be useful to code

User:Foo => <link system="wiki" space="user" href="Foo"/>
Talk:Bar => <link system="wiki" space="talk" href="Bar"/>

and in other languages

Benutzer:Foo => <link system="wiki" space="user" href="Foo"/>
Diskussion:Bar => <link system="wiki" space="talk" href="Bar"/>

But how to handle a page like:

Talk:User:Foo

Also possible (for instance in the german Wikipedia):

Diskussion:Talk:User:Foo

--Nichtich 21:59 Feb 2, 2003 (UTC)


notes on paragraphs

Manual Paragraphs with the p tag are pretty ugly to handle. Try:

<p>Hi! This is a paragraph

with an empty line in it.</p>

You get:

<p>Hi! This is a paragraph
<p>
with an empty line in it.</p>

but the valid syntax is

<p>Hi! This is a paragraph</p>
<p>with an empty line in it.</p>

Why can't we just remove all invalid HTML-Tags? :-(



IMHO the interlanguage-link would be better like

<interlanguage lang="eo" href="DTD_de_Vikipedio"/>

That way you give more information without the need of parsing the content of href. Lothar Kimmeringer 02:37, 15 Sep 2003 (UTC)


How about a definition of the term DTD right up front as in this external link:
http://www.hyperdictionary.com/dictionary/Document+Type+Definition

Need a rationale for creating a custom DTD

Why would we create and support a fit-to-purpose DTD, when everything we use in MediaWiki is already available in DocBook XML or even Simplified DocBook?

There are many excellent tools for converting Docbook XML to various other document formats -- HTML, RTF, PostScript and PDF. It's a well-accepted standard for document markup, and it would thus be useful for readers and for downstream publishers.

Creating a custom DTD would mean that we'd have to create processors from scratch. If DocBook (or another existing XML document format) meets our needs, what's the point? --Evan 00:43, 16 Dec 2003 (UTC)