Get the FREE Ultimate OpenClaw Setup Guide →

mediawiki-wikitext

npx machina-cli add skill kongyo2/mediawiki-wikitext-skill/mediawiki-wikitext --openclaw
Files (1)
SKILL.md
3.8 KB

MediaWiki Wikitext

Generate and edit content using MediaWiki's wikitext markup language.

Quick Reference

Text Formatting

''italic''  '''bold'''  '''''bold italic'''''
<code>inline code</code>  <sub>subscript</sub>  <sup>superscript</sup>
<s>strikethrough</s>  <u>underline</u>

Headings (line start only, avoid level 1)

== Level 2 ==
=== Level 3 ===
==== Level 4 ====

Lists

* Bullet item        # Numbered item       ; Term
** Nested            ## Nested             : Definition

Links

[[Page Name]]                      Internal link
[[Page Name|Display Text]]         With display text
[[Page Name#Section]]              Section link
[https://url Display Text]         External link
[[File:image.jpg|thumb|Caption]]   Image
[[Category:Name]]                  Category (place at end)

Table

{| class="wikitable"
|+ Caption
|-
! Header 1 !! Header 2
|-
| Cell 1 || Cell 2
|}

Templates & Variables

{{TemplateName}}                   Basic call
{{TemplateName|arg1|name=value}}   With arguments
{{{parameter|default}}}            Parameter (in template)
{{PAGENAME}}  {{CURRENTYEAR}}      Magic words

References

Text<ref>Citation here</ref>
<ref name="id">Citation</ref>      Named reference
<ref name="id" />                  Reuse reference
{{Reflist}}                        Display footnotes

Special Tags

<nowiki>[[escaped]]</nowiki>       Disable markup
<pre>preformatted block</pre>      Preformatted (no markup)
<syntaxhighlight lang="python">    Code highlighting
code here
</syntaxhighlight>
<math>x^2 + y^2 = z^2</math>       LaTeX math
<!-- comment -->                   Comment (hidden)
----                               Horizontal rule
#REDIRECT [[Target Page]]          Redirect (first line only)

Magic Words

__NOTOC__           Hide table of contents
__TOC__             Position TOC here
__NOEDITSECTION__   Hide section edit links

Common Patterns

Article Structure

{{Infobox Type
| name = Example
| image = Example.jpg
}}

'''Article Title''' is a brief introduction.

== Section ==
Content with citation<ref>Source</ref>.

=== Subsection ===
More content.

== See also ==
* [[Related Article]]

== References ==
{{Reflist}}

== External links ==
* [https://example.com Official site]

{{DEFAULTSORT:Sort Key}}
[[Category:Category Name]]

Template Definition

<noinclude>{{Documentation}}</noinclude><includeonly>
{| class="wikitable"
! {{{title|Default Title}}}
|-
| {{{content|No content provided}}}
{{#if:{{{footer|}}}|
{{!}}-
{{!}} {{{footer}}}
}}
|}
</includeonly>

Key Syntax Rules

  1. Headings: Use == to ======; don't use = (reserved for page title)
  2. Line-start markup: Lists (*#;:), headings, tables ({|) must start at line beginning
  3. Closing tags: Close heading equals on same line; no text after closing ==
  4. Blank lines: Create paragraph breaks; single newlines are ignored
  5. Pipes in templates: Use {{!}} for literal | inside templates
  6. Escaping: Use <nowiki> to escape markup; &amp; for &, &lt; for <

Resources

For detailed syntax, see:

  • references/syntax.md: Complete markup reference with all options
  • references/templates.md: Template and parser function details
  • assets/snippets.yaml: Editor snippets for common patterns

Source

git clone https://github.com/kongyo2/mediawiki-wikitext-skill/blob/main/mediawiki-wikitext/SKILL.mdView on GitHub

Overview

MediaWiki Wikitext is the markup language used to format pages on Wikipedia and other wiki sites. Use it to create or edit wiki articles, generate wikitext content, and work with tables, templates, and references. This skill guides you through common patterns and syntax to convert content and ensure valid, renderable pages.

How This Skill Works

You follow the core wikitext syntax blocks: text formatting, headings, lists, links, tables, templates, references, and special tags. Build small, copyable wikitext snippets and insert them into your article, then preview to verify rendering. The skill emphasizes line-start markup, proper heading levels, escaping, and using magic words and templates to add dynamic content.

When to Use It

  • When creating a new wiki article and defining its structure with proper headings, tables, and references
  • When editing an existing page to adjust formatting, links, or citations
  • When converting plain content into wikitext format for wiki hosting or migrations
  • When building tables, templates, or infoboxes with correct wikitable syntax
  • When adding navigation and metadata using magic words and category tags

Quick Start

  1. Step 1: Learn the basics from the quick reference blocks (text formatting, headings, lists, links, and tables)
  2. Step 2: Create a simple article skeleton with headings, paragraphs, a couple of links, and a reference
  3. Step 3: Add templates, a table, and a citation, then preview and adjust syntax as needed

Best Practices

  • Start major blocks (headings, lists, tables) at line beginnings to satisfy line-start markup rules
  • Avoid using level-1 headings; use level-2 and deeper headings for structure
  • Use {{!}} to render literal pipes inside templates and avoid breaking syntax
  • Escape markup you don’t want parsed with <nowiki>…</nowiki> and other preformatted blocks
  • Test with preview and use {{Reflist}} to render references correctly

Example Use Cases

  • Create a new article shell with a basic structure: intro, sections, and references
  • Add internal links [[Page Name]] and external links [https://example.com Display Text]
  • Insert an image with [[File:image.jpg|thumb|Caption]] and caption
  • Add citations using Text<ref>Source</ref> and render via {{Reflist}}
  • Include an infobox and dynamic content using magic words like {{PAGENAME}} and {{CURRENTYEAR}}

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers