Enforce Script Highlighter – Extension

From Bohemia Interactive Community
Jump to navigation Jump to search
(Update page with 0.95)
(Fix options)
Line 28: Line 28:
* Enforce Script tag button in the wiki edit toolbar (next to '''B''' and '''''I''''')
* Enforce Script tag button in the wiki edit toolbar (next to '''B''' and '''''I''''')
* Options:
* Options:
** all of Syntaxhighlight
** {{hl|inline}} for inline code
** {{hl|inline}} for inline code
** {{hl|notrim}} to remove the auto trim (lines themselves will always be rtrimmed)
** {{hl|notrim}} to remove the auto trim (lines themselves will always be rtrimmed)
** {{hl|game="armaR"}} (Optional, default {{hl|"armaR"}}) used to define which game links should be used
** {{hl|classes="SCR_ClassA SCR_ClassB"}} (Optional, default empty) additional classes to be declared (if outside the example)





Revision as of 21:04, 15 June 2023

Enforce Script Highlighter
Description Highlights Enforce Script code.
Author Lou Montana
Project Start 2022-07-30: Project start
Release Date
  • 2022-07-30: "v0" (0.00a), first upload, Syntaxhighlight's C# syntax wrapper
  • 2023-06-15: v0.95, first custom lexer to mimic Script Editor's colours
Version 0.95

This extension highlights Enforce Script Syntax using Script Editor's theme.


Features

  • Enforce Script Syntax support
  • "Copy code to clipboard" button on hover
  • Enforce Script tag button in the wiki edit toolbar (next to B and I)
  • Options:
    • inline for inline code
    • notrim to remove the auto trim (lines themselves will always be rtrimmed)
    • -No content provided- (Optional, default "armaR") used to define which game links should be used
    • -No content provided- (Optional, default empty) additional classes to be declared (if outside the example)


Installation

  • Unzip the directory to wiki/extensions/EnforceScriptHighlighter
  • Add wfLoadExtension( 'EnforceScriptHighlighter' ); to LocalSettings.php
  • There are no settings


Usage

Using <enforce> tags will auto-generate syntax highlighting.

Examples
Code Result
<enforce/>
-no code provided-
<enforce></enforce>
-no code provided-
<enforce> </enforce>
-no code provided-
<enforce>int i = 3;</enforce>
int i = 3;
This is <enforce inline>int i = 0; i++;</enforce> absolutely inline.
This is int i = 0; i++; absolutely inline.


Known Issues

Version Issue Report Date Fix Date
0.00a N/A
0.95 N/A
Report issues on Discord, in the #community_wiki channel!