Enforce Script Highlighter – Extension
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix) |
Lou Montana (talk | contribs) (Add example) |
||
Line 31: | Line 31: | ||
** {{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|1= game="armaR"}} (Optional, default {{hl|"armaR"}}) used to define which game links should be used | ** {{hl|1= game="armaR"}} (Optional, default {{hl|"armaR"}}) used to define which game links should be used | ||
** {{hl|1= classes="SCR_ClassA SCR_ClassB"}} (Optional, default empty) additional classes to be declared (if outside the example) | ** {{hl|1= classes="SCR_ClassA SCR_ClassB"}} (Optional, default empty - case-sensitive) additional classes to be declared (if outside the example) | ||
Line 62: | Line 62: | ||
| <enforce>int i = 3;</enforce> | | <enforce>int i = 3;</enforce> | ||
|- | |- | ||
| <syntaxhighlight lang="html">This is <enforce inline>int i = 0; i++;</enforce> absolutely inline.</syntaxhighlight> | | <syntaxhighlight lang="html"> | ||
| This is <enforce inline>int i = 0; i++;</enforce> absolutely inline. | <enforce> | ||
#ifdef WORKBENCH | |||
class ABC | |||
{ | |||
} | |||
class DEF : ABC | |||
{ | |||
// unreachable | |||
protected static void Print(string text) | |||
{ | |||
Print(text + 42, LogLevel.NORMAL); | |||
} | |||
} | |||
#endif | |||
</enforce> | |||
</syntaxhighlight> | |||
| <enforce> | |||
#ifdef WORKBENCH | |||
class ABC | |||
{ | |||
} | |||
class DEF : ABC | |||
{ | |||
// unreachable | |||
protected static void Print(string text) | |||
{ | |||
Print(text + 42, LogLevel.NORMAL); | |||
} | |||
} | |||
#endif | |||
</enforce> | |||
|- | |||
| <syntaxhighlight lang="html"> | |||
This is <enforce inline>int i = 0; i++;</enforce> absolutely inline.<br> | |||
And here comes another one <enforce inline>float value = 0.001;</enforce> inline text.<br> | |||
And another one <enforce inline>array<string> = {};</enforce> | |||
</syntaxhighlight> | |||
| | |||
This is <enforce inline>int i = 0; i++;</enforce> absolutely inline.<br> | |||
And here comes another one <enforce inline>float value = 0.001;</enforce> inline text.<br> | |||
And another one <enforce inline>array<string> = {};</enforce> | |||
|} | |} | ||
Revision as of 20:23, 15 June 2023
Enforce Script Highlighter | |
---|---|
Description | Highlights Enforce Script code. |
Author | Lou Montana |
Project Start | 2022-07-30: Project start |
Release Date |
|
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)
- game="armaR" (Optional, default "armaR") used to define which game links should be used
- classes="SCR_ClassA SCR_ClassB" (Optional, default empty - case-sensitive) 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.
Code | Result |
---|---|
<enforce/>
|
-no code provided-
|
<enforce></enforce>
|
-no code provided-
|
<enforce> </enforce>
|
-no code provided-
|
<enforce>int i = 3;</enforce>
|
|
<enforce>
#ifdef WORKBENCH
class ABC
{
}
class DEF : ABC
{
// unreachable
protected static void Print(string text)
{
Print(text + 42, LogLevel.NORMAL);
}
}
#endif
</enforce>
|
|
This is <enforce inline>int i = 0; i++;</enforce> absolutely inline.<br>
And here comes another one <enforce inline>float value = 0.001;</enforce> inline text.<br>
And another one <enforce inline>array<string> = {};</enforce>
|
This is int i = 0; i++; absolutely inline. |
Known Issues
Version | Issue | Report Date | Fix Date |
---|---|---|---|
0.00a | N/A | ||
0.95 | N/A |