Difference between revisions 23961 and 23963 on zhwikivoyageWikivoyage uses a special code called '''Wiki markup''' for formatting the text and images in an article. The Wiki markup used while [[Project:如何编辑页面|如何编辑页面]] will determine how the text looks and what links and images are in the page.
When editing Wikivoyage articles, try to follow the conventions in the [[Project:格式手册|格式手册]]. These are guidelines for making a "good" Wikivoyage article; if you don't quite get all of them, then just do what you can, and someone else will come through and clean up your work after you're done.
==Text formatting==
{| width="100%" class="wikitable"
! To get this output...
! ...use this markup.
|-
|
'''Bold text''' is surrounded by three apostrophes.
| <nowiki>'''Bold text''' is surrounded by three apostrophes.</nowiki>
|-
|
''Italic text'' is surrounded by two apostrophes.
| <nowiki>''Italic text'' is surrounded by two apostrophes.</nowiki>
|-
|
For a bullet-point list, put each list item on its own line, with a star in front of it:
*Winken
*Blinken
*Nod
|
For a bullet-point list, put each list item on its own line,
with a star in front of it:
*Winken <br/>
*Blinken <br/>
*Nod <br/>
|-
|
A numbered list is similar to a bullet-point list, but each item starts with a hash symbol instead:
#Tinker
#Evers
#Chance
|
A numbered list is similar to a bullet-point list, but each item
starts with a hash symbol sign instead:
#Tinker <br/>
#Evers <br/>
#Chance <br/>
|}
==Making links==
{| width="100%" class="wikitable"
! To get this output...
! ...use this markup.
|-
|
You can link to an article like [[首页]] by adding the article title with two square brackets around it.
| <nowiki>You can link to an article like [[首页]] by adding the article title with two square brackets around it.</nowiki>
|-
|
You can give the link alternate text, like [[首页|去首页]], by adding a vertical bar after the title, and then the text you want to use.
| <nowiki>You can give the link alternate text, like [[首页|去首页]], by adding a vertical bar after the title, and then the text you want to use.</nowiki>
|-
|
Links in different namespaces, like [[Project:FAQ]] or [[User:EvanProdromou]], work the same way.
| <nowiki>Links in different namespaces, like [[Project:FAQ]] or [[User:EvanProdromou]], work the same way.</nowiki>
|-
|
Using a vertical bar at the end of the link (but before the closing brackets) will hide the namespace, like [[Project:FAQ|FAQ]] or [[User:EvanProdromou|EvanProdromou]].
| <nowiki>Using a vertical bar at the end of the link (but before the closing brackets) will hide the namespace, like [[Project:FAQ|]] or [[User:EvanProdromou|]].
</nowiki>
|-
|
It's OK to put in links to [[不存在的页面]].
| <nowiki>
It's OK to put in links to [[不存在的页面]].
</nowiki>
|-
|
Putting a URL like http://www.google.com/ into text makes it into a clickable external hyperlink automatically.
| <nowiki>Putting a URL like http://www.google.com/ into text makes it into a clickable external hyperlink automatically.</nowiki>
|-
|
You can give an external hyperlink more readable and helpful text like [http://www.google.com/ Google], by using a single square bracket, the URL, a space, your chosen text, and a closing square bracket.
| <nowiki>You can give an external hyperlink more readable and helpful text like [http://www.google.com/ Google], by using a single square bracket, the URL, a space, your chosen text, and a closing square bracket.</nowiki>
|}
===Special links===
Links to articles on the same topic in some special namespaces appear, not in the article itself, but in the "Related sites" and "In other languages" sidebars. These links go at the end of the article, in this order:
* Links to [[Project:Inter-language links|other language versions]] of Wikivoyage have the format <nowiki>[[xx:Article]]</nowiki>, where "xx" is the code for the language being linked to.
* Links to [[Project:Links to Wikipedia|Wikipedia]] have the format <nowiki>[[Wikipedia:Article]]</nowiki>.
* Links to [[Project:Links to Open Directory|Open Directory]] have the format <nowiki>[[Dmoz:Article]]</nowiki>.
==Listings==
Content in the special tags '''<nowiki><see>...</see>, <do>...</do>, <eat>...</eat>, <drink>...</drink>, <sleep>...</sleep>, <listing>...</listing></nowiki>''' is automatically formatted into a [[Project:Listings|listing]] for an attraction, activity, restaurant, bar or accommodation. These listings can be automatically added and edited by pointing and clicking, and you should generally not need to touch their contents in the page editor; see [[Project:Listings]] for details.
==Templates==
Text enclosed in curly brackets '''<nowiki>{{}}</nowiki>''' is used to insert the contents of [[Project:Using Mediawiki templates|templates]] into text. For example, '''<nowiki>{{warningbox|Don't go here}}</nowiki>''' produces the following:
{{warningbox|Don't go here}}
See [[Project:Template index]] for a full list.
==Tables==
Think twice before you add a table to Wikivoyage: many things like complicated transport schedules go out of date pretty much instantly and are thus better ''not'' added. But if you insist, here's how they work:
{| width="60%" class="wikitable"
|
<nowiki>{|</nowiki>
| '''table start''' -- add ''border="1" cellspacing="0" cellpadding="3"'' to make the lines between table cells visible
|-
|
<nowiki>|+</nowiki>
| table '''caption,''' ''optional;'' only between '''table start''' and first '''table row'''
|-
|
<nowiki>|-</nowiki>
| '''table row,''' ''optional on first row'' -- wiki engine assumes the first row
|-
|
<nowiki>!</nowiki>
| '''table header''' cell, ''optional.'' Consecutive '''table header''' cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).
|-
|
<nowiki>|</nowiki>
| '''table data''' cell, ''required!'' Consecutive '''table data''' cells may be added on same line separated by double marks (<code><nowiki>||</nowiki></code>) or start on new lines, each with its own single mark (<code><nowiki>|</nowiki></code>).
|-
|
<nowiki>|}</nowiki>
| '''table end'''
|}
So, for example, this:
<nowiki>{| class="wikitable"
|+ Caption
! Header 1 !! Header 2
|-
| Cell 1 || Cell 2
|}</nowiki>
Looks like this:
{| class="wikitable"
|+ Caption
! Header 1 !! Header 2
|-
| Cell 1 || Cell 2
|}
==Comments==
{{shortcut|[[wv:comment]]}}
Text enclosed between the special comment characters <code><nowiki><!--</nowiki></code> and <code><nowiki>--></nowiki></code> is not displayed. This can be used to leave instructions or warnings visible only when editing the page, but should be used sparingly.
==See also==
*[[Project:帮助]]
*[http://www.mediawiki.org/wiki/Help:Contents Mediawiki Help]
*[http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide:_Editing_overview#The_wiki_markup The MediaWiki User's Guide section on Wiki markup]
*[[Project:External links|Wikivoyage's external links policy]] - when and how to add links to other sites
{{WikivoyageDoc|help}}
[[Wikipedia:Help:Wiki markup]]All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://zh.wikivoyage.org/w/index.php?diff=prev&oldid=23963.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|