Шаблон:Hatnote inline
Це є меташаблоном для розробки додаткових, специфічніших шаблонів. Якщо ви плануєте використати цей шаблон в рядку у статтях або інших сторінках, то використайте {{crossreference}} (скороченнями є {{crossref}} та {{xref}}) або інший специфічний шаблон, який заснований на цьому меташаблоні, наприклад, {{see above}} та {{see below}}. |
| Цей шаблон використовує Lua: |
Меташаблон {{Hatnote inline}} оформлює текст стандартизованими стилем для рядкового (а не блокового) варіанту верхньої примітки, короткого коментаря, розміщеного у місці вставлення, з посилання на детальнішу інформацію або в іншому випадку є самопосиланням на іншу сторінку Вікіпедія, наприклад, ось так:
Найпоширенішими використаннями цього меташаблону є:
- Рядкове «(Див. також ...)»-подібне перехресне посилання Вікіпедії в круглих дужках на інші сторінки Вікіпедії, яке створюється шаблоном
{{crossreference}}та його похідними шаблонами. Ці є самопосилання Вікіпедії не варті друкування.
Використання
[ред. код]- Просте використання
{{hatnote inline|текст}}
- Усі параметри
{{hatnote inline|текст|extraclasses=class1 class2|selfref=yes|category=no}}
Меташаблон автоматично не створює посилання будь-якого виду. Посилання та інші бажане форматування потрібно явно додавати, використовуючи звичайну вікірозмітку.
Параметри
[ред. код]Цей розділ містить неперекладені фрагменти англійською мовою. |
Цей шаблон приймає наступні параметри:
|1=або|text=або|content=— The inline hatnote's text (required). While the explicit naming of this parameter with|1=,|text=, or|content=is not required, it is always safest to use it this way, since any = character in the input text will break the template if the parameter is unnamed.|class=or|extraclasses=— Any extra CSS classes to be added. This should not normally be used.|selfref=no— If set to no (or n, false, 0, etc.) removes the default CSS classselfref, used to denote unprintworthy self-references to Wikipedia . This option should not be used to indicate a non-selfref on cross-article links, only links within the same article (and the derived shorthand templates{{See above}}and{{See below}}do this automatically). The parameter alias|printworthy=yes(or with any other value, like y, true, 1, etc.) has the same effect as|selfref=no. Note that attempting to manually supply a "this is a selfref" value with|selfref=yesor|printworthy=nowill not have the desired effect (which is the default anyway); the meta-template is set to selfref by default, since most uses are self-references (only those within the same article as the template are not). This could actually be fixed by use of{{YesNo}}, but it's maybe more hassle than it's worth.|category=— If set to no (or n, false, 0, etc.), suppresses the error-tracking category (Category:Hatnote templates with errors). This only has an effect if the first positional parameter (the hatnote text) is omitted. This should not normally be used.|inline=— Defaults to yes; you never need to set that. If set to no (or n, false, 0, etc.), it is a special-use parameter, which turns off the conversion of the Hatnote module code's<div>into a<span>, so it becomes a<div>again. By default, this will simply produce the same output as{{Hatnote}}. The only use for this is when a template using{{Hatnote inline}}as its meta-template (e.g.{{Crossreference}}has WP:TemplateStyles and a custom class that do something different with it in block mode than would happen if it were a regular hatnote (e.g., by removing the hatnote indentation). So, obviously this is not normally used, and it requires setup to use it to do anything practical.
Технічні деталі
[ред. код]Меташаблон розміщує контейнер HTML <span>...</span> навколо тексту, введеного у свій перший обов'язковий параметр. Цей контейнер забезпечує стандартне оформлення (курсив у більшості випадків, і лише стилістично, а не як семантичне підкреслення); він також використовує класи CSS для ізоляції вміщеного коду з метою, щоб впевнитися, що код буде правильно інтерпретовано і діятиме він незалежно від справжнього вмісту статті.
Код HTML, створений цим шаблоном, виглядає наступним чином:
<span class="hatnote">hatnote text</span>
Це той самий клас, який використовує шаблоном {{hatnote}}, який заснований на <div>, блоковому відображені, яке керується окремо через div.hatnote, що зазначено в Модуль:Hatnote/styles.css.
Вивід створюється модулем Модуль:Hatnote inline.
Див. також
[ред. код]- Шаблон:Hatnote templates documentation, щодо усіх верхніх приміток у блоковому форматі
Шаблони засновані на цьому меташаблоні
[ред. код]- {{Crossreference}} (a.k.a. {{Crossref}}, {{Xref}}) — шаблон для рядкових самопосилань (зазвичай) на інші сторінки Вікіпедії (не вартий друкування у більшості випадках)
Дописувачі можуть експериментувати на підсторінках пісочниці (ред. | різн.) та тести (створити) цього шаблону.
Будь ласка, додавайте категорії до підсторінки /документація. Підсторінки цього шаблону.