Template:Incode
Jump to navigation
Jump to search
{{{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
- Example: typing {{incode| x {{:=}} y}} produces:
- 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.
- Special characters include:
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)