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|
The following image shows the Format Code button and menu:
To format the code in your Entry:
- Add the code into the Entry
- Select the code that you want to format
- 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
What to do next
- For more options for formatting a Entry, see Formatting an eNotebook entry.
- To find out how to create a Entry, see Creating eNotebook entries.
- To find out how to add special and accented characters to your Entry, see Using special characters.
- For information on editing a Entry and viewing previous versions of a Entry, see Editing an eNotebook entry and viewing revisions.
- To find out how to create links to other Entries and external resources in your Entry, see Linking to other eNotebook entries and Linking to external resources.
- To find out how to attach data files and pictures to your Entries, see Uploading data.
- For guidance on creating Entries for recording experiments, see Recording experiments.