×
Create a new article
Write your page title here:
We currently have 3,036 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,036Articles

Help:Formatting: Difference between revisions

(remove note about spoiler not working, it seems fully functional)
(remove name column from characters table)
Line 15: Line 15:


==Full List==
==Full List==
{| class="wikitable sortable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|+ <h3>Characters</h3>
|+ <h3>Characters</h3>
!style="width:6ch"|Character
!style="width:6ch"|Character
!style="width:10ch"|Name
!Usage
!class="unsortable"|Usage
|-
|-
|style="text-align: center;"|&num;<br>U+0023<br>&amp;num;
|style="text-align: center;"|&num;<br>U+0023<br>&amp;num;
|Number Sign
|The number sign, also called a pound or hash symbol. The HTML entity can allow escaping certain situations.
|The number sign, also called a pound or hash symbol. The HTML entity can allow escaping certain situations.
|-
|-
|style="text-align: center;"|&amp;<br>U+0023<br>&amp;amp;
|style="text-align: center;"|&amp;<br>U+0023<br>&amp;amp;
|Ampersand
|Ampersand, usually called the ''and'' symbol. The HTML entity can allow escaping certain situations. Used in this table to present the HTML entities.
|Usually called the ''and'' symbol. The HTML entity can allow escaping certain situations. Used in this table to present the HTML entities.
|-
|-
|style="text-align: center;"|&comma;<br>U+002C<br>&amp;comma;
|style="text-align: center;"|&comma;<br>U+002C<br>&amp;comma;
|Comma
|Commas are usually chosen as the separator for fields in arrays or {{t|TextSpace}}. The HTML entity allows can prevent this, although nowiki tags are a safer option.
|Commas are usually chosen as the separator for fields in arrays or {{t|TextSpace}}. The HTML entity allows can prevent this, although nowiki tags are a safer option.
|-
|-
|style="text-align: center;"|&VerticalLine;<br>U+007C<br>&amp;VerticalLine;<br>&amp;#124;
|style="text-align: center;"|&VerticalLine;<br>U+007C<br>&amp;VerticalLine;<br>&amp;#124;
|Vertical Line
|The pipe character, also called the vertical line or bar, is used extensively for Mediawiki parsing. The HTML entity escapes these situations. To delay the parsing instead of prevent it completely, use <code><nowiki>{{!}}</nowiki></code>.
|The pipe character, also called the vertical line or bar, is used extensively for Mediawiki parsing. The HTML entity escapes these situations. To delay the parsing instead of prevent it completely, use <code><nowiki>{{!}}</nowiki></code>.
|-
|-
|style="text-align: center;"|·<br>U+00B7<br>&amp;middot;<br>&amp;centerdot;
|style="text-align: center;"|·<br>U+00B7<br>&amp;middot;<br>&amp;centerdot;
|Middle Dot
|Solid dot that is in the middle of a line.
|Solid dot that is in the middle of a line.
|-
|-
|style="text-align: center;"|←<br>U+2190<br>&amp;larr;
|style="text-align: center;"|←<br>U+2190<br>&amp;larr;
|Leftwards Arrow
|Leftwards arrow as one character.
|Leftwards arrow as one character.
|-
|-
|style="text-align: center;"|↑<br>U+2191<br>&amp;uarr;
|style="text-align: center;"|↑<br>U+2191<br>&amp;uarr;
|Upwards Arrow
|Upwards arrow as one character. Can be used for "to top" links.
|Upwards arrow as one character. Can be used for "to top" links.
|-
|-
|style="text-align: center;"|→<br>U+2192<br>&amp;rarr;
|style="text-align: center;"|→<br>U+2192<br>&amp;rarr;
|Rightwards Arrow
|Rightwards arrow as one character. Used when listing directions on [[:Category:Locations|location pages]].
|Rightwards arrow as one character. Used when listing directions on [[:Category:Locations|location pages]].
|-
|-
|style="text-align: center;"|↔<br>U+2194<br>&amp;harr;
|style="text-align: center;"|↔<br>U+2194<br>&amp;harr;
|Left Right Arrow
|Arrow that points both left and right. Can be used to show a relation between two elements.
|Arrow that points both left and right. Can be used to show a relation between two elements.
|-
|-
|style="text-align: center;"|∕<br>U+2215
|style="text-align: center;"|∕<br>U+2215
|Division Slash
|Division slash, which appears to be a forward slash. Since it has the same appearance but no function, it can help with presenting HTML.
|Appears to be a forward slash. Since it has the same appearance but no function, it can help with presenting HTML.
|-
|-
|style="text-align: center;"|<<br>U+FF1C
|style="text-align: center;"|<<br>U+FF1C
|Fullwidth Less-Than Sign
|Fullwidth less-than sign. Presented wider than the normal one <.
|Fake less-than > symbol. Presented wider than the normal one.
|-
|-
|style="text-align: center;"|><br>U+FF1E
|style="text-align: center;"|><br>U+FF1E
|Fullwidth Greater-Than Sign
|Fullwidth greater-than sign >. Presented wider than the normal one >.
|Fake greater-than > symbol. Presented wider than the normal one.
|}
|}



