Difference between revisions of "Template:Hover/Documentation"

From Dream Cancel Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:


A more general version of [[Template:HoverImage]] where both items displayed are anything at all rather than strictly images. With this comes further restrictions compared to images. This is mostly meant to switch between numpad and qcf notations and satisfy both needs.
A more general version of [[Template:HoverImage]] where both items displayed are anything at all rather than strictly images. On top of further restrictions compared to images it was also decided not to display the effect if the hovering object is empty. This template is mostly meant to switch between numpad and qcf notations and satisfy both needs.


==Usage==
==Usage==
:* Here's how it should look :
<div>Kula's {{Hover|dp+C|623C}} is trash.
<pre>Kula's {{Hover|dp+C|623C}} is trash.</pre>


:* Note that the '''<nowiki><div></nowiki>''' tag is needed for it to display properly. Without it, there's unwanted indentation :
<code><nowiki>Kula's {{Hover|dp+C|623C}} is trash.</nowiki></code> '''results in''' Kula's {{Hover|dp+C|623C}} is trash.
Kula's {{Hover|dp+C|623C}} is trash.
<pre>Kula's {{Hover|dp+C|623C}} is trash.</pre>


==Multiple calls==
==Limitations==
:* The div tag, like most mark-ups, breaks when you '''press enter''' to go to the next line. Meaning a single tag is enough for multiple calls in the same line (regardless of it wrapping back. This for example is still coded as one line and not two).
The template will break if it's on the same line as most wikitext formatting markups. For example the <code><nowiki>''...''</nowiki></code> for italics :
Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.
 
<pre>Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.</pre>
<code><nowiki>''Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though''</nowiki></code> '''results in''' ''Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though''<br>
<br>
: The first hover broke and interrupted the italics markup, resulting in the second hover working.
:* To bypass this you can use <nowiki><br /></nowiki> (or just <nowiki><br></nowiki>) instead for the line break(s).
 
Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.<br> I swear to god if his {{Hover|cl.C|5C}} isn't 2f anymore, I'll be sad.
 
<pre>Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.<br> I swear to god if his {{Hover|cl.C|5C}} isn't 2f anymore, I'll be sad.</pre>
Instead of markups, use the compatible HTML tags instead :
<br>
: For ''italics'', use <code><nowiki><i>...</i></nowiki></code> instead of <code><nowiki>''...''</nowiki></code>
:* Otherwise you can just press enter, go to the next line and use the tag again.
: For '''bold''', use <code><nowiki><b>...</b></nowiki></code> instead of <code><nowiki>'''...'''</nowiki></code>
Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.
: To indent <u>one line</u>, add <code><nowiki><span class="tab"></nowiki></code> for each : indentation. <code><nowiki><span class="tab"><span class="tab">Kula's {{Hover|dp+C|623C}} is trash.</nowiki></code> will indent twice :
I swear to god if his {{Hover|cl.C|5C}} isn't 2f anymore, I'll be sad. Make {{Hover|qcf+C|236C}} faster too, thanks.
<span class="tab"><span class="tab">Kula's {{Hover|dp+C|623C}} is trash.
<pre>Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}.
: To indent <u>an entire paragraph</u>, envelop it in <code><nowiki><ul>...</ul></nowiki></code> for each : indentation.
I swear to god if his {{Hover|cl.C|5C}} isn't 2f anymore, I'll be sad. Make {{Hover|qcf+C|236C}} faster too, thanks.</pre>
<ul><ul>Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though, and at least it's not Shingo's {{Hover|dp+C|623C}}. I swear to god if his {{Hover|cl.C|5C}} isn't 2f anymore, I'll be sad. Oh and make {{Hover|qcf+C|236C}} faster so it can combo from lows again too, thanks.</ul></ul>
: To create a bullet list, do the same as above and add <code><nowiki><li>...</li></nowiki></code> around each bullet point instead of *. <code><nowiki><ul><li>Kula's {{Hover|dp+C|623C}} is trash.</li></ul></nowiki></code> gives a single bullet point :
<ul><li>Kula's {{Hover|dp+C|623C}} is trash.</li></ul>
: To create a numbered list, do the same as above with <code>ol</code> instead of <code>ul</code>.  
 
 
A bigger limitation of this template is being incompatible with div/class levels. [[Template:Hover/Alt|Hover/Alt]] was made for that purpose, used in tables and such. Ideally this template would be updated in the future to at least be compatible with wikitext markups.
[[Category:Templates]]
[[Category:Templates]]

Latest revision as of 14:58, 27 August 2022

A more general version of Template:HoverImage where both items displayed are anything at all rather than strictly images. On top of further restrictions compared to images it was also decided not to display the effect if the hovering object is empty. This template is mostly meant to switch between numpad and qcf notations and satisfy both needs.

Usage

Kula's {{Hover|dp+C|623C}} is trash. results in Kula's dp+C 623C is trash.

Limitations

The template will break if it's on the same line as most wikitext formatting markups. For example the ''...'' for italics :

''Kula's {{Hover|dp+C|623C}} is trash. Her {{Hover|dp+A|623A}} is alright though'' results in Kula's dp+C 623C is trash. Her dp+A 623A is alright though

The first hover broke and interrupted the italics markup, resulting in the second hover working.


Instead of markups, use the compatible HTML tags instead :

For italics, use <i>...</i> instead of ''...''
For bold, use <b>...</b> instead of '''...'''
To indent one line, add <span class="tab"> for each : indentation. <span class="tab"><span class="tab">Kula's {{Hover|dp+C|623C}} is trash. will indent twice :

Kula's dp+C 623C is trash.

To indent an entire paragraph, envelop it in <ul>...</ul> for each : indentation.
      Kula's dp+C 623C is trash. Her dp+A 623A is alright though, and at least it's not Shingo's dp+C 623C. I swear to god if his cl.C 5C isn't 2f anymore, I'll be sad. Oh and make qcf+C 236C faster so it can combo from lows again too, thanks.
To create a bullet list, do the same as above and add <li>...</li> around each bullet point instead of *. <ul><li>Kula's {{Hover|dp+C|623C}} is trash.</li></ul> gives a single bullet point :
  • Kula's dp+C 623C is trash.
To create a numbered list, do the same as above with ol instead of ul.


A bigger limitation of this template is being incompatible with div/class levels. Hover/Alt was made for that purpose, used in tables and such. Ideally this template would be updated in the future to at least be compatible with wikitext markups.