Template:Code

From FreeCAD Documentation
Revision as of 09:49, 1 October 2013 by Ediloren (talk | contribs) (Created page with "{{#tag:syntaxhighlight|{{{code|{{{1}}}}}}|lang="{{{lang|{{{2|python}}}}}}"|enclose="div"}}<noinclude> ---- Use this template when you want to display code, for example : <n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
{{{1}}}

Use this template when you want to display code, for example :

{{Code|
import FreeCAD, Draft
Draft.makeLine(FreeCAD.Vector(0,0,0),FreeCAD.Vector(2,0,0))
}}

This template gives a different coloration depending on the used programming language. The default language is Python.

Options:

  • lang=python
  • lang=cpp
  • lang=java
  • lang=pascal

Other options are be supported: the template is a simple wrapper around the <syntaxhighlight>...</syntaxhighlight> tag to show syntax-highlighted text. Unlike <syntaxhighlight>, text that does not fit on the screen will be wrapped. See <syntaxhighlight> for a complete list of supported languages