Vorlage:Syntaxhighlight

Aus Wikivoyage
{{{1}}}
Template-info.png Dokumentation für die Vorlage {{Syntaxhighlight}}[Ansicht] [Bearbeiten] [Versionsgeschichte] [Aktualisieren]

Simple wrapper around the <syntaxhighlight>...</syntaxhighlight> tag to show syntax-highlighted text. Unlike <syntaxhighlight>, text that does not fit on the screen will be wrapped.

Usage

Parameters

  • lang:
Code Language
4cs 4CS
6502acme MOS 6502 (6510) ACME Cross Assembler
6502kickass MOS 6502 (6510) Kick Assembler
6502tasm MOS 6502 (6510) TASM/64TASS
68000devpac Motorola 68000 - HiSoft Devpac ST 2 Assembler
abap w:en:ABAP
actionscript w:en:ActionScript
actionscript3 w:en:ActionScript3
ada Ada
algol68 w:en:ALGOL 68
apache Apache Configuration
applescript w:en:AppleScript
apt_sources w:en:Apt sources
arm ARM Assembler
asm Assembly
asp Active Server Pages (ASP)
asymptote
autoconf
autohotkey
autoit w:en:AutoIt
avisynth
awk
bascomavr
bash Bash
basic4gl w:en:Basic4GL
bf w:en:Brainfuck
bibtex
blitzbasic w:en:Blitz BASIC
bnf w:en:Backus-Naur Form
boo
c C
c_loadrunner
c_mac C (Mac)
caddcl AutoCAD DCL
cadlisp w:en:AutoLISP
cfdg CFDG
cfm w:en:ColdFusion Markup Language
chaiscript
cil Common Intermediate Language (CIL)
clojure
cmake
cobol w:en:COBOL
coffeescript
cpp w:en:C++
cpp-qt C++ (Qt toolkit)
csharp C#
css Cascading Style Sheets (CSS)
cuesheet
d D
dcl
dcpu16
dcs
delphi Delphi
diff w:en:Diff
div DIV
Code Language
dos w:en:DOS batch file
dot DOT
e
ecmascript
eiffel Eiffel
email
epc
erlang
euphoria
f1
falcon
fo
fortran w:en:Fortran
freebasic w:en:FreeBASIC
freeswitch
fsharp
gambas Gambas
gdb
genero Genero
genie
gettext w:en:gettext
glsl OpenGL Shading Language (GLSL)
gml Game Maker Language (GML)
gnuplot w:en:gnuplot
groovy Groovy
gwbasic
haskell Haskell
haxe
hicest
hq9plus HQ9+
html4strict w:en:HTML
html5 HTML5
icon
idl Uno IDL
ini INI
inno Inno
intercal w:en:INTERCAL
io Io
j
java Java
java5 Java(TM) 2 Platform Standard Edition 5.0
javascript w:en:JavaScript
kixtart w:en:KiXtart
klonec Klone C
klonecpp Klone C++
latex w:en:LaTeX
lb
ldif
lisp Lisp
llvm
locobasic
logtalk
lolcode w:en:LOLCODE
lotusformulas
lotusscript w:en:LotusScript


