Browse Source

Docs: convert the results into a table (ESQL-1143)

This moves the results in the esql examples from preformatted text to an
actual html table. We can further format it from there.
Nik Everett 2 years ago
parent
commit
75a6ac1ed1

+ 8 - 1
docs/reference/esql/functions/mv_avg.asciidoc

@@ -6,7 +6,14 @@ of all of the values. For example:
 [source,esql]
 ----
 include::{esql-specs}/math.csv-spec[tag=mv_avg]
-include::{esql-specs}/math.csv-spec[tag=mv_avg-result]
 ----
 
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/math.csv-spec[tag=mv_avg-result]
+|===
+
+
 NOTE: The output type is always a `double` and the input type can be any number.

+ 7 - 1
docs/reference/esql/functions/mv_count.asciidoc

@@ -6,7 +6,13 @@ of values:
 [source,esql]
 ----
 include::{esql-specs}/string.csv-spec[tag=mv_count]
-include::{esql-specs}/string.csv-spec[tag=mv_count-result]
 ----
 
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/string.csv-spec[tag=mv_count-result]
+|===
+
 NOTE: This function accepts all types and always returns an `integer`.

+ 14 - 2
docs/reference/esql/functions/mv_max.asciidoc

@@ -5,14 +5,26 @@ Converts a multivalued field into a single valued field containing the maximum v
 [source,esql]
 ----
 include::{esql-specs}/math.csv-spec[tag=mv_max]
-include::{esql-specs}/math.csv-spec[tag=mv_max-result]
 ----
 
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/math.csv-spec[tag=mv_max-result]
+|===
+
 It can be used by any field type, including `keyword` fields. In that case picks the
 last string, comparing their utf-8 representation byte by byte:
 
 [source,esql]
 ----
 include::{esql-specs}/string.csv-spec[tag=mv_max]
-include::{esql-specs}/string.csv-spec[tag=mv_max-result]
 ----
+
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/string.csv-spec[tag=mv_max-result]
+|===

+ 14 - 2
docs/reference/esql/functions/mv_min.asciidoc

@@ -5,14 +5,26 @@ Converts a multivalued field into a single valued field containing the minimum v
 [source,esql]
 ----
 include::{esql-specs}/math.csv-spec[tag=mv_min]
-include::{esql-specs}/math.csv-spec[tag=mv_min-result]
 ----
 
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/math.csv-spec[tag=mv_min-result]
+|===
+
 It can be used by any field type, including `keyword` fields. In that case picks the
 first string, comparing their utf-8 representation byte by byte:
 
 [source,esql]
 ----
 include::{esql-specs}/string.csv-spec[tag=mv_min]
-include::{esql-specs}/string.csv-spec[tag=mv_min-result]
 ----
+
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/string.csv-spec[tag=mv_min-result]
+|===

+ 7 - 1
docs/reference/esql/functions/mv_sum.asciidoc

@@ -6,7 +6,13 @@ of all of the values. For example:
 [source,esql]
 ----
 include::{esql-specs}/math.csv-spec[tag=mv_sum]
-include::{esql-specs}/math.csv-spec[tag=mv_sum-result]
 ----
 
+Returns:
+
+[%header,format=dsv,separator=|]
+|===
+include::{esql-specs}/math.csv-spec[tag=mv_sum-result]
+|===
+
 NOTE: The input type can be any number and the output type is the same as the input type.

+ 4 - 3
docs/reference/esql/functions/split.asciidoc

@@ -8,9 +8,10 @@ include::{esql-specs}/string.csv-spec[tag=split]
 ----
 
 Which splits `"foo;bar;baz;qux;quux;corge"` on `;` and returns an array:
-[source,esql]
-----
+
+[%header,format=dsv,separator=|]
+|===
 include::{esql-specs}/string.csv-spec[tag=split-result]
-----
+|===
 
 WARNING: Only single byte delimiters are currently supported.

+ 1 - 1
x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec

@@ -213,8 +213,8 @@ ROW words="foo;bar;baz;qux;quux;corge"
 // end::split[]
 ;
 
-words:keyword | word:keyword
 // tag::split-result[]
+             words:keyword | word:keyword
 foo;bar;baz;qux;quux;corge | [foo,bar,baz,qux,quux,corge]
 // end::split-result[]
 ;