Revision as of 17:57, 27 June 2024

This page lists formatting codes or tricks that can be used to help format wiki pages. It includes MediaWiki tags, table formatting, and HTML tags.

Basic List

This section lists the high-use formatting that is most likely to be useful when editing.

Full List

Characters

Character Usage
#
U+0023
&num;
The number sign, also called a pound or hash symbol. The HTML entity can allow escaping certain situations.
&
U+0023
&amp;
Ampersand, usually called the and symbol. The HTML entity can allow escaping certain situations. Used in this table to present the HTML entities.
,
U+002C
&comma;
Commas are usually chosen as the separator for fields in arrays or {{TextSpace}}. The HTML entity allows can prevent this, although nowiki tags are a safer option.
|
U+007C
&VerticalLine;
&#124;
The pipe character, also called the vertical line or bar, is used extensively for Mediawiki parsing. The HTML entity escapes these situations. To delay the parsing instead of prevent it completely, use {{!}}.
·
U+00B7
&middot;
&centerdot;
Solid dot that is in the middle of a line.

U+2190
&larr;
Leftwards arrow as one character.

U+2191
&uarr;
Upwards arrow as one character. Can be used for "to top" links.

U+2192
&rarr;
Rightwards arrow as one character. Used when listing directions on location pages.

U+2194
&harr;
Arrow that points both left and right. Can be used to show a relation between two elements.

U+2215
Division slash, which appears to be a forward slash. Since it has the same appearance but no function, it can help with presenting HTML.

U+FF1C
Fullwidth less-than sign. Presented wider than the normal one <.

U+FF1E
Fullwidth greater-than sign >. Presented wider than the normal one >.

General

Code Example Input Output Explanation
<nowiki></nowiki> <nowiki>'''text'''</nowiki> '''text''' Escapes wiki markup and stops formatting code like <pre> from being recognized.
<pre></pre> <pre>text</pre>
text
Completely preformats text. All wiki markup, template calls, links, parser functions, HTML codes, and comments are completely ignored and are treated as raw text.
<pre style="color: red">text</pre>
text
You can add HTML styles to preformatted text, like with divs and spans.
<pre style="font-family:monospace;">text</pre>
text
Create monospaced blocks using CSS.
<code></code> <code>text</code> text Applies a background like with the <pre></pre> tags.
<u></u> <u>text</u> text Underlines text.
<mark></mark> <mark>text</mark> text Highlight text.
<span class="spoiler"></span> <span class="spoiler">text </span> text Hides text underneath a spoiler. Visible when selecting it on PC or tapping it on mobile.
<center></center> <center>text</center>
text
Centers inline elements in the container.
<sup></sup> text<sup>text</sup> texttext Superscript.
<sub></sub> text<sub>text</sub> texttext Subscript.
<small></small> <small>text</small> text Makes text smaller.
<big></big> <big>text</big> text Makes text bigger.
<h3></h3> <h3>ctrt</h3> (blanked) Defines a header using HTML, equivalent to ===this=== in wikitext. The number defines the header level from 1-6. Links to the header will work and it will appear in the TOC.
<br> text1<br>text2 text1
text2
Places a line break in text.
<br clear=all> [[File:Cagedfairy.png |thumb|right|Text]] <br clear=all> text
Text

text
Places a line break whilst forcing following elements to only appear after preceding elements are fully shown.
[[File:Cagedfairy.png |thumb|right|Text]] text
Text
text
The same example without <br clear=all>, for reference.
<blockquote></blockquote> <blockquote>text </blockquote>

text

Presents text in a blockquote (indent)
<span id=""></span> <span id="aexgda"></span> Include anywhere on the page to create an invisible link anchor: Help:Formatting#aexgda. This can be placed within a header (inside of the equal signs) to make an alternate header link.
<!----> <!--text--> Comments. Completely hidden from the page, but visible when editing.

HTML Styles and Classes

