Formatting code

From LabTrove Documentation
Jump to: navigation, search

If you add code to your Entry you can choose to add the appropriate highlighting and formatting for the type of code that you are adding. You can select from a list of code types available, or if your code type is not available, you can format it with a standard code font. Using the code markup also ensures that the code is displayed using your original spacing when you save the Entry.

In addition to the standard code font and retaining spacing, the following code types can be displayed with syntax highlighting:

* ASP * Perl
* Bash * PHP
* C * RDF
* C++ * SQL
* CSS * Text
* Matlab * Java
* XML


The following image shows the Format Code button and menu:

Text code new.png

To format the code in your Entry:

  1. Add the code into the Entry
  2. Select the code that you want to format
  3. Click Format Code and select the code type from the list of options in the menu. Alternatively, click the Text button if your code type is not available.

You can also manually add the code markup. The markup for generic code is: [code][/code]. To change the markup to get syntax formatting for your code format if it is supported, use [code=<language>][/code] where <language> is your code format, for example [code=perl][/code].

What to do next


Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox