Template:Incode: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
en>Kunda1
mNo edit summary
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
Use this template when you want to display in-line code.
Use this template when you want to display in-line code.


  <nowiki>You can build a line with {{incode|Draft.makeLine(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2, 0, 0))}}</nowiki>
  <nowiki>You can build a line with {{incode|simulationMethod->simulate(data)}}</nowiki>


Results:
Results:


You can build a line with {{incode|Draft.makeLine(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2, 0, 0))}}
You can build a line with {{incode|simulationMethod->simulate(data)}}


It should be used for short pieces of code or variables, not for multiple lines. For multiple lines use [[Template:Code]], {{Incode|<nowiki>{{code|code=multiple lines}}</nowiki>}}.
It should be used for short pieces of code or variables, not for multiple lines. For multiple lines use [[Template:Code]], {{Incode|<nowiki>{{code|code=multiple lines}}</nowiki>}}.

Latest revision as of 10:36, 7 August 2022

{{{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)