sync-pd2-wiki/.claude/skills/mediawiki-wikitext/assets/snippets.yaml

237 lines
3.7 KiB
YAML

# MediaWiki Wikitext Snippets
# For VS Code and compatible editors
---
# Headings
h2:
prefix: '@h2'
body: "== ${1:Heading} ==\n"
description: Level 2 heading
h3:
prefix: '@h3'
body: "=== ${1:Heading} ===\n"
description: Level 3 heading
h4:
prefix: '@h4'
body: "==== ${1:Heading} ====\n"
description: Level 4 heading
# Text formatting
bold:
prefix: '@bold'
body: "'''${1:text}'''"
description: Bold text
italic:
prefix: '@italic'
body: "''${1:text}''"
description: Italic text
# Links
link:
prefix: '@link'
body: '[[${1:Page}]]'
description: Internal link
linkd:
prefix: '@linkd'
body: '[[${1:Page}|${2:Display}]]'
description: Link with display text
elink:
prefix: '@elink'
body: '[${1:https://} ${2:Text}]'
description: External link
file:
prefix: '@file'
body: '[[File:${1:name.jpg}|thumb|${2:Caption}]]'
description: Image/file
cat:
prefix: '@cat'
body: '[[Category:${1:Name}]]'
description: Category
# Table
table:
prefix: '@table'
body: |
{| class="wikitable"
|+ ${1:Caption}
|-
! ${2:Header1} !! ${3:Header2}
|-
| ${4:Cell1} || ${5:Cell2}
|}
description: Basic table
tr:
prefix: '@tr'
body: |
|-
| ${1} || ${2}
description: Table row
# References
ref:
prefix: '@ref'
body: '<ref>${1:Citation}</ref>'
description: Reference
refn:
prefix: '@refn'
body: '<ref name="${1:id}">${2:Citation}</ref>'
description: Named reference
refr:
prefix: '@refr'
body: '<ref name="${1:id}" />'
description: Reference reuse
reflist:
prefix: '@reflist'
body: |
== References ==
{{Reflist}}
description: References section
# Templates
tpl:
prefix: '@tpl'
body: '{{${1:Template}}}'
description: Template call
tplp:
prefix: '@tplp'
body: '{{${1:Template}|${2:param}=${3:value}}}'
description: Template with params
infobox:
prefix: '@infobox'
body: |
{{Infobox ${1:type}
| name = ${2}
| image = ${3}
}}
description: Infobox
# Code
code:
prefix: '@code'
body: |
<syntaxhighlight lang="${1:python}">
${2:code}
</syntaxhighlight>
description: Syntax highlight block
codei:
prefix: '@codei'
body: '<code>${1:code}</code>'
description: Inline code
nowiki:
prefix: '@nowiki'
body: '<nowiki>${1:text}</nowiki>'
description: Escape markup
pre:
prefix: '@pre'
body: |
<pre>
${1:text}
</pre>
description: Preformatted block
math:
prefix: '@math'
body: '<math>${1:formula}</math>'
description: Math formula
# Comments
comment:
prefix: '@comment'
body: '<!-- ${1:comment} -->'
description: Comment
todo:
prefix: '@todo'
body: '<!-- TODO: ${1:task} -->'
description: TODO comment
# Magic words
notoc:
prefix: '@notoc'
body: '__NOTOC__'
description: Hide TOC
toc:
prefix: '@toc'
body: '__TOC__'
description: TOC position
# Lists
ul:
prefix: '@ul'
body: |
* ${1:Item 1}
* ${2:Item 2}
* ${3:Item 3}
description: Bullet list
ol:
prefix: '@ol'
body: |
# ${1:Item 1}
# ${2:Item 2}
# ${3:Item 3}
description: Numbered list
dl:
prefix: '@dl'
body: |
; ${1:Term}
: ${2:Definition}
description: Definition list
# Structure
redirect:
prefix: '@redirect'
body: '#REDIRECT [[${1:Target}]]'
description: Redirect
article:
prefix: '@article'
body: |
{{Infobox
| name = ${1:Name}
}}
'''${2:Title}''' is ${3:description}.
== Overview ==
${4:Content}
== References ==
{{Reflist}}
[[Category:${5:Category}]]
description: Article template
hr:
prefix: '@hr'
body: '----'
description: Horizontal rule
br:
prefix: '@br'
body: '<br />'
description: Line break
sort:
prefix: '@sort'
body: '{{DEFAULTSORT:${1:Key}}}'
description: Default sort key