Help talk:Formatting

From MediaWiki.org

Jump to: navigation, search

Contents

[edit] $wgRawHtml

Does the wgRawHtml variable still work?? I can't get it to work, and I am trying to add a form to my main page. -- annon 02:51, 27 July 2006

Yes $wgRawHtml should work still. See Manual:$wgRawHtml Note that it's a security risk (and not normally necessary) -- Harry Wood 11:53, 14 December 2006 (UTC)

[edit] Tables

It might be helpful to have a help page on how to construct a table, like the oh-so-pretty one on this page, ferinstance. If such a page exists, I cannot find it; there should be a link to it from this page if it does exist but is simply hiding from me. - UniqueCrash5 15:51, 6 December 2006

That's available at Help:Tables. Alternatively the big guide to tables on Meta tells you more than you need to know!
Yeah I agree we should link to Help:Tables (and various other advanced formatting info) from this page -- Harry Wood 11:53, 14 December 2006 (UTC)

[edit] What About An HTML Symbols Guide?

As an HTML duffer :Þ I like access to these symbols.  How about either adding this to help:formatting, or posting the replacement technique is instead?  What follows is my PD cheat sheet with the more popular symbols in mediawiki bold.  I'll leave it here for a registered user to post if they are so moved. -

HTML tags for symbols: Á &Aacute;, á &aacute;,  &Acirc;, â &acirc;, ´ &acute;, Æ &AElig;, æ &aelig;, À &Agrave;, à &agrave;, ℵ &alefsym;, Α &Alpha;, α &alpha;, & &amp;, ∧ &and;, ∠ &ang;, Å &Aring;, å &aring;, ≈ &asymp;, à&Atilde;, ã &atilde;, Ä &Auml;, ä &auml;, „ &bdquo;, Β &Beta;, β &beta;, ¦ &brvbar;, • &bull;, ∩ &cap;, Ç &Ccedil;, ç &ccedil;, ¸ &cedil;, ¢ &cent;, Χ &Chi;, χ &chi;, ˆ &circ;, ♣ &clubs;, ≅ &cong;, © &copy;, ↵ &crarr;, ∪ &cup;, ¤ &curren;, † &dagger;, ‡ &Dagger;, ↓ &darr;, ⇓ &dArr;, ° &deg;, Δ &Delta;, δ &delta;, ♦ &diams;, ÷ &divide;, É &Eacute;, é &eacute;, Ê &Ecirc;, ê &ecirc;, È &Egrave;, è &egrave;, ∅ &empty;,   &emsp;,   &ensp;, Ε &Epsilon;, ε &epsilon;, ≡ &equiv;, Η &Eta;, η &eta;, Р&ETH;, ð &eth;, Ë &Euml;, ë &euml;, € &euro;, ∃ &exist;, ƒ &fnof;, ∀ &forall;, ½ &frac12;, ¼ &frac14;, ¾ &frac34;, ⁄ &frasl;, Γ &Gamma;, γ &gamma;, ≥ &ge;, > &gt;, ↔ &harr;, ⇔ &hArr;, ♥ &hearts;, … &hellip;, Í &Iacute;, í &iacute;, Π&Icirc;, î &icirc;, ¡ &iexcl;, Ì &Igrave;, ì &igrave;, ℑ &image;, ∞ &infin;, ∫ &int;, Ι &Iota;, ι &iota;, ¿ &iquest;, ∈ &isin;, Ï &Iuml;, ï &iuml;, Κ &Kappa;, κ &kappa;, Λ &Lambda;, λ &lambda;, 〈 &lang;, « &laquo;, ← &larr;, ⇐ &lArr;, ⌈ &lceil;, “ &ldquo;, ≤ &le;, ⌊ &lfloor;, ∗ &lowast;, ◊ &loz;, ‎ &lrm;, ‹ &lsaquo;, ‘ &lsquo;, < &lt;, ¯ &macr;, — &mdash;, µ &micro;, · &middot;, − &minus;, Μ &Mu;, μ &mu;, ∇ &nabla;,   &nbsp;, – &ndash;, ≠ &ne;, ∋ &ni;, ¬ &not;, ∉ &notin;, ⊄ &nsub;, Ñ &Ntilde;, ñ &ntilde;, Ν &Nu;, ν &nu;, Ó &Oacute;, ó &oacute;, Ô &Ocirc;, ô &ocirc;, Œ &OElig;, œ &oelig;, Ò &Ograve;, ò &ograve;, ‾ &oline;, Ω &Omega;, ω &omega;, Ο &Omicron;, ο &omicron;, ⊕ &oplus;, ∨ &or;, ª &ordf;, º &ordm;, Ø &Oslash;, ø &oslash;, Õ &Otilde;, õ &otilde;, ⊗ &otimes;, Ö &Ouml;, ö &ouml;, ¶ &para;, ∂ &part;, ‰ &permil;, ⊥ &perp;, Φ &Phi;, φ &phi;, Π &Pi;, π &pi;, ϖ &piv;, ± &plusmn;, £ &pound;, ′ &prime;, ″ &Prime;, ∏ &prod;, ∝ &prop;, Ψ &Psi;, ψ &psi;, " &quot;, √ &radic;, 〉 &rang;, » &raquo;, → &rarr;, ⇒ &rArr;, ⌉ &rceil;, ” &rdquo;, ℜ &real;, ® &reg;, ⌋ &rfloor;, Ρ &Rho;, ρ &rho;, ‏ &rlm;, › &rsaquo;, ’ &rsquo;, ‚ &sbquo;, Š &Scaron;, š &scaron;, ⋅ &sdot;, § &sect;, ­ &shy;, Σ &Sigma;, σ &sigma;, ς &sigmaf;, ∼ &sim;, ♠ &spades;, ⊂ &sub;, ⊆ &sube;, ∑ &sum;, ⊃ &sup;, ¹ &sup1;, ² &sup2;, ³ &sup3;, ⊇ &supe;, ß &szlig;, Τ &Tau;, τ &tau;, ∴ &there4;, Θ &Theta;, θ &theta;, ϑ &thetasym;,   &thinsp;, Þ &THORN;, þ &thorn;, ˜ &tilde;, × &times;, ™ &trade;, Ú &Uacute;, ú &uacute;, ↑ &uarr;, ⇑ &uArr;, Û &Ucirc;, û &ucirc;, Ù &Ugrave;, ù &ugrave;, ¨ &uml;, ϒ &upsih;, Υ &Upsilon;, υ &upsilon;, Ü &Uuml;, ü &uuml;, ℘ &weierp;, Ξ &Xi;, ξ &xi;, Ý &Yacute;, ý &yacute;, ¥ &yen;, ÿ &yuml;, Ÿ &Yuml;, Ζ &Zeta;, ζ &zeta;, ‍ &zwj;, ‌ &zwnj;.
- (Jim Gettman)

