Template:MacroCode: Difference between revisions

From BathAfrica Documentation
Jump to navigation Jump to search
sybma>Admin
m 1 revision imported
m 1 revision imported: Make tested BathAfrica compatibility revisions current
 
(4 intermediate revisions by the same user not shown)
Line 65: Line 65:
[[Category:Administration]]
[[Category:Administration]]
</noinclude>
</noinclude>
<noinclude>
----
Migrated from [https://wiki.sybma.com/index.php?title=Template:MacroCode SiteMasterDoc]. Original revision history and imported contributor names are retained. See [[BathAfrica:Template migration]] for compatibility changes and unresolved image dependencies. Legacy examples do not establish current BathAfrica product capabilities.
</noinclude>

Latest revision as of 07:18, 29 October 2026

{{{1}}}

Use this template to contain verbatim macro code in the Macros recipes pages.

This is similar to Template:Code, but without any syntax highlighting.

This template essentially creates a block of text surrounded by HTML <pre> ... </pre> tags, which the Addon Manager downloads and extracts.

Since content that includes an equals sign (=) is interpreted as a variable, you must specify the code= parameter explicitly to avoid issues.

Example:

Inside the code, neither the double nor the triple braces {{ }}, nor the vertical bar | are allowed because these are interpreted in special ways by the wiki software.

{{MacroCode|code=
a = {{"A"}, "B"}
if a:
    Q = Qt.Ok | Qt.Cancel
}}

The <nowiki> ... </nowiki> tags can be added explicitly to allow displaying these special symbols.

{{MacroCode|code=
<nowiki>
a = {{"A"}, "B"}
if a:
    Q = Qt.Ok | Qt.Cancel
</nowiki>
}}

Result:

a = {{"A"}, "B"}
if a:
    Q = Qt.Ok | Qt.Cancel



We can also display all symbols by using explicit <pre> ... </pre> tags.

<pre>
a = {{"A"}, "B"}
if a:
    Q = Qt.Ok | Qt.Cancel
</pre>

Result:

a = {{"A"}, "B"}
if a:
    Q = Qt.Ok | Qt.Cancel



Migrated from SiteMasterDoc. Original revision history and imported contributor names are retained. See BathAfrica:Template migration for compatibility changes and unresolved image dependencies. Legacy examples do not establish current BathAfrica product capabilities.