この文書は手引き書です。ウィキペディア日本語版での活動の参考にされていますが、方針やガイドラインではありません。
下記のリンクでこのページを別の外装で表示することができます。.mw-parser-output .hlist ul,.mw-parser-output .hlist ol{padding-left:0}.mw-parser-output .hlist li,.mw-parser-output .hlist dd,.mw-parser-output .hlist dt{margin-right:0;display:inline-block;white-space:nowrap}.mw-parser-output .hlist dt:after,.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{white-space:normal}.mw-parser-output .hlist li:after,.mw-parser-output .hlist dd:after{content:" ・\a0 ";font-weight:bold}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist-pipe dd:after,.mw-parser-output .hlist-pipe li:after{content:" |\a0 ";font-weight:normal}.mw-parser-output .hlist-hyphen dd:after,.mw-parser-output .hlist-hyphen li:after{content:" -\a0 ";font-weight:normal}.mw-parser-output .hlist-comma dd:after,.mw-parser-output .hlist-comma li:after{content:"、";font-weight:normal}.mw-parser-output .hlist-slash dd:after,.mw-parser-output .hlist-slash li:after{content:" /\a0 ";font-weight:normal}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")\a0 ";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)" ";white-space:nowrap}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)" "}
MinervaNeue
ウィキペディアでの外部リンクは一般的にはリンクの最後にアイコンを表示します。[1]ウィキペディアでは外装ごとにCSSを利用して特定の拡張子とURIスキームを検出して、それらに基づき特定のアイコンを表示することができます。なお、拡張子の検出はURLに基づいて行われ、リンク先が実際にその拡張子のファイルであるかどうかは検査していません。
このページではアイコンを示すためにexample.orgのような例示用のURLを提示していますが、いずれも実在のファイルを指すことを意図していません。 MediaWikiのソフトウェアは拡張子とURIスキームを検出してリンクを作成します。そのため、URIのないリンクでは外部リンクが作成されません。また、URLのURIスキーム以外の部分は検出しないため、wwwがあるかどうかは外部リンクの作成を影響しません。 既定の外装だったベクターはPDFアイコンしか表示せず、ケルンブルーも同じである。モバイル用のMinervaNeueでは全て表示しません。一方、モダン、モノブック、Timelessは多くの種類のアイコンを表示します。各外装で表示されるアイコンは外装のCSSで定義されていますが、PDFアイコンのみは{{PDFlink}}が使われる場合と拡張子がPDFの場合に表示されるとガジェットで定義されています。ガジェットを個人設定の「ガジェット」タブで無効にすると、外装で定義されたアイコンが使用されます。 ファイル拡張子に基づくアイコンは拡張子が一致する場合にのみ表示されます。また、ファイル拡張子とURIスキームの両方にアイコンが指定されている場合、ファイル拡張子のアイコンが優先して表示されます。リンクテキストが2行以上にわたる場合、Internet Explorerで不具合が生じることがあります。外部リンクアイコンは代替テキストを指定できないため、アクセシビリティの基準に適合しません。 plainlinksクラスを使用することで外部リンクアイコンを隠すことができますが、非推奨となっています。<span class="plainlinks">http://example.org/test.pdf</span> 特別:利用者ページ/skin.css(設定で選ばれた外装にのみ適用)または特別:利用者ページ/common.css(全ての外装に適用)を編集することで、カスタムの外部リンクアイコンを指定することができます。例えば、表計算ソフト Microsoft Excel形式のファイルで使われる拡張子で終わるURLにアイコン([1] CSSが正しく編集・認識され、再読込すると、例えば下記URL表記の後ろの外部リンクのアイコンがそれに変わります。https://example.org/test.xls
解説
例 (モバイル)
モノブック
Timeless
レガシー ベクター (2010年版)
ベクター (2022年版)
種類拡張子例
Portable Document Format.pdf .PDF, .pdf# .PDF# .pdf? .PDF?https://example.org/test.pdf
Audio Video Interleave.avi .AVIhttps://example.org/test.avi
MPEG-1.mpg .MPG .mpeg .MPEGhttps://example.org/test.mpg
Ogg.ogm .OGMhttps://example.org/test.ogm
MIDI.MID .midi .MIDhttps://example.org/test.mid
MP3.MP3https://example.org/test.mp3
Ogg Vorbis.OGGhttps://example.org/test.ogg
Waveform Audio File Format .WAV*https://example.org/test.wav
Windows Media Audio.wma .WMAhttps://example.org/test.wma
種類URIスキーム例
Internet Relay Chatirc:// ircs://irc://example.org
File Transfer Protocolftp://ftp://example.org
Network News Transfer Protocolnews:news:example.org
mailtomailto:mailto:example@example.org
HTTPShttps://https://example.org/test.html
Apache Subversionsvn://svn://example.org/
ビットコインbitcoin://bitcoin:1BitQEtcoxAnViwUYX9k6KupmmsEfWrGnr
FTPSftps://ftps://example.org/
Geo URI(英語版)(RFC 5870日本語訳)geo:geo:37.786971,-122.399677[2]
Gitgit://git://example.org/
Gophergopher://gopher://example.org
Hypertext Transfer Protocolhttp:// ⇒http://example.org
Magnet URI scheme(英語版)magnet://(書きかけ)
Multimedia Messaging Servicemms://mms://example.org/
NASA World Windworldwind://worldwind://example.org/
Network News Transfer Protocolnntp://nntp://example.org/
Secure Shellssh://ssh://example.org/
Secure Session Initiation Protocolsips://sips://example.org/
Session Initiation Protocolsip://sip://example.org/
Short Message Servicesms://sms://example.org/
SSH File Transfer Protocolsftp://sftp://example.org/
電話(参考:電話番号)tel://tel://example.org/
tel:1
Telnettelnet://telnet://example.org/
Uniform Resource Nameurn:urn:isbn:0451450523 [3]
Extensible Messaging and Presence Protocolxmpp://xmpp://example.org/
外部リンクアイコンを隠す
カスタム外部リンクアイコン
上記のCSS断片はすべて小文字の.xls、.xlsxおよびそれらの英字を大文字にした拡張子を検出します。カスタム外部リンクアイコンは必ず横幅16ピクセルでなければならず、SVGを使用することができません。