diff --git a/doc/function/combine_blend.txt b/doc/function/combine_blend.txt index 8e0e60f7..d97d5cbc 100644 --- a/doc/function/combine_blend.txt +++ b/doc/function/combine_blend.txt @@ -15,7 +15,7 @@ The images must have the same size. --Examples-- > combine_blend(image1: "image1.png", image2: "image2.png", combine: "add") == [[Image]] -
 combine_blend(image1: "image1.png", image2: "image2.png", combine: "add") == "image_combine_blend.png"
+>>> combine_blend(image1: "image1.png", image2: "image2.png", combine: "add") == "image_combine_blend.png" --See also-- | [[fun:linear_blend]] Blend two images together using a linear gradient. diff --git a/doc/function/curly_quotes.txt b/doc/function/curly_quotes.txt index e69de29b..a2987614 100644 --- a/doc/function/curly_quotes.txt +++ b/doc/function/curly_quotes.txt @@ -0,0 +1,17 @@ +Function: curly_quotes + +--Usage-- +> curly_quotes(some_tagged_string) + +Make quotes 'curly'. +Single and double quotation marks are changed to opening or closing versions depending on where they appear in the text. + +--Parameters-- +! Parameter Type Description +| @input@ [[type:tagged string]] String to make quotes curly in. + +--Examples-- +>>> curly_quotes("He said: 'This is cool!', she said: \"No way!\" ") +>>> == "He said: ‘This is cool!’, she said: “No way!” " +>>> curly_quotes("Also: ’Wrong quotes‘ ") +>>> == "Also: ‘Wrong quotes’ " diff --git a/doc/function/enlarge.txt b/doc/function/enlarge.txt index e69de29b..45693c1e 100644 --- a/doc/function/enlarge.txt +++ b/doc/function/enlarge.txt @@ -0,0 +1,16 @@ +Function: enlarge + +--Usage-- +> enlarge(input: image, border_size: amount_to_enlarge) + +Enlarge an image by putting a transparent border around it. +The border size is given in percentages of the image size, so @border_size: 1@ makes the image three times as large by putting a border of 100% the size on all sides. + +--Parameters-- +! Parameter Type Description +| @input@ [[type:image]] Image to enlarge +| @border_size@ [[type:double]] Amount of border to add + +--Examples-- +> enlarge(input: "image1.png", border_size: 0.1) == [[Image]] +>>> enlarge(light: "image1.png", border_size: 0.1) == "image_enlarge.png" diff --git a/doc/function/image1.png b/doc/function/image1.png index d1028606..46890579 100644 Binary files a/doc/function/image1.png and b/doc/function/image1.png differ diff --git a/doc/function/image2.png b/doc/function/image2.png index 8199112e..f75160ab 100644 Binary files a/doc/function/image2.png and b/doc/function/image2.png differ diff --git a/doc/function/image_combine_blend.png b/doc/function/image_combine_blend.png index 4b123a1b..befe4211 100644 Binary files a/doc/function/image_combine_blend.png and b/doc/function/image_combine_blend.png differ diff --git a/doc/function/image_enlarge.png b/doc/function/image_enlarge.png index 3157a62b..95243c01 100644 Binary files a/doc/function/image_enlarge.png and b/doc/function/image_enlarge.png differ diff --git a/doc/function/image_linear_blend.png b/doc/function/image_linear_blend.png index 8619df24..fcd9cf87 100644 Binary files a/doc/function/image_linear_blend.png and b/doc/function/image_linear_blend.png differ diff --git a/doc/function/image_masked_blend.png b/doc/function/image_masked_blend.png index 3768781d..ba47c6ae 100644 Binary files a/doc/function/image_masked_blend.png and b/doc/function/image_masked_blend.png differ diff --git a/doc/function/image_set_alpha.png b/doc/function/image_set_alpha.png index ae5bcf82..1daca5d1 100644 Binary files a/doc/function/image_set_alpha.png and b/doc/function/image_set_alpha.png differ diff --git a/doc/function/image_set_mask.png b/doc/function/image_set_mask.png index 3db5d8dd..98c31864 100644 Binary files a/doc/function/image_set_mask.png and b/doc/function/image_set_mask.png differ diff --git a/doc/function/linear_blend.txt b/doc/function/linear_blend.txt index 767a3372..b9711445 100644 --- a/doc/function/linear_blend.txt +++ b/doc/function/linear_blend.txt @@ -9,6 +9,9 @@ Function: linear_blend Blend two images together using a linear gradient. +Coordinates range from 0 to 1, where 0 is the top and the left, and 1 is the right and the bottom. +So for example a blend from @x1:0, y1:0@ to @x2:0, y2:1@ is from top to bottom. + The images must have the same size. --Parameters-- @@ -20,8 +23,8 @@ The images must have the same size. --Examples-- This gives a vertical gradient: -> linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:1, y2:1) == [[Image]] -
 linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:1, y2:1) == "image_linear_blend.png"
+> linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:0, y2:1) == [[Image]] +>>> linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:1, y2:1) == "image_linear_blend.png" --See also-- | [[fun:masked_blend]] Blend two images together using a third mask image. diff --git a/doc/function/masked_blend.txt b/doc/function/masked_blend.txt index 1d6419f3..3d66b29b 100644 --- a/doc/function/masked_blend.txt +++ b/doc/function/masked_blend.txt @@ -17,7 +17,7 @@ The images must have the same size. --Examples-- > masked_blend(light: "image1.png", dark: "image2.png", mask: "image3.png") == [[Image]] -
 masked_blend(light: "image1.png", dark: "image2.png", mask: "image3.png") == "image_masked_blend.png"
+>>> masked_blend(light: "image1.png", dark: "image2.png", mask: "image3.png") == "image_masked_blend.png" --See also-- | [[fun:linear_blend]] Blend two images together using a linear gradient. diff --git a/doc/function/remove_tag.txt b/doc/function/remove_tag.txt index e69de29b..24ed9993 100644 --- a/doc/function/remove_tag.txt +++ b/doc/function/remove_tag.txt @@ -0,0 +1,28 @@ +Function: remove_tag + +--Usage-- +> remove_tag(tag: some_tag, some_string) +> tag_remove_rule(tag: some_tag)(some_string) + +Remove a tag and its matching close tag from a [[type:tagged string]], but keep the contents. + +The tag can be a whole tag, @""@, or a prefix @" remove_tag(tag: "", "bold text") == "bold text" +> remove_tag(tag: "bold text") == "bold text" +> +> f := tag_remove_rule(tag: "") +> f("text, reminder italic") == "text, reminder italic" + +--See also-- +| [[fun:tag_contents|tag_contents / tag_contents_rule]] + Change the contents of a specific tag. +| [[fun:to_text]] Remove all tags from tagged text. diff --git a/doc/function/set_alpha.txt b/doc/function/set_alpha.txt index e69de29b..96ab3734 100644 --- a/doc/function/set_alpha.txt +++ b/doc/function/set_alpha.txt @@ -0,0 +1,21 @@ +Function: set_alpha + +--Usage-- +> set_alpha(image: image, alpha: transparency value) + +Make an image more transparent. + +The transprarency is multiplied by @alpha@. +If @alpha@ is 1 the image stays the same, if @alpha@ is 0 the image becomes completely transprent. + +--Parameters-- +! Parameter Type Description +| @image@ [[type:image]] Image to make transparent. +| @alpha@ [[type:double]] Transparency factor. + +--Examples-- +> set_alpha(image: "image1.png", alpha: 0.5) == [[Image]] +>>> set_mask(image: "image1.png", alpha: 0.5) == "image_set_alpha.png" + +--See also-- +| [[fun:set_mask]] Set the transparancy mask of an image. diff --git a/doc/function/set_combine.txt b/doc/function/set_combine.txt index e69de29b..0208ec19 100644 --- a/doc/function/set_combine.txt +++ b/doc/function/set_combine.txt @@ -0,0 +1,17 @@ +Function: set_combine + +--Usage-- +> set_combine(input: image, combine: combine_mode) + +Set how the resulting image should be combined with the background. + +--Parameters-- +! Parameter Type Description +| @input@ [[type:image]] Image to change combining mode of +| @combine@ [[type:combine]] Combining function to use + +--Examples-- +> set_combine(input: "image1.png", combine: "shadow") == [[Image]] + +--See also-- +| [[fun:combine_blend]] Blend two images together using a given [[type:combine|combining mode]]. diff --git a/doc/function/set_mask.txt b/doc/function/set_mask.txt index e69de29b..340ac8cb 100644 --- a/doc/function/set_mask.txt +++ b/doc/function/set_mask.txt @@ -0,0 +1,21 @@ +Function: set_mask + +--Usage-- +> set_mask(image: image, mask: mask_image) + +Make parts of an image (more) transparent using a mask. +Black areas in the mask make the image transparent, white areas stay opaque. + +The images must have the same size. + +--Parameters-- +! Parameter Type Description +| @image@ [[type:image]] Image to apply the mask to +| @mask@ [[type:image]] Mask image. + +--Examples-- +> set_mask(image: "image1.png", mask: "image3.png") == [[Image]] +>>> set_mask(image: "image1.png", mask: "image3.png") == "image_set_mask.png" + +--See also-- +| [[fun:set_alpha]] Change the transparency of an image. diff --git a/doc/function/sort_text.txt b/doc/function/sort_text.txt new file mode 100644 index 00000000..9e4a5eee --- /dev/null +++ b/doc/function/sort_text.txt @@ -0,0 +1,37 @@ +Function: sort_text + +--Usage-- +> sort_text(order: order specification, some_text) +> sort_rule(order: order specification)(some_text) + +Sort a string or filter it by keeping specific characters. + +When the @order@ parameter is not given, the input is sorted in alphabetical order. + +Otherwise the @order@ parameter determines what characters to show in the output. +The @order@ is a string consisting of multiple ''parts'', each part selects a specific thing from the input. +! Part sort("zzyyxx") Description +| @"x"@ @"xx"@ A normal character, selects all matching characters from the input +| @""@ @"xy"@ Selects the characters from the input, but only once. + @""@ is the same as @""@. +| @"[wxy]"@ @"yyxx"@ Selects the given characters, but keep them in the same order as in the input. +| @"(xwz)"@ @"zzxx"@ Selects the given characters, and put them in the order that minimizes the distance. + around a 'circle'. Imagine w x and y in a circle, then "zx" is shorter then "x.z" because the latter passes the "w" space. + This sorting option is used to sort colored mana symbols in Magic. + +This function is available in [[script:rule form]]. + +--Parameters-- +! Parameter Type Description +| @input@ [[type:string]] Text to sort +| @order@ [[type:string]] (optional) Order specification + +--Examples-- +> sort_text("banana") == "aaabnn" +> sort_text(order: "na", "banana") == "nnaaa" +> sort_text(order: "", "banana") == "na" +> sort_text(order: "[na]", "banana") == "anana" +> sort_text(order: "[1234567890](wubrg)", "21wg") == "21gw" +> +> f := sort_rule(order: "[1234567890](wubrg)") +> f("21wg") == "21gw" diff --git a/doc/function/tag_contents.txt b/doc/function/tag_contents.txt index e69de29b..a81ef16f 100644 --- a/doc/function/tag_contents.txt +++ b/doc/function/tag_contents.txt @@ -0,0 +1,31 @@ +Function: tag_contents + +--Usage-- +> tag_contents(tag: some_tag, contents: some_function, some_string) +> tag_contents_rule(tag: some_tag, contents: some_function)(some_string) + +Apply a function to the contents of a particular tag. +The function is called with @input@ set to the old value inside the tag. + +The tag can be a whole tag, @""@, or a prefix @" tag_contents(tag: "", contents: to_upper, "this is text") +> == "this IS TEXT" +> tag_contents(tag: " loses 1 life") +> == "Pink Elephant loses 1 life" +> +> f := tag_contents_rule(tag: "", contents: {""}) +> f("text, reminder italic") == "text, reminder " + +--See also-- +| [[fun:remove_tag|remove_tag / tag_remove_rule]] + Remove a tag, keep the contents.