Template:Task heading: Difference between revisions

From Rosetta Code
Content added Content deleted
m (Smls moved page Template:Introheader to Template:Task heading: make its intended purpose more clear (and "heading" is the correct word, not "header".))
(default heading to "Task", and update description to reflect this and the name change)
Line 1: Line 1:
<includeonly><div id="{{#replace:{{{1|}}}| |_}}" style="margin:20px 0 10px 0; line-height:1.1; font-size:18px;">{{{1}}}<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>[{{fullurl:{{FULLPAGENAME}}|action=edit&amp;section=0&amp;summary=%2F*%20{{#replace:{{{1|}}}| |_}}%20*%2F%20}} edit]<span class="mw-editsection-bracket">]</span></span></div></includeonly><noinclude>
<includeonly><div id="{{#replace:{{{1|Task}}}| |_}}" style="margin:20px 0 10px 0; line-height:1.1; font-size:18px;">{{{1|Task}}}<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>[{{fullurl:{{FULLPAGENAME}}|action=edit&amp;section=0&amp;summary=%2F*%20{{#replace:{{{1|Task}}}| |_}}%20*%2F%20}} edit]<span class="mw-editsection-bracket">]</span></span></div></includeonly><noinclude>
This template can be used to show a section heading inside the introduction of a task page (i.e. the part above the table of contents), in order to break up long task descriptions into multiple sections.<br>
Even if the task description is short, adding a single <code><nowiki>{{introheader|Task}}</nowiki></code> above it can be valuable for the edit link.


This template can be used to show a heading with an edit link above the task description on a [[:Category:Programming Tasks|task page]].
Details:


Multiple headings can also be used to break longer task descriptions up into logical subsections (see examples below).
* The heading is styled exactly the same way as the header of the TOC, which makes it look nice and tidy.

* It doesn't appear in the TOC itself.
;Details:
* It has an edit link. ''(Due to technical limitations, it will give you the whole task description to edit, not just the specific section of it. But that's still better than getting the whole article with all solutions.)''

* The heading is styled exactly the same way as the header of the TOC (table of contents), which makes it look nice and tidy.
* It won't appear in the TOC itself.
* It has an edit link. ''(Due to technical limitations, it will give you the whole task description to edit, not just the specific subsection of it. But that's still better than getting the whole article, including all solutions, to edit.)''


;Usage:
;Usage:
: The first argument is the heading title to show.


The first and only argument is the title of the heading to show. If it is not specified, it defaults to the word "Task".
;Example:

{| class=wikitable
|-
! Usage example
! Renders as
|-
| style="vertical-align:top; padding:1em" |
<pre style="border:none; margin:0; padding:0">
{{task heading}}


<pre>
{{introheader|The task}}
...
...

{{introheader|Test cases}}
{{task heading|Test cases}}

...
...
{{introheader|See also}}
...
</pre>


{{task heading|See also}}
Which renders as:


...
: {{introheader|The task}}
</pre>
: ...
| style="vertical-align:top; padding:0 1em" |
: {{introheader|Test cases}}
{{task heading}}
: ...
...
: {{introheader|See also}}
{{task heading|Test cases}}
: ...
...
{{task heading|See also}}
...
|}


{{template}}</noinclude>
{{template}}</noinclude>

Revision as of 11:27, 20 August 2016


This template can be used to show a heading with an edit link above the task description on a task page.

Multiple headings can also be used to break longer task descriptions up into logical subsections (see examples below).

Details
  • The heading is styled exactly the same way as the header of the TOC (table of contents), which makes it look nice and tidy.
  • It won't appear in the TOC itself.
  • It has an edit link. (Due to technical limitations, it will give you the whole task description to edit, not just the specific subsection of it. But that's still better than getting the whole article, including all solutions, to edit.)
Usage

The first and only argument is the title of the heading to show. If it is not specified, it defaults to the word "Task".

Usage example Renders as
{{task heading}}

...

{{task heading|Test cases}}

...

{{task heading|See also}}

...

...

...

...



This is a template. There are many others. See Category:RCTemplates for a complete list of templates.