Bunoon: LIGHT | Manual | Support Functions

This area contains functions that are used for managing languages that are used within LIGHT, while offering additional support to check if specific languages are supported and if HTML code has been syntax highlighted.

Adds a new language to the list of languages that is already supported.

The main arguments for this function are as follows:

  • sLanguage [String] - The name of the language that is to be added.
  • aKeywords [Array] - The keywords that are supported in the language.
  • aBrackets [Array] - The brackets that are supported in the language (defaults to an empty array).
  • sComments [String] - The comments that are supported in the language.
  • aBlockComments [Array] - The block comments that are supported in the language (defaults to an empty array).

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bAdded = $L.AddLanguage( 'VBScript', ['If', 'Else'], [] );"

Removes a language from the list of supported languages.

The main arguments for this function are as follows:

  • sLanguage [String] - The name of the language that is to be removed.

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bRemoved = $L.RemoveLanguage( 'Perl' );

Checks to see if a language is available in the list of supported languages.

The main arguments for this function are as follows:

  • sLanguage [String] - The name of the language that is to be checked.

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state if the language is supported.

Below is an example of how to use this function:

var bSupported = $L.IsLanguageSupported( 'Perl' );

Determines if one of the syntax classes has been assigned to the specified code already.

The main arguments for this function are as follows:

  • sHTML [String] - The HTML that is to be checked.

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state if the syntax has been highlighted.

Below is an example of how to use this function:

var bResult = $L.IsAlreadyHighlighted('test html code here');