Jump to content

Template:Infobox algorithm: Difference between revisions

From Encyclopedia of Algorithms
Claude generated template.
 
m visual friendly, claude improvement
 
Line 2: Line 2:
<div class="eoa-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="eoa-infobox-title">{{{name|{{PAGENAME}}}}}</div>
<div class="eoa-pseudo">
<div class="eoa-pseudo">
<div class="eoa-sig">{{{signature|}}}</div>
<div class="eoa-sig">{{#invoke:Pseudocode|line|{{{signature|}}}}}</div>
{{{code|}}}
{{#invoke:Pseudocode|render}}
</div>
</div>
</div><noinclude>
</div><noinclude>
Usage: place at the top of an article, before the lead paragraph.
<templatedata>
 
{
<pre>
"description": "Right-hand infobox holding a procedure in CLRS style.",
{{Infobox algorithm
"format": "block",
| name = Merge sort
"params": {
| signature = <span class="eoa-proc">Merge-Sort</span>(<span class="eoa-var">A</span>, <span class="eoa-var">p</span>, <span class="eoa-var">r</span>)
"name": {
| code =
"label": "Algorithm name",
# '''if''' <span class="eoa-var">p</span> &lt; <span class="eoa-var">r</span>
"description": "Heading shown at the top of the box. Defaults to the page title.",
# {{i}}<span class="eoa-var">q</span> = &#8970;(<span class="eoa-var">p</span> + <span class="eoa-var">r</span>) / 2&#8971;
"type": "line",
# {{i}}<span class="eoa-proc">Merge-Sort</span>(<span class="eoa-var">A</span>, <span class="eoa-var">p</span>, <span class="eoa-var">q</span>)
"suggested": true
}}
},
</pre>
"signature": {
"label": "Procedure signature",
"description": "The call line, for example Insertion-Sort(A, n). Plain text.",
"type": "line",
"required": true
},
"code": {
"label": "Pseudocode",
"description": "Plain text, one step per line. Indent nested blocks with four spaces or a tab per level. Keywords, procedure names and variables are styled automatically.",
"type": "content",
"required": true
}
},
"paramOrder": ["name", "signature", "code"]
}
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 19:14, 3 August 2026

Infobox algorithm

    Right-hand infobox holding a procedure in CLRS style.

    Template parameters

    This template prefers block formatting of parameters.

    ParameterDescriptionTypeStatus
    Algorithm namename

    Heading shown at the top of the box. Defaults to the page title.

    Linesuggested
    Procedure signaturesignature

    The call line, for example Insertion-Sort(A, n). Plain text.

    Linerequired
    Pseudocodecode

    Plain text, one step per line. Indent nested blocks with four spaces or a tab per level. Keywords, procedure names and variables are styled automatically.

    Contentrequired