--

Peter Blaise responds:

THANKS Jim! How about in table form, also?

Á &Aacute; á &aacute;  &Acirc; â &acirc;
´ &acute; Æ &AElig; æ &aelig; À &Agrave;
à &agrave; ℵ &alefsym; Α &Alpha; α &alpha;
& &amp; ∧ &and; ∠ &ang; Å &Aring;
å &aring; ≈ &asymp; à&Atilde; ã &atilde;
Ä &Auml; ä &auml; „ &bdquo; Β &Beta;
β &beta; ¦ &brvbar; • &bull; ∩ &cap;
Ç &Ccedil; ç &ccedil; ¸ &cedil; ¢ &cent;
Χ &Chi; χ &chi; ˆ &circ; ♣ &clubs;
≅ &cong; © &copy; ↵ &crarr; ∪ &cup;
¤ &curren; † &dagger; ‡ &Dagger; ↓ &darr;
⇓ &dArr; ° &deg; Δ &Delta; δ &delta;
♦ &diams; ÷ &divide; É &Eacute; é &eacute;
Ê &Ecirc; ê &ecirc; È &Egrave; è &egrave;
∅ &empty;   &emsp;   &ensp; Ε &Epsilon;
ε &epsilon; ≡ &equiv; Η &Eta; η &eta;
Р&ETH; ð &eth; Ë &Euml; ë &euml;
€ &euro; ∃ &exist; ƒ &fnof; ∀ &forall;
½ &frac12; ¼ &frac14; ¾ &frac34; ⁄ &frasl;
Γ &Gamma; γ &gamma; ≥ &ge; > &gt;
↔ &harr; ⇔ &hArr; ♥ &hearts; … &hellip;
Í &Iacute; í &iacute; Π&Icirc; î &icirc;
¡ &iexcl; Ì &Igrave; ì &igrave; ℑ &image;
∞ &infin; ∫ &int; Ι &Iota; ι &iota;
¿ &iquest; ∈ &isin; Ï &Iuml; ï &iuml;
Κ &Kappa; κ &kappa; Λ &Lambda; λ &lambda;
〈 &lang; « &laquo; ← &larr; ⇐ &lArr;
⌈ &lceil; “ &ldquo; ≤ &le; ⌊ &lfloor;
∗ &lowast; ◊ &loz; ‎ &lrm; ‹ &lsaquo;
‘ &lsquo; < &lt; ¯ &macr; — &mdash;
µ &micro; · &middot; − &minus; Μ &Mu;
μ &mu; ∇ &nabla;   &nbsp; – &ndash;
≠ &ne; ∋ &ni; ¬ &not; ∉ &notin;
⊄ &nsub; Ñ &Ntilde; ñ &ntilde; Ν &Nu;
ν &nu; Ó &Oacute; ó &oacute; Ô &Ocirc;
ô &ocirc; Œ &OElig; œ &oelig; Ò &Ograve;
ò &ograve; ‾ &oline; Ω &Omega; ω &omega;
Ο &Omicron; ο &omicron; ⊕ &oplus; ∨ &or;
ª &ordf; º &ordm; Ø &Oslash; ø &oslash;
Õ &Otilde; õ &otilde; ⊗ &otimes; Ö &Ouml;
ö &ouml; ¶ &para; ∂ &part; ‰ &permil;
⊥ &perp; Φ &Phi; φ &phi; Π &Pi;
π &pi; ϖ &piv; ± &plusmn; £ &pound;
′ &prime; ″ &Prime; ∏ &prod; ∝ &prop;
Ψ &Psi; ψ &psi; " &quot; √ &radic;
〉 &rang; » &raquo; → &rarr; ⇒ &rArr;
⌉ &rceil; ” &rdquo; ℜ &real; ® &reg;
⌋ &rfloor; Ρ &Rho; ρ &rho; ‏ &rlm;
› &rsaquo; ’ &rsquo; ‚ &sbquo; Š &Scaron;
š &scaron; ⋅ &sdot; § &sect; ­ &shy;
Σ &Sigma; σ &sigma; ς &sigmaf; ∼ &sim;
♠ &spades; ⊂ &sub; ⊆ &sube; ∑ &sum;
⊃ &sup; ¹ &sup1; ² &sup2; ³ &sup3;
⊇ &supe; ß &szlig; Τ &Tau; τ &tau;
∴ &there4; Θ &Theta; θ &theta; ϑ &thetasym;
  &thinsp; Þ &THORN; þ &thorn; ˜ &tilde;
