Template:Incode: Difference between revisions

From BathAfrica Documentation
Jump to navigation Jump to search
BathAfrica compatibility adaptation; original revisions retained; source https://wiki.sybma.com
m 2 revisions imported: Full 75-template migration with source revision history from wiki.sybma.com
Line 48: Line 48:
[[Category:Template:Text Format]]
[[Category:Template:Text Format]]
</noinclude>
</noinclude>
<noinclude>
----
Migrated from [https://wiki.sybma.com/index.php?title=Template:Incode 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>

Revision as of 07:05, 29 October 2026

{{{1}}}


Use this template when you want to display in-line code.

You can build a line with {{incode|simulationMethod->simulate(data)}}

Results:

You can build a line with simulationMethod->simulate(data)

It should be used for short pieces of code or variables, not for multiple lines. For multiple lines use Template:Code, {{code|code=multiple lines}}.

Note

  • To display an = (equals) sign use the {{:=}} template.
    Example: typing {{incode| x {{:=}} y}} produces: x = y
  • To display certain special characters in this template you must enclose them in "nowiki" tags: <nowiki></nowiki>.
Special characters include:
  • | piping character.
  • { opening curly bracket or brace.
  • } closing curly bracket or brace.


Example without "nowiki" tags:

{{Incode|okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)}}

Result:

okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel


Example with "nowiki" tags:

{{Incode|okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel <nowiki>|</nowiki> QtGui.QDialogButtonBox.Ok)}}

Result:

okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)