Help:Editing: Difference between revisions
→Social aspects: the "two [hyphens]" are but an typewriter/ASCII substitute for a dash |
m Fix double redirect |
||
| (20 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Wikis should be easy to edit, so most text you add or change will appear as you expect it. But you can do more if you want. | Wikis should be easy to edit, so most text you add or change will appear as you expect it. But you can do more if you want. | ||
[https://wikiindex.org/Xenharmonic_Wiki This wiki] is currently in [https://wikiindex.org/Category:ConfirmEmail ConfirmEmail mode] after the move from Wikispaces to a MediaWiki-based installation (the edit mode may change again some time). For editing or adding information to the wiki, you have to join it. See [[How to | [https://wikiindex.org/Xenharmonic_Wiki This wiki] is currently in [https://wikiindex.org/Category:ConfirmEmail ConfirmEmail mode] after the move from Wikispaces to a MediaWiki-based installation (the edit mode may change again some time). For editing or adding information to the wiki, you have to join it. See [[Help:How to get your Xenharmonic Wiki account]] for more! | ||
== Using links == | == Using links == | ||
| Line 48: | Line 48: | ||
Some typographic markup can easy be added by including the phrase in doubled <code><nowiki>''</nowiki></code> or tripled <code><nowiki>'''</nowiki></code> (apostrophe chars): | Some typographic markup can easy be added by including the phrase in doubled <code><nowiki>''</nowiki></code> or tripled <code><nowiki>'''</nowiki></code> (apostrophe chars): | ||
* '''Bold''' using <code> | * '''Bold''' using <code><nowiki>'''bold'''</nowiki></code> | ||
* ''Italic'' using <code> | * ''Italic'' using <code><nowiki>''italic''</nowiki></code> | ||
* '''''Bold italic''''' using <code>{{'''}}{{'' | * '''''Bold italic''''' using <code><nowiki>'''''bold italic'''''</nowiki></code> | ||
=== Preformatted text === | |||
==== Code ==== | |||
<code><<nowiki />code></code> can be used to include small snippets of source code, variable names, or {{w|regex}}es within a line of normal text. All Wiki markup within is interpreted as markup except for text in <code><nowiki></code> tags. | |||
==== Pre ==== | |||
<code><<nowiki />pre></code> tags define preformatted text that is displayed in a monospace font and enclosed in a dashed box. It doubles as both a parser tag and an HTML tag, since the parser will escape all HTML-like and wiki markup tags and preserve spaces and line breaks, but HTML elements are parsed. | |||
For example: | |||
<syntaxhighlight lang="wikitext"> | |||
<pre> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
</syntaxhighlight> | |||
gives | |||
<pre> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
It is also possible to use Wiki markup within <code><<nowiki />pre></code> tags, and have it actually be interpreted as markup instead of being escaped. This can be done by inserting an <code>includeonly</code> directive in the opening tag, as <code style="white-space: nowrap;"><includeonly /></code> or (as seen on Wikipedia and many other sites) <code style="white-space: nowrap;"><includeonly></includeonly></code>, as follows: | |||
<syntaxhighlight lang="wikitext"> | |||
<pre<includeonly />> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
</syntaxhighlight> | |||
gives | |||
<pre<includeonly />> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
The <code><<nowiki />pre></code> tag also accepts styling, just like other HTML elements. Here, if you use the aformentioned <code>includeonly</code> directive, the styling should come after the directive: | |||
<syntaxhighlight lang="wikitext"> | |||
<pre<includeonly /> style="color: blue;"> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
</syntaxhighlight> | |||
gives | |||
<pre<includeonly /> style="color: blue;"> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</pre> | |||
==== Syntax highlighting ==== | |||
[[mw:extension:SyntaxHighlight|Syntax highlighting]] is a feature to display source code in different colors and fonts to indicate the structure to readers. Wrap the desired code between <code><<nowiki />syntaxhighlight></code> tags and input the desired programming language using the <code>lang</code> parameter in the opening tag. Unlike in <code><<nowiki />code></code> and <code><<nowiki />pre></code> tags, everything is escaped. | |||
For example: | |||
{{#tag: syntaxhighlight | |||
|{{^(}}syntaxhighlight lang="wikitext"{{)^}} | |||
{{^(}}!-- Comment --{{)^}} | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
{{^(}}/syntaxhighlight{{)^}} | |||
|lang = wikitext | |||
}} | |||
gives | |||
<syntaxhighlight lang="wikitext"> | |||
<!-- Comment --> | |||
[[Wiki]] markup & '''bold''' ''italic'' text | |||
</syntaxhighlight> | |||
=== Lists === | === Lists === | ||
| Line 95: | Line 177: | ||
You can add tables to wiki pages: | You can add tables to wiki pages: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |||
! You write<br />in [[Help:Wikitext editor|wikitext]] | ! You write<br />in [[Help:Wikitext editor|wikitext]] | ||
| | | style="border-right: none;" | | ||
<pre> | |||
{| class="wikitable" | {| class="wikitable" | ||
|+ Caption | |+ Caption text | ||
|- | |- | ||
! Head A | ! Head A | ||
| Line 119: | Line 203: | ||
| Cell B4 | | Cell B4 | ||
| Cell C4 | | Cell C4 | ||
|}</pre> | |} | ||
| | </pre> | ||
| style="border-left: none; border-right: none;" | or | |||
| style="border-left: none;" | | |||
<pre> | |||
{| class="wikitable" | {| class="wikitable" | ||
|+ Caption | |+ Caption text | ||
|- | |- | ||
! Head A !! Head B !! Head C | ! Head A !! Head B !! Head C | ||
| Line 133: | Line 220: | ||
|- | |- | ||
| Cell A4 || Cell B4 || Cell C4 | | Cell A4 || Cell B4 || Cell C4 | ||
|}</pre> | |} | ||
</pre> | |||
|- | |- | ||
! You get<br />(rendered) | ! You get<br />(rendered) | ||
<!-- Begin result --> | <!-- Begin result --> | ||
| colspan=" | | colspan="3" | {{(!}} class{{=}}"wikitable" style{{=}}"margin: 20px auto 20px auto;" | ||
{{(!}} class{{=}}"wikitable" style{{=}}"margin: 20px auto 20px auto;" | {{!+}} Caption text | ||
{{!+}} Caption | |||
{{!-}} | {{!-}} | ||
! Head A !! Head B !! Head C | ! Head A !! Head B !! Head C | ||
| Line 154: | Line 241: | ||
|} | |} | ||
You can also copy some cells from a spreadsheet and paste them into the | You can also copy some cells from a spreadsheet and paste them into the [[mw:Extension:VisualEditor|visual editor]], and a table will automatically be created. Though, users should be aware that the resulting Wiki markup generated by the visual editor is often poorly formatted (e.g. without spaces that would otherwise make it easier to read). | ||
==== Horizontal alignment of column content ==== | ==== Horizontal alignment of column content ==== | ||
| Line 192: | Line 279: | ||
== References == | == References == | ||
<references/> | <references /> | ||
</pre> | </pre> | ||
| Line 206: | Line 293: | ||
{{Wikipedia|Wikipedia: Subpages}} | {{Wikipedia|Wikipedia: Subpages}} | ||
'''Subpages''' are pages whose title contains one or more slashes ("/"). In general, every subpage includes a breadcrumb link at the top, allowing the reader to navigate to the parent page (and further if there are multiple levels of subpages). However, the subpage feature is disabled in the main namespace, mainly to prevent rational interval pages (e.g. [[3/2]]) from including a breadcrumb link to a nonexistent page. | '''Subpages''' are pages whose title contains one or more slashes ("/"). In general, every subpage includes a breadcrumb link at the top, allowing the reader to navigate to the parent page (and further if there are multiple levels of subpages). However, the subpage feature is disabled in the main namespace, mainly to prevent rational interval pages (e.g. [[3/2]]) from incorrectly including a breadcrumb link to a nonexistent page. | ||
Subpages can nonetheless be used in the main namespace in certain circumstances, such as: | |||
* Splitting large sections; e.g. [[Color notation/Temperament names]] | * Splitting large sections; e.g. [[Color notation/Temperament names]] | ||
* Splitting large tables or lists; e.g. [[17edo/Music]] | * Splitting large tables or lists; e.g. [[17edo/Music]] | ||
* Splitting personal approaches; e.g. [[22edo/Eliora's approach]] | * Splitting personal approaches; e.g. [[22edo/Eliora's approach]] | ||
In subpages, a link to the main page should be added manually, either in the page's first sentence, in a hatnote using [[Template:Main]], or by putting | In subpages, a link to the main page should be added manually, either in the page's first sentence, in a hatnote using [[Template:Main]], or by putting {{tlx|breadcrumb}} at the top of the page. | ||
== Categories == | == Categories == | ||