× &times; ™ &trade; Ú &Uacute; ú &uacute;
↑ &uarr; ⇑ &uArr; Û &Ucirc; û &ucirc;
Ù &Ugrave; ù &ugrave; ¨ &uml; ϒ &upsih;
Υ &Upsilon; υ &upsilon; Ü &Uuml; ü &uuml;
℘ &weierp; Ξ &Xi; ξ &xi; Ý &Yacute;
ý &yacute; ¥ &yen; ÿ &yuml; Ÿ &Yuml;
Ζ &Zeta; ζ &zeta; ‍ &zwj; ‌ &zwnj;
-- Peter Blaise peterblaise 15:51, 21 June 2007 (UTC)

[edit] Mozilla browser column formatting - does not render in IE, not appropriate for majority of MediaWiki users

Description You type You get
Double Column Layout <div style="-moz-column-count:2; column-count:2;"> * first col, item A * first col, item B * second col, item A * second col, item B </div>
  • first col, item A
  • first col, item B
  • second col, item A
  • second col, item B

-- by 2007-07-03T06:28:45 89.0.49.209



[edit] Add infobox to wikipage

how do i add the "infobox" extension (is infobox an extension?) to my wikipage? i tried to search but i couldnt find it.. i want to make the 'biography page' but i cant seem to find the "right-aligned-box" that can display pictures, info etc.. how do i do this? and my toolbox also limited.. how do i add more buttons? such as tables etc2..

--Hailmunan 01:37, 5 July 2007 (UTC)

[edit] Levels

Isn't there also a =Level 1= layer. It's not on the formatting page. --Wayne (13:00 UTC 8 Aug 2007)

Yes, there is such a level. I added a note describing how its use is discouraged. I was trying not to clutter the document by using a footnote but please improve on my edit if you can. -Jarsyl 00:34, 27 August 2007 (UTC)

[edit] some, but not all HTML tags

I want to enable tags like <abbr>, <acronym>, and <fieldset> HTML tags but not all HTML tags. How can I do this? —Eek 05:20, 14 September 2007 (UTC)

Well, since no one responded, I went looking on my own and just added them to ..includes/Sanitzer.php. —Eek 07:41, 16 September 2007 (UTC)

[edit] Headings of different sizes