Code Language
lscript
lsl2
lua Lua
magiksf
m68k Motorola 68000 Assembler
make make
mapbasic
matlab MATLAB M
mirc w:en:mIRC scripting language
mmix
modula2
modula3
mpasm Microchip Assembler
mxml w:en:MXML
mysql w:en:MySQL
nagios
netrexx
newlisp
nsis Nullsoft Scriptable Install System (NSIS)
oberon2
objc w:en:Objective-C
objeck
ocaml w:en:OCaml
ocaml-brief w:en:OCaml
octave
oobas OpenOffice.org Basic
oorexx
oracle11 Oracle 11 SQL
oracle8 Oracle 8 SQL
oxygene
oz
parasail
parigp
pascal Pascal
pcre
per per
perl w:en:Perl
perl6
pf
php w:en:PHP
php-brief w:en:PHP
pic16
pike
pixelbender Pixel Bender
pli
plsql w:en:PL/SQL
postgresql
povray Persistence of Vision Raytracer
powerbuilder
powershell w:en:Windows PowerShell
proftpd
progress w:en:OpenEdge Advanced Business Language
prolog w:en:Prolog
properties
Code Language
providex w:en:ProvideX
purebasic
pycon
pys60
python Python
q
qbasic QBasic/QuickBASIC
rails Rails
rebol
reg w:en:Windows Registry
rexx
robots robots.txt
rpmspec
rsplus
ruby Ruby
sas SAS
scala Scala
scheme Scheme
scilab w:en:Scilab
sdlbasic w:en:SdlBasic
smalltalk w:en:Smalltalk
smarty w:en:Smarty
spark
sparql
sql w:en:SQL
stonescript
systemverilog
tcl w:en:Tcl
teraterm w:en:Tera Term
text w:en:Plain text
thinbasic w:en:thinBasic
tsql w:en:Transact-SQL
typoscript TypoScript
unicon
upc
urbi
uscript
vala Vala
vb w:en:Visual Basic
vbnet w:en:Visual Basic .NET
vedit
verilog w:en:Verilog
vhdl w:en:VHDL
vim w:en:Vimscript
visualfoxpro w:en:Visual FoxPro
visualprolog w:en:Visual Prolog
whitespace Whitespace
whois
winbatch w:en:Winbatch
xml w:en:XML
xorg_conf w:en:Xorg.conf
yaml
xpp w:en:Microsoft Dynamics AX
z80 ZiLOG Z80 Assembler
zxbasic


Examples

{{syntaxhighlight|lang=javascript|1=mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');}}

mw.util.addPortletLink('p-personal', '/w/index.php?title=Special:MyPage/Sandbox&action=edit&preload=Template%3AUser_sandbox%2Fpreload&editintro=Template%3AUser_sandbox', 'My sandbox', 'pt-mysandbox', 'Go to my sandbox');

See also

  • {{strong}} – For semantically indicating strong emphasis instead of simple typographical boldfacing.
  • {{strongbad}} – Same as {{strong}} but red like this: "Never use {{strongbad}} in articles."
  • {{stronggood}} – Same as {{strongbad}} but green like this: "Only use {{stronggood}} on non-article pages."
  • {{em}} – Similar template for semantically indicating mild emphasis instead of simple typographical italicization.
  • {{var}} – Same as {{varserif}} use for all variables (e.g. strIllustratePrefix), except for "I" (upper-case i) and "l" (lower-case L), for which use {{varserif}}.
  • {{varserif}} – Same as {{var}} but uses serif font (e.g. strIllustratePrefix), especially for distinguishing between "I" (upper-case i) and "l" (lower-case L) as variables.
  • {{wikivar}} – For displaying wikicode variables and magicwords as they would appear in source code, e.g. {{PAGENAME}}, {{DEFAULTSORT:Lastname, Firstname}}.
  • {{para}} – For displaying wiki template parameters (|title=) or parameters and values (|year=2008).
  • {{tlx}} and related – For displaying entire templates (with or without parameters and values) as code.
  • {{tag}} – For using HTML elements ("tags") in prose (e.g. "When coding HTML <img>...</img> tags, always include …").
  • {{code}} – For computer source code (e.g. "always include the alt= parameter"). (Note: to nest other templates like {{var}} inside, use <code>...</code> instead of {{code}}.)
  • {{syntaxhighlight}} or {{sxhl}} – Wrapper for <syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text.
  • {{pre}} – For larger blocks of source code and other pre-formatted text.
  • {{pre2}}, a template with similar functionality but induces optional line wrap and optional scroll bars.
  • {{bq}} – For indented blocks of content, such as block quotations, examples, poems, etc.
  • {{kbd}} – For indicating user input.
  • {{key press}} – For indicating the input of specific keystrokes, e.g. CtrlX.
  • {{samp}} – For example output.
  • <syntaxhighlight>
  • mw:Extension:SyntaxHighlight GeSHi
Hinweise