テンプレート:Syntaxhighlight/doc

提供: 萌えっ娘百科事典
移動先: 案内検索

<syntaxhighlight>...</syntaxhighlight>のタグを省入力するためのテンプレートです。2引数またはlang引数に下記のlang入力文字列を指定することで、その対応言語用のハイライト効果を適用出来ます。

使い方

  • {{Syntaxhighlight|code=下記パラメータより選択|lang=任意の文字列}}

または

  • {{Syntaxhighlight|下記パラメータより選択|任意の文字列}}

または

  • {{Sxhl|下記パラメータより選択|任意の文字列}}

引数

引数の一覧
引数 指定内容 既定値 説明
1, code なし なし 任意の文字列を入力します。
2, lang 半角英小数字 なし #パラメータの言語名を入力します。

パラメータ

lang入力文字列 対応プログラミング言語
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 ABAP
actionscript ActionScript
actionscript3 ActionScript3
ada Ada
algol68 ALGOL 68
apache Apache HTTP Server
applescript AppleScript
apt_sources Apt sources
arm ARMアーキテクチャ
asm Assembly
asp Active Server Pages (ASP)
asymptote Asymptote
autoconf Autoconf
autohotkey AutoHotkey
autoit AutoIt
avisynth AviSynth
awk AWK
bascomavr BASCOM AVR
bash Bash
basic4gl Basic4GL
bf Brainfuck
bibtex BibTeX
blitzbasic Blitz BASIC
bnf bnf
boo Boo
c C
c_loadrunner C Loadrunner
c_mac C (Mac)
caddcl AutoCAD DCL
cadlisp AutoLISP
cfdg CFDG
cfm ColdFusion Markup Language
chaiscript ChaiScript
cil Common Intermediate Language (CIL)
clojure Clojure
clp Control Language Program
cmake CMake
cobol COBOL
coffeescript CoffeeScript
cpp C++
cpp-qt C++ (Qt toolkit)
csharp C#
css Cascading Style Sheets (CSS)
cuesheet Cue sheet
d D
dcl DIGITAL Command Language
dcpu16 DCPU-16
dcs Data Conversion System
delphi Delphi
diff Diff
div DIV
dos DOS batch file
dot DOT
e E
ecmascript ECMAScript
eiffel Eiffel
email Email (mbox \ eml \ RFC format)
epc Enerscript
erlang Erlang
euphoria Euphoria
f1 Formula One
falcon Falcon
fo FO
fortran Fortran
freebasic FreeBASIC
freeswitch FreeSWITCH
fsharp Fsharp
gambas Gambas
gdb GDB
genero Genero
genie Genie
gettext gettext
glsl OpenGL Shading Language (GLSL)
gml Game Maker Language (GML)
gnuplot gnuplot
go Go
groovy Groovy
gwbasic GW-BASIC
haskell Haskell
haxe Haxe
hicest HicEst
hq9plus HQ9+
html4strict HTML
html5 HTML5
icon Icon
idl Uno IDL
ini INI
inno Inno
intercal INTERCAL
io Io
j J
java Java
java5 Java(TM) 2 Platform Standard Edition 5.0
javascript JavaScript
jcl Job Control Language
kixtart KiXtart
klonec Klone C
klonecpp Klone C++
latex LaTeX
lb Liberty BASIC
ldif LDAP Data Interchange Format
lisp Lisp
llvm LLVM
locobasic Locomotive BASIC
logtalk Logtalk
lolcode LOLCODE
lotusformulas Formula language
lotusscript LotusScript
lscript LightWave 3D
lsl2 Linden Scripting Language
lua Lua
magiksf Magik
m68k Motorola 68000 Assembler
make make
mapbasic MapBasic
matlab MATLAB M
mirc mIRC scripting language
mmix MMIX
modula2 Modula-2
modula3 Modula-3
mpasm Microchip Assembler
mxml MXML
mysql MySQL
nagios Nagios
netrexx NetRexx
newlisp NewLISP
nsis Nullsoft Scriptable Install System (NSIS)
oberon2 Oberon-2
objc Objective-C
objeck Objeck
ocaml OCaml
ocaml-brief OCaml
ocl Operational Control Language
octave Octave
oobas OpenOffice.org Basic
oorexx Object REXX
oracle11 Oracle 11 SQL
oracle8 Oracle 8 SQL
oxygene Oxygene
oz Oz
parasail ParaSail
parigp PARI/GP
pascal Pascal
pcre Perl Compatible Regular Expressions
per per
perl Perl
perl6 Perl 6
pf PF
php PHP
php-brief PHP
pic16 PIC assembly language
pike Pike
pixelbender Pixel Bender
pli PL/I
plsql PL/SQL
postgresql PostgreSQL
povray Persistence of Vision Raytracer
powerbuilder PowerBuilder
powershell Windows PowerShell
proftpd ProFTPD
progress OpenEdge Advanced Business Language
prolog Prolog
properties プロパティファイル
providex ProvideX
purebasic PureBasic
pycon Python
pys60 PyS60
python Python
q Q
qbasic QBasic/QuickBASIC
rails Rails
rebol Rebol
reg Windowsレジストリ
rest Robots Exclusion Standard
rexx REXX
rpg RPG
rpgii RPG II
rpgiii RPG III
rpg400 RPG/400
rpgiv RPG IV
rpmspec RPM Package Manager
rsplus R言語
ruby Ruby
sas SAS
scala Scala
scheme Scheme
scilab Scilab
sdlbasic SdlBasic
smalltalk Smalltalk
smarty Smarty
spark SPARK
sparql SPARQL
sql SQL
stonescript StoneScript (ShiVa3D)
systemverilog SystemVerilog
tcl Tcl
teraterm Tera Term
text Plain text
thinbasic thinBasic
tsql Transact-SQL
typoscript TypoScript
unicon Unicon
upc Unified Parallel C
urbi URBI
uscript UnrealScript
vala Vala
vb Visual Basic
vbnet Visual Basic .NET
vedit VEDIT
verilog Verilog
vhdl VHDL
vim Vim script
visualfoxpro Visual FoxPro
visualprolog Visual Prolog
whitespace Whitespace
whois Whois
winbatch Winbatch
xml XML
xorg_conf Xorg.conf
yaml YAML
xpp Microsoft Dynamics AX
z80 Z80
zxbasic ZXBasic

使用例

  • javascript

{{syntaxhighlight|lang=javascript|code=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');}}

<syntaxhighlight lang="javascript">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');</syntaxhighlight>

  • Lua
入力 表示
{{sxhl|lang=lua|code=
local p = {}

function p.main( frame )
  -- 引数を受け取る
  local hoge_a = frame.args[1];
  local hoge_b = frame.args[2];
  local honya = frame.args[3];

  -- 受け取った引数を繋げて投げ戻す
  return 'うひゃっほう' ..hoge_a ..' - ' ..hoge_b ..' - ' ..honya ..'<br />'
end

return p
}}

<syntaxhighlight lang="lua">local p = {}

function p.main( frame )

 -- 引数を受け取る
 local hoge_a = frame.args[1];
 local hoge_b = frame.args[2];
 local honya = frame.args[3];
 -- 受け取った引数を繋げて投げ戻す
 return 'うひゃっほう' ..hoge_a ..' - ' ..hoge_b ..' - ' ..honya ..'
'

end

return p</syntaxhighlight>

このテンプレートが貼り付けられたページに適用するカテゴリはありません

関連項目