Commit 2939844a authored by twanvl's avatar twanvl

more documentation spellchecking,

in documentation: @<tag>@ now highlights as a tag
parent 27d89089
......@@ -2,12 +2,12 @@ Function: combined_editor
--Usage--
> forward_editor(field: some_text_value)
> combined_editor(field1: some_text_value, field2: some_text_value, ..., separtor1: some_string, ...)
> combined_editor(field1: some_text_value, field2: some_text_value, ..., separator1: some_string, ...)
Use one text field to edit one or more others.
This function must be used in the @script@ of a [[type:field#text|text field]].
This field will then contain the combined values of the given fields, separated by the separtors in <tt>&lt;sep></tt> tags.
This field will then contain the combined values of the given fields, separated by the separators in @<sep>@ tags.
When the field changes the underlying values are updated and vice versa.
Note: @forward_editor@ and @combined_editor@ are the same function.
......@@ -20,10 +20,10 @@ Note: @forward_editor@ and @combined_editor@ are the same function.
| @separator@ [[type:string]] Separator between field 1 and 2
| @separator1@ [[type:string]] Multiple separators
| @separator2@ [[type:string]] Next separator, ''etc.''
| @prefix@ [[type:string]] ''optional'' Prefix before the combined editor; like a separtor between the start and the first field.
| @suffix@ [[type:string]] ''optional'' Suffix after the combined editor; like a separtor between the last field and the end.
| @prefix@ [[type:string]] ''optional'' Prefix before the combined editor; like a separator between the start and the first field.
| @suffix@ [[type:string]] ''optional'' Suffix after the combined editor; like a separator between the last field and the end.
| @hide when empty@ [[type:boolean]] @false@ Don't include separators if the entire value is empty.
| @soft before empty@ [[type:boolean]] @false@ Make separators 'soft' when the value folowing it is empty.
| @soft before empty@ [[type:boolean]] @false@ Make separators 'soft' when the value following it is empty.
Soft separators are hidden by default and shown grayed when the field is selected.
--Examples--
......
......@@ -13,10 +13,10 @@ The it is determined whether the reminder text should be shown.
This is either because the user explicitly selected it, or when @default_expand(mode: keyword.mode)@ returns true.
Whether reminder text is shown is stored in a @<kw->@ tag around the keyword.
! Tag Reminder text Changed by user
| @"<kw-a>"@ hidden no
| @"<kw-A>"@ shown no
| @"<kw-0>"@ hidden yes
| @"<kw-1>"@ shown yes
| @<kw-a>@ hidden no
| @<kw-A>@ shown no
| @<kw-0>@ hidden yes
| @<kw-1>@ shown yes
If the reminder text is shown the function @combine@ is called which should combine the reminder text with (in the variable @reminder@) with the keyword and its parameters (in the variable @keyword@).
......@@ -40,7 +40,7 @@ is used. This shows reminder text by default based on a [[type:set]] option, and
The @condition@, @default_expand@ and @combine@ functions will be called for each potential keyword match in the input.
! Parameter Type Description
| @param1@, @param2@, ... [[type:tagged string]]* The parameter values.
| @param1@, @param2@, ... [[type:tagged string]]s The parameter values.
| @mode@ [[type:string]] The @mode@ of the keyword.
| @used_placeholders@ [[type:boolean]] DOC_MSE_VERSION: since 0.3.7
Is a placeholder used for any of the parameters?
......
Function: format
DOC_MSE_VERSION: deprecated in 0.3.7, use to_string
--Usage--
> format(some_number, format: format_specification)
......@@ -18,3 +20,6 @@ Format a number or other string as a string, [[http://www.cplusplus.com/referenc
>
> f := format@(format: "%03d")
> f(1) == "001"
--See also--
| [[fun:to_string]] Convert any value to a [[type:string]]
......@@ -4,7 +4,7 @@ Function: symbol_variation
> symbol_variation(symbol: symbol_value, variation: name_of_variation)
Render a [[type:symbol variation|variation]] of a symbol.
The variation name refers to one of the varations declared in the [[type:style]] of the symbol field.
The variation name refers to one of the variations declared in the [[type:style]] of the symbol field.
> symbol_variation(symbol: symbol_value, border_radius: .., fill_type: .., ...)
......
......@@ -19,7 +19,7 @@ A reference to a normal [[type:font]] for drawing text.
| @shadow displacement x@ [[type:double]] @0@ Relative position of the shadow in pixels.
| @shadow displacement y@ [[type:double]] @0@ ^^^
| @shadow blur@ [[type:double]] @0@ How much should the shadow be blurred?
| @separator color@ [[type:color]] @rgba(0,0,0,128)@ Color for @"<sep-soft>"@ tags inserted by the [[fun:combined_editor]] function.
| @separator color@ [[type:color]] @rgba(0,0,0,128)@ Color for @<sep-soft>@ tags inserted by the [[fun:combined_editor]] function.
--Example--
>font:
......
......@@ -103,7 +103,7 @@ The rest of the properties depend on the type of [[type:field]] this style is fo
| ^^^ @line height hard max@ ^^^ ^^^ ^^^
| ^^^ @line height line max@ ^^^ ^^^ ^^^
| ^^^ @paragraph height@ [[type:double]] ''flexible'' The height of paragraphs. If specified, each paragraph is given this much space, and aligned inside that space as specified by @alignment@.<br/>
A paragraph break is any line break that is not soft (i.e. caused by word wrap or a @"<soft>"@ break).
A paragraph break is any line break that is not soft (i.e. caused by word wrap or a @<soft>@ break).
| ^^^ @mask@ [[type:image|scriptable image]] ''none'' A mask that indicates where in the box text can be placed.<br/>
Text is never put in black areas of the box:<br/>
<img src="style-text-mask.png" alt=""/><br/>
......
......@@ -12,40 +12,44 @@ This is written as the character with code 1 in files.
--Basic markup--
! Tag Description
| @"<b>"@ The text inside the tag is bold.
| @"<i>"@ The text inside the tag is italic.
| @"<sym>"@ The text inside the tag is rendered as symbols, if a [[prop:style:symbol font]] is set for the text box.
| @"<color:???>"@ The text inside the tag is rendered with the given [[type:color]].
| @"<size:???>"@ The text inside the tag is rendered with the given font size in points, for example @"<size:12>text</size>"@ makes the text 12 points. The text is scaled down proportionally when it does not fit in a text box and the @scale down to@ attribute allows it.
| @"<line>"@ Line breaks inside this tag use the [[prop:style:line height line]], and they show a horizontal line.
| @"<soft-line>"@ Line breaks inside this tag use the [[prop:style:soft line height]].
| @"<atom>"@ An atomic piece of text. The cursor can never be inside it; it is selected as a whole.
The program automatically inserts @"<atom-soft>"@.
| @"<code>"@ The text inside the text is rendered in a monospace font. This is used for syntax highlighting script code.
| @"<code-kw>"@ The text inside the text is highlighted as a keyword in source code.
| @"<code-str>"@ The text inside the text is highlighted as a string in source code.
| @<b>@ The text inside the tag is bold.
| @<i>@ The text inside the tag is italic.
| @<sym>@ The text inside the tag is rendered as symbols, if a [[prop:style:symbol font]] is set for the text box.
| @<color:???>@ The text inside the tag is rendered with the given [[type:color]].
| @<size:???>@ The text inside the tag is rendered with the given font size in points, for example @"<size:12>text</size>"@ makes the text 12 points. The text is scaled down proportionally when it does not fit in a text box and the @scale down to@ attribute allows it.
| @<line>@ Line breaks inside this tag use the [[prop:style:line height line]], and they show a horizontal line.
| @<soft-line>@ Line breaks inside this tag use the [[prop:style:soft line height]].
| @<atom>@ An atomic piece of text. The cursor can never be inside it; it is selected as a whole.
The program automatically inserts @<atom-soft>@.
| @<code>@ The text inside the tag is rendered in a monospace font. This is used for syntax highlighting script code.
| @<code-kw>@ The text inside the tag is highlighted as a keyword in source code.
| @<code-str>@ The text inside the tag is highlighted as a string in source code.
--Other tags--
! Tag Description
| @"<kw-?>"@ Indicates that the text inside it is a keyword. This tag is automatically inserted by
| @<kw-?>@ Indicates that the text inside it is a keyword. This tag is automatically inserted by
The [[fun:expand_keywords]] function.<br/>
There are four versions, indicating whether or not reminder text is shown:
* @"<kw-0>"@, Reminder text hidden, by default
* @"<kw-1>"@, Reminder text shown, by default
* @"<kw-a>"@, Reminder hidden manually
* @"<kw-A>"@, Reminder shown manually
| @"<sep>"@ A separator between fields. This tag is automatically inserted by the [[fun:combined_editor]] function.<br/>
* @<kw-0>@, Reminder text hidden, by default
* @<kw-1>@, Reminder text shown, by default
* @<kw-a>@, Reminder hidden manually
* @<kw-A>@, Reminder shown manually
| @<sep>@ A separator between fields. This tag is automatically inserted by the [[fun:combined_editor]] function.<br/>
Inserting this tag manually will confuse that function!<br/>
This tag can never be selected, and its contents can not be edited.
| @"<prefix>"@ At the beginning of a string, indicates a part that can not be selected. This tag is automatically inserted by the [[fun:combined_editor]] function.
| @"<suffix>"@ At the end of a string, indicates a part that can not be selected. This tag is automatically inserted by the [[fun:combined_editor]] function.
| @"<sep-soft>"@ Like @"<sep>"@, only hidden. This is inserted by [[fun:combined_editor]]
| @"<soft>"@ Text who's width is ignored for alignment, similar to @"<sep-soft>"@, but not a separator.
| @"<word-list-?>"@ Indicate that the text inside the tag should be selected from a [[type:word list]].
The <tt>?</tt> must be the name of a word list in the game.
| @<prefix>@ At the beginning of a string, indicates a part that can not be selected. This tag is automatically inserted by the [[fun:combined_editor]] function.
| @<suffix>@ At the end of a string, indicates a part that can not be selected. This tag is automatically inserted by the [[fun:combined_editor]] function.
| @<sep-soft>@ Like @<sep>@, only hidden. This is inserted by [[fun:combined_editor]]
| @<soft>@ Text who's width is ignored for alignment, similar to @<sep-soft>@, but not a separator.
| @<word-list-???>@ Indicate that the text inside the tag should be selected from a [[type:word list]].
The <tt>???</tt> must be the name of a word list in the game.
| @<error>@ The text inside the tag is an error, and is shown with a red wavy underline.
| @<error-spelling:???>@ A spelling error, marked by the [[fun::check_spelling]] function.
The <tt>???</tt> part indicates the language used for spelling checking.
| any other tag Other tags are ignored.
--Related functions--
The following script functions deal with tags:
| [[fun:tag_contents]] Change the contents of a specific tag.
......
......@@ -98,6 +98,8 @@ $built_in_functions = array(
function syntax_highlight($code) {
if (preg_match("@^(\s*#.*\n)*\s*[-a-zA-Z0-9 _/,]+:([^=]|$)@", $code)) {
return highlight_reader($code);
} else if (preg_match("@^&lt;[^&>]*?(&gt;|>)$@", $code)) {
return "<span class='hl-tag'>$code</span>";
} else {
return highlight_script($code);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment