Skip to content

Commit 597a749

Browse files
committed
Support depthOffset in MD docs headings for nesting functions
1 parent b6c9b9b commit 597a749

File tree

11 files changed

+34
-23
lines changed

11 files changed

+34
-23
lines changed

docs/reference/query-languages/esql/_snippets/functions/layout/st_xmax.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/st_xmin.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/st_ymax.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/st_ymin.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/lists/spatial-functions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* [`ST_X`](../../functions-operators/spatial-functions.md#esql-st_x)
77
* [`ST_Y`](../../functions-operators/spatial-functions.md#esql-st_y)
88
* [preview] [`ST_ENVELOPE`](../../functions-operators/spatial-functions.md#esql-st_envelope)
9-
* [preview] [`ST_XMAX`](../../functions-operators/spatial-functions.md#esql-st_xmax)
10-
* [preview] [`ST_XMIN`](../../functions-operators/spatial-functions.md#esql-st_xmin)
11-
* [preview] [`ST_YMAX`](../../functions-operators/spatial-functions.md#esql-st_ymax)
12-
* [preview] [`ST_YMIN`](../../functions-operators/spatial-functions.md#esql-st_ymin)
9+
* [preview] [`ST_XMAX`](../../functions-operators/spatial-functions.md#esql-st_xmax)
10+
* [preview] [`ST_XMIN`](../../functions-operators/spatial-functions.md#esql-st_xmin)
11+
* [preview] [`ST_YMAX`](../../functions-operators/spatial-functions.md#esql-st_ymax)
12+
* [preview] [`ST_YMIN`](../../functions-operators/spatial-functions.md#esql-st_ymin)

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/FunctionInfo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
*/
7171
String appendix() default "";
7272

73+
/**
74+
* The heading depth of this function in the docs, relative to the normal depth of functions.
75+
*/
76+
int depthOffset() default 0;
77+
7378
/**
7479
* The position the function can appear in the language.
7580
*/

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StXMax.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class StXMax extends UnaryScalarFunction {
4545
returnType = "double",
4646
description = "Extracts the maximum value of the `x` coordinates from the supplied geometry.\n"
4747
+ "If the geometry is of type `geo_point` or `geo_shape` this is equivalent to extracting the maximum `longitude` value.",
48-
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max")
48+
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max"),
49+
depthOffset = 1 // So this appears as a subsection of ST_ENVELOPE
4950
)
5051
public StXMax(
5152
Source source,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StXMin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class StXMin extends UnaryScalarFunction {
4545
returnType = "double",
4646
description = "Extracts the minimum value of the `x` coordinates from the supplied geometry.\n"
4747
+ "If the geometry is of type `geo_point` or `geo_shape` this is equivalent to extracting the minimum `longitude` value.",
48-
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max")
48+
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max"),
49+
depthOffset = 1 // So this appears as a subsection of ST_ENVELOPE
4950
)
5051
public StXMin(
5152
Source source,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StYMax.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class StYMax extends UnaryScalarFunction {
4545
returnType = "double",
4646
description = "Extracts the maximum value of the `y` coordinates from the supplied geometry.\n"
4747
+ "If the geometry is of type `geo_point` or `geo_shape` this is equivalent to extracting the maximum `latitude` value.",
48-
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max")
48+
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max"),
49+
depthOffset = 1 // So this appears as a subsection of ST_ENVELOPE
4950
)
5051
public StYMax(
5152
Source source,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StYMin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class StYMin extends UnaryScalarFunction {
4545
returnType = "double",
4646
description = "Extracts the minimum value of the `y` coordinates from the supplied geometry.\n"
4747
+ "If the geometry is of type `geo_point` or `geo_shape` this is equivalent to extracting the minimum `latitude` value.",
48-
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max")
48+
examples = @Example(file = "spatial_shapes", tag = "st_x_y_min_max"),
49+
depthOffset = 1 // So this appears as a subsection of ST_ENVELOPE
4950
)
5051
public StYMin(
5152
Source source,

0 commit comments

Comments
 (0)