Wouldn't it be better to call that Headings of different levels? Type size is a stylesheet matter. Level is a markup matter. RoySmith 12:30, 12 October 2007 (UTC)

Good idea. I changed it to that based on your suggestion. --Lance E Sloan 15:30, 20 November 2007 (UTC)

[edit] Alternative To HTML BR Tags

I think the formatting should allow an alternative to using the <br> HTML tag for making list items span multiple lines. One of the things that many people like about wikis is the lack of HTML tags for most formatting. That makes formatting seem "simpler", at least for people who don't know HTML. It would be nice to extend that as much as possible. --Lance E Sloan 17:43, 16 November 2007 (UTC)

[edit] Add Monospace Formatting?

I think the page should include an example of monospace formatting, with <tt>. I also think that there should be some kind of formatting for monospace that doesn't require the use of HTML tags. How does one go about proposing a new format string and getting it accepted/approved by the MediaWiki maintainers? --Lance E Sloan 16:09, 5 December 2007 (UTC)

[edit] Closing HTML tag not parsed as HTML?

Dear,

I am having Mediawiki v1.11.0 on my local network.. and whenever i put some closing html tags in my page like </div> without its opening tag, the closing tag is displayed as is (converted to normal text and not acting as html tag). My wiki is in Arabic language. This usually happen since i have some templates that has the opening tag and the other template has the closing tag. somthing like:

{{Header}} = <div>
{{Body}} = Bla Bla Bla
{{Footer}} = </div>

then having a page with the contents

{{Header}}{{Body}}{{Footer}} 

end up like this displayed in that page.

Bla Bla Bla</div>

Is this a bug?! or a sitting or something else? please help. --212.71.37.74 12:28, 14 December 2007 (UTC)

I can well imagine that the Mediawiki parser will not let you get away with these kinds of tricks. I guess the parser is resolving the 'header' template first, and deciding that there's a open div with a missing close div (</div>), so that gets added automatically somewhere higher up. Then when it gets to the footer template, it encounters close div but no open div, so it spits that out as plain text.
Basically it wont let you do that kind of thing, because of the various checks it does to ensure complete and correct HTML output. Mediawiki deliberately does not give you full HTML level flexibility, in order to be robust against users accidentally or maliciously outputting bad HTML.
A workaround I can think of, would be to write a little extension (bit of php code) which does nothing but output the raw HTML you want (just a start div, and another one outputing the end div). Bit of messy solution perhaps.
-- Harry Wood 11:35, 17 December 2007 (UTC)

[edit] Wiki Formatting Should Not Parse HTML - with the exception of sanitizing unwanted tags

I've been fighting with MediaWiki to create a template for showing the contents for a linux config file. The template basically shows a div containing the filename and an area showing the contents of that file.

Here's where the problems begin... Normally a pre tag would be the best scenario for this as the text file can be pasted in without having to add break tags.

e.g. <pre>{{{2}}}</pre>

However since MediaWiki parses HTML tags it sees the pre tag and then ignore the wiki code inside the pre tag.

Round two: My next attempt was to put it in a div tag. <div style="font-family: monospace">{{{2}}}</div>. Now since this was a linux config file comments begin with a # character. MediaWiki Was seeing this as a Numbered List and formatting it as such. Also since this was no longer preformatted text the text had to be modified to include a line break at the end of every line. the nowiki tag obviously cannot be used to fix this problem as the {{{2}}} parameter would not get parsed.

Round three: In the end I had to rewrite the data to as it was being inputted as a parameter to include the nowiki tag and line breaks. Leading a mess.

Here's now how the template is being called:

{{Box File|/target/etc/apt/sources.list| <nowiki>deb http://ie.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse</nowiki><br />
<br />
<nowiki>deb http://ie.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse </nowiki><br />
<br />
<nowiki>deb http://security.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse </nowiki><br />
<nowiki>deb-src http://security.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse </nowiki><br />
<br /><br /> <nowiki># deb http://ie.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse </nowiki><br />
<nowiki># deb-src http://ie.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse </nowiki><br />
<br />
<nowiki># deb http://archive.canonical.com/ubuntu hardy partner </nowiki><br />
<nowiki># deb-src http://archive.canonical.com/ubuntu hardy partner</nowiki><br /><br />
<nowiki>deb http://ppa.launchpad.net/ubuntu-mobile/ubuntu hardy main restricted universe</nowiki><br />
<nowiki>deb-src http://ppa.launchpad.net/ubuntu-mobile/ubuntu hardy main restricted universe</nowiki>
}}

Personal tools