Template:Answer
(Difference between revisions)
m |
|||
Line 1: | Line 1: | ||
− | <onlyinclude | + | <onlyinclude></onlyinclude> |
<noinclude> | <noinclude> | ||
== Usage == | == Usage == | ||
− | This template provides a hidden answer | + | This template provides a hidden answer. Invoke the template like this: |
− | + | ||
− | + | ||
− | + | ||
<pre>{{Answer|42}}</pre> | <pre>{{Answer|42}}</pre> | ||
+ | |||
+ | This template can work in several ways: | ||
+ | |||
+ | 1. Do not show the answer (only accessible from source). (Current approach.) | ||
+ | |||
+ | 2. Show a link to toggle the answer. | ||
+ | |||
+ | <pre><span class="mw-collapsible mw-collapsed" data-expandtext="Ans" data-collapsetext="Hide"><span style="background:gray">{{{1}}}</span></span></pre> | ||
+ | The example above will result in a "Ans" link. | ||
+ | Click on "Ans" to show the answer (42) and change the link to "Hide". | ||
+ | Click again to change it back. | ||
+ | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 14:44, 25 January 2019
Usage
This template provides a hidden answer. Invoke the template like this:
{{Answer|42}}
This template can work in several ways:
1. Do not show the answer (only accessible from source). (Current approach.)
2. Show a link to toggle the answer.
<span class="mw-collapsible mw-collapsed" data-expandtext="Ans" data-collapsetext="Hide"><span style="background:gray">{{{1}}}</span></span>
The example above will result in a "Ans" link. Click on "Ans" to show the answer (42) and change the link to "Hide". Click again to change it back.