Style/Class Example Input Output Explanation
style="text-align: center;" <div style="text-align: center;">text</div>
text
This div style centers inline elements in a container. Equivalent to using <center>.
style="-webkit-column-count:2;column-count:2;" <div style="-webkit-column-count:2;column-count:2;">text1 text2 text3</div>
text1

text2

text3
Formats text into the specified number of columns. (the "-webkit-column-count:2;" seems to be useless, but it might be needed for special cases)
style="display: flex; flex-direction: row;" <div style="display: flex; flex-direction: row;"><gallery widths=40 heights=40> Cagedfairy.png|Text </gallery>[[File:Boyoutline.png |thumb|Text]]</div>
Text
Present divs in a row. In the example it shows that you can place an element next to a gallery, which is usually not possible.

Collapsible Sections

class="mw-collapsible" <div class="mw-collapsible">text1 <br>text2</div>
text1
text2
Allows text to be collapsed.
class="mw-collapsible mw-collapsed" <div class="mw-collapsible mw-collapsed">text1 <br>text2</div>
text1
text2
Adding mw-collapsed makes it collapsed by default. Note: a page anchor within the collapsed element will have it automatically open when you follow the link.
class="toccolours mw-collapsible" <div class="toccolours mw-collapsible">text1 <br>text2</div>
text1
text2
Adding toccolours gives the content the style of the table of contents (hence toccolours).
class="mw-collapsible-content" <div class="toccolours mw-collapsible mw-collapsed">text1<div class="mw-collapsible-content">text2</div></div>
text1
text2
Use a separate div within the collapsible content one to define this inner div as the content to be collapsed. The text in the outer div but not the inner becomes a header for the collapsible content.
class="mw-collapsible-toggle" <div class="mw-collapsible"> <div class="mw-collapsible-toggle mw-collapsible-text">[Show/Hide]</div> <div class="mw-collapsible-content" >text </div></div>
[Show/Hide]
text
You can create and modify a custom button for the collapsible text. Unfortunately, it won't change depending on the state of the content.

List Formatting

Code Example Input Output Explanation
<ul> </ul> <ul> text1 text2<br>text 3 text 4</ul>
    text1 text2
    text3 text4
Text is formatted in an unordered list.
<div style="text-align: center;"><ul> text1<br>text2 </ul></div>
    text1
    text2
You can place the list in a div to apply div styles to the whole list. Useful to center images in a list.
<li> </li> <li>text1</li> <li>text2</li>
  • text1
  • text2
  • Gives text elements the style of being in a list. More importantly, allows to separate them into groups.
    <ul> <li> </li> </ul> <ul> <li>text1</li> <li>text2</li> </ul>
    • text1
    • text2
    The combination of the two gives the best output. <li> </li> is used to separate the two.
    style="display: inline-block;" <ul> <li style="display: inline-block;> [[File:Cagedfairy.png |thumb|Text]] </li> <li style="display: inline-block;"> [[File:Boyoutline.png |thumb|Text]] </li> </ul>
    • Text
    • Text
    This list style forces floating elements such as image thumbs to appear on the same line, even if they are otherwise unable.
    style="vertical-align: middle;" <ul> <li style="display: inline-block; vertical-align: middle;"> [[File:Cagedfairy.png |thumb|Text]] </li> <li style="display: inline-block; vertical-align: middle;"> [[File:Boyoutline.png |thumb|Text]] </li> </ul>
    • Text
    • Text
    This list style can be used in addition to the previous one to align the elements to the top, middle, or bottom of the lines they are occupying.

    Tables

    Code Usage
    class="wikitable" Use at the table start to make it look like a standard table.
    class="sortable" Adding this class to a table will allow you to sort the entire table columns of your choice.
    class="mw-collapsible mw-collapsed" This will allow the table to be collapsed. Removing mw-collapsed means it will be expanded by default. A table header specified using |+Header will be shown next to the expand/collapse button.
    class="unsortable" This class can be used on column headers to disable sorting the table by that column.
    style="width: 100%;" At the table start, forces the table to fit a percentage of the screen width.
    At the first row of a column, forces that column to fit a percentage of the table width.
    style="text-align: center;" At the table start, centers all text in the table.
    On a table cell, centers the cell contents.
    style="vertical-align: top;" Change the vertical alignment of elements in a cell (the default is middle).

    Other

    Code Usage
    resultsheader= «pre»«nowiki»|resultsfooter= «/nowiki»«/pre» Add to the end of a DPL parser function and the output will be unformatted.