Template:Incode

From FreeCAD Documentation
Jump to: navigation, search

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

If you must include special characters in the template example pipe " | " Curly brackets or braces " }} " or other non accepted characters,

Example:

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

Return wrong report (cut to the pipe):

okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel


use the nowiki code : <nowiki> | </nowiki>

Example:

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

Good report lets'go

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