Templat:Tag: Perbedaan antara revisi

Dari Wiki Javasatu
Loncat ke navigasi Loncat ke pencarian
Tidak ada ringkasan suntingan
Tag: Dikembalikan
Tidak ada ringkasan suntingan
Tag: Pengembalian manual
Baris 1: Baris 1:
{{#if:{{{plain|}}}|
<code class="{{#ifeq:{{{wrap|}}}|yes|wrap|nowrap}}" style="{{#ifeq:{{{style|}}}|plain|border:none;background:transparent;|{{{style|}}}}}"><!--
|<code class="mw-highlight" style="{{#if:{{{wrap|}}}||white-space:nowrap}}">
Opening tag
}}{{#switch:{{{2|pair}}}
-->{{#switch:{{{2|pair}}}
|c|close = <!--nothing-->
  |c|close =
|s|single
  |s|single
|o|open
  |o|open
|p|pair   = {{#tag:span|&lrm;&lt;|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#if:{{{params|}}}|&#32;{{{params}}}}}
  |p|pair = &lt;{{{1|tag}}}{{#if:{{{params|}}}|&#32;{{{params}}}}}
}}{{#switch:{{{2|pair}}}
}}<!--
|c|close = {{{content|}}}
Content between tags
|s|single = &#32;{{#tag:span|&#47;&gt;|class="p"}}
-->{{#switch:{{{2|pair}}}
|o|open   = {{#tag:span|&gt;|class="p"}}{{{content|}}}
  |c|close = {{{content|}}}
|p|pair   = {{#tag:span|&gt;|class="p"}}{{{content|...}}}
  |s|single = &#32;&#47;&gt;
}}{{#switch:{{{2|pair}}}
  |o|open = &gt;{{{content|}}}
|s|single
  |p|pair = {{#ifeq:{{{1|tag}}}|!--||&gt;}}{{{content|...}}}
|o|open   = <!--nothing-->
}}<!--
|c|close
Closing tag
|p|pair   = {{#tag:span|&lrm;&lt;&#47;|class="p"}}{{#tag:span|{{{1|tag}}}|class="nt"}}{{#tag:span|&gt;|class="p"}}
-->{{#switch:{{{2|pair}}}
}}{{#if:{{{plain|}}}|
  |s|single
|</code>
  |o|open =
}}<noinclude>
  |c|close
  |p|pair = {{#ifeq:{{{1|tag}}}|!--|--&gt;|&lt;&#47;{{{1|tag}}}&gt;}}
}}<!--
--></code><noinclude>
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>

Revisi per 24 September 2023 13.20

<tag>...</tag>

[lihat] [sunting] [riwayat] [hapus singgahan] Ikon dokumentasi Dokumentasi templat
[[Category:Languages pages{{#translation:}}]]
Ini dokumennya TemplateData untuk template ini digunakan oleh VisualEditor dan alat lainnya; lihat laporan penggunaan parameter bulanan untuk templat ini.

TemplateData untuk Tag

This template provides a quick way to mention an XML-style tag in a preformatted way. Mainly used in discussion/help pages.

[Kelola data templat]

Parameter templat

Templat ini lebih menyukai format parameter dalam satu baris.

ParameterKeteranganJenisStatus
Tag1

The name of the HTML tag.

Baku
tag
Contoh
span
Bariswajib diisi
Type2

What type of tag to display, see documentation for possible values.

Nilai yang disarankan
p pair o open c close s single
Baku
pair
Kataopsional
Contentcontent

The text content of the tag. By default “...” for pair type, empty for others; unused if type is single.

Isiopsional
Parametersparams

Parameters (attributes) for the opening tag, unused in close type.

Contoh
foo="bar"
Barisopsional
Plain displayplain

Avoid using monospace font and grey background for the tag.

Booleanopsional
Wrap?wrap

Whether to not add `style="white-space: nowrap;"` to the enclosing <code> tag.

Nilai otomatis
1
Booleanopsional

Usage

Types

  • p or pair(default) display a matched pair of open-and-close tags: <div>...</div>
  • o or open – display only the opening tag of an open-and-close pair: <span>
  • c or close – display only the closing tag of an open-and-close pair: </span>
  • s or single – display a single tag: <br />

Examples

  • {{tag|ref}}<ref>...</ref>
  • {{tag|ref|content=hello}}<ref>hello</ref>
  • {{tag|span|content=foo}}<span>foo</span>
  • {{tag|span|open}}<span>
  • {{tag|span|open|content=hello}}<span>hello
  • {{tag|span|close|content=hello}}hello</span>
  • {{tag|span|pair|content=hello}}<span>hello</span>
  • {{tag|ref|open|params={{attr|group|"note"}}}}<ref Templat:Attr>
  • {{tag|references|single}}<references />
  • {{tag|br|single}}<br />

See also

[[Category:Semantic markup templates{{#translation:}}]]