Template:Incode: Difference between revisions
Jump to navigation
Jump to search
en>Kunda1 mNo edit summary |
m (1 revision imported) |
(No difference)
|
Revision as of 07:00, 6 August 2022
{{{1}}}
Use this template when you want to display in-line code.
You can build a line with {{incode|Draft.makeLine(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2, 0, 0))}}
Results:
You can build a line with Draft.makeLine(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2, 0, 0))
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)