Anonymous user
Template:Task heading: Difference between revisions
Make the headings bold, following discussion on the discussion page. Slightly decrease font size to compensate.
(create new template to standardize something I've done with inline CSS styles on task pages, so far) |
(Make the headings bold, following discussion on the discussion page. Slightly decrease font size to compensate.) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1:
<includeonly><div id="{{#replace:{{{1|Task}}}| |_}}" style="margin:20px 0 10px 0; line-height:1.1; font-size:
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).
;Usage:▼
: The first argument is the header title to show.▼
===Advantages===
In the past, some Rosettacode editors have used the definition header syntax (e.g. <code>;Task:</code>) to to create such headings.<br>
Using this template instead, has the following advantages:
* It is styled more appropriately for a heading.
*: <small>''(i.e. larger font, and more spacing.)''</small>
* It has an edit link.
*: <small>''(Only for the main "Task" heading, because due to technical limitations, it can't give you a specific subsection of the task to edit - it gives you the whole task description, or more precisely, everything above the first real heading.)''</small>
* It has a link anchor.
*: <small>''(E.g. to link to the "See also" section, you can write <tt><nowiki>[[#See_also]]</nowiki></tt>. Note that spaces have to be replaced by underscores.)''</small>
If it is not specified, it defaults to the word "Task".
{| class=wikitable
|-
! Usage example
! Renders as
|-
| style="vertical-align:top; padding:1em" |
<pre style="border:none; margin:0; padding:0">
{{task heading}}
<pre>▼
...
{{
...
{{introheader|See also}}▼
...▼
▲...
▲</pre>
: ...▼
| style="vertical-align:top; padding:0 1em" |
: {{introheader|Test cases}}▼
{{task heading}}
: ...▼
: {{introheader|See also}}▼
: ...▼
|}
{{template}}</noinclude>
|