Template:Task heading: Difference between revisions

From Rosetta Code
Content added Content deleted
mNo edit summary
(list advantages)
Line 1: Line 1:
<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>
<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 heading with an edit link above the task description on a [[:Category:Programming Tasks|task page]].
This template can be used to show a heading (which won't affect the table of contents) above the task description on a [[:Category:Programming Tasks|task page]].


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


===Advantages===
;Details:


In the past, some Rosettacode editors have used the definition header syntax (e.g. <code>;Task:</code>) to to create such headings.<br>
* The heading is styled exactly the same way as the header of the TOC (table of contents), which makes it look nice and tidy.
Using this template instead, has the following advantages:
* 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.)''


* The heading is styled exactly the same way as the heading of the TOC, which makes it look nice and tidy.
;Usage:
*: <small>''(Whereas <code>;Task:</code> is simply rendered in bold, with the same font size and line spacing as normal text, and therefore doesn't stand out as much as a heading, especially when the task description already uses bold text for highlights.'')</small>
* It has an edit link.
*: <small>''(Due to technical limitations, it gives 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.)''</small>


===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".

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


{| class=wikitable
{| class=wikitable

Revision as of 13:55, 22 August 2016


This template can be used to show a heading (which won't affect the table of contents) above the task description on a task page.

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

Advantages

In the past, some Rosettacode editors have used the definition header syntax (e.g. ;Task:) to to create such headings.
Using this template instead, has the following advantages:

  • The heading is styled exactly the same way as the heading of the TOC, which makes it look nice and tidy.
    (Whereas ;Task: is simply rendered in bold, with the same font size and line spacing as normal text, and therefore doesn't stand out as much as a heading, especially when the task description already uses bold text for highlights.)
  • It has an edit link.
    (Due to technical limitations, it gives 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.)

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.