Help:Wiki syntax
This page covers frequently used wiki syntax, including syntax examples of formatting and templates used on this wiki.
Formatting
The Nura wiki is powered by MediaWiki, the same software that powers Wikipedia, but keep in mind that our configuration only uses the source editor. With the source editor you have to know a bit of MediaWiki syntax, to make your edits look just the way you intend them.
A complete guide to MediaWiki syntax can be found on their wiki: Help:Formatting. The following is the most commonly used syntax:
| Formatting | Syntax | Result |
|---|---|---|
| Italics | ''Italicized text''
|
Italicized text |
| Bold | '''Bold text'''
|
Bold text |
| Wiki page link | [[Devices]]
[[PINE64 PinePhone (pine64-pinephone)|Example]]
[[:File:Nexus5-02-home.jpg]]
[[:Category:Troubleshooting]]
|
Devices
File:Nexus5-02-home.jpg (note the Category:Troubleshooting (note the |
| External link | [https://nura.eco]
[https://nura.eco link label]
|
[1] |
| Adding a page to a category | [[Category:Guide]] (place at the bottom of your page)
|
- |
| Headers | == Level 2 ==
Section under level-2 heading!
=== Level 3 ===
Section under level-3 heading!
==== Level 4 ====
Section under level-4 heading!
|
Level 2 Section under level-2 heading! Level 3 Section under level-3 heading! Level 4 Section under level-4 heading! |
| Unordered lists | * This is a list.
* Second bullet point.
** This one is indented.
|
|
| Ordered lists | # This is a list.
# Second bullet point.
## This one is indented.
|
|
| Codeblock with syntax highlighting |
<syntaxhighlight lang="python">
for i in range(10):
print(i)
</syntaxhighlight>
|
for i in range(10):
print(i)
|
| Comment | <!-- This is a comment -->
|
|
| Image (inline) See also: #Uploading images |
[[File:Nexus5-02-home.jpg|300px]]
|
|
| Image (floating thumbnail) | [[File:Nexus5-02-home.jpg|thumb|Caption]]
|
|
| Gallery | <gallery>
File:Postmarketos-shirt-logo.png|Caption 1
File:Nexus5-02-home.jpg|Caption 2
</gallery>
|
|
Query tables
You may notice that on some pages, like chipset pages or the Devices page, it will show generated tables that uses syntax such as this:
{{#cargo_query:
tables=Socs
|fields=CONCAT( '[[', _pageName,']]' )=SoC,Codenames,Arch,Year,StatusUart=UART,StatusUsb=USB,StatusStorage=Storage,StatusDisplay=Display,StatusCpu=CPU,StatusGpu=GPU,StatusPinctrl=Pinctrl,StatusI2c=I²C,StatusAudio=Audio,StatusVideo=Video,StatusThermal=Thermal,StatusWiFi=WiFi,StatusBluetooth=BT,StatusModem=Modem,StatusGps=GPS,StatusCamera=Camera,StatusSuspend=Suspend
|order by=Socs.Model
|where=Mainline="1" AND Manufacturer="Qualcomm"
|group by=Socs._pageID
|format=table
|limit=9999
|more results text=
}}
This to done with an extension named Cargo to provide support for tables based on a database query, instead of having to manually manage each entry. For more information about using Cargo, see its documentation (e.g. the Quick start guide or the Querying data guide).
Templates
This list includes syntax for commonly used templates. For all available templates, see PostmarketOS:Templates.
Highlighted box for hints:
{{hint|Include short but helpful additional information here.}}
| Include short but helpful additional information here |
Work-in-progress notice:
{{Work-in-progress page}}
| 🚧 | This page is a work-in-progress. Some information contained within may be inaccurate or incomplete. |
User page templates
The following are templates that are only meant for user pages.
Owned devices
In order to appear in "Users owning this device" sections on device wiki pages, you will need to add the {{Owns device}} template to your user page. To do this, add the following to the end of your user page:
<div style="display: none;"> <!-- this prevents empty space showing up where the templates would be added -->
{{Owns device|Device_name_(device-codename)}}
{{Owns device|Device_name_2_(device-codename2)|Notes}}
...
</div>
There is no limit to the amount of "Owns device" templates. Replace Device_name... with the name of your device's wiki page (replace spaces with underscores). If you want, you can also include notes (as seen in the second example).
Then to actually show the data, is use this template:
{{My devices}}
Where this template is placed is where the owns devices table is displayed.
Userboxes
There are various userboxes that you can add, like small colorful boxes with fun information about you. See PostmarketOS:Templates#Userboxes for a visual guide.
To add userboxes to your profile, wrap them in a {{Userbox container| ... }}:
{{Userbox container|
{{User ports|9001}}
{{User main device|PINE64 PinePhone (pine64-pinephone)}}
}}
This will make them stick together and float to the right side of the page.
