Skip to content

Commit 0061cd2

Browse files
authored
Update ESQL Scalar Documentation (#132579)
* update new docs folder structure * ESQL Update Scalar documentation * fix typo
1 parent f7a9fe6 commit 0061cd2

File tree

1 file changed

+18
-12
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar

1 file changed

+18
-12
lines changed

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,40 +142,46 @@
142142
* {@code ./gradlew -p x-pack/plugin/esql/ test}
143143
* </li>
144144
* <li>
145+
* We need to tag to what release the function applies to so we can generate docs in the next step!
146+
* On the constructor of your function class you very likely have an annotation {@code @FunctionInfo}.
147+
* Add the attribute {@code appliesTo} with availability information. For example a GA function
148+
* available in 9.2.0 would be tagged as
149+
* {@code { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.2.0") }}
150+
* </li>
151+
* <li>
145152
* Now it’s time to generate some docs!
146153
* Actually, running the tests in the example above should have done it for you.
147154
* The generated files are
148155
* <ul>
149-
* <li>{@code docs/reference/esql/functions/description/myfunction.asciidoc}</li>
150-
* <li>{@code docs/reference/esql/functions/examples/myfunction.asciidoc}</li>
151-
* <li>{@code docs/reference/esql/functions/layout/myfunction.asciidoc}</li>
152-
* <li>{@code docs/reference/esql/functions/parameters/myfunction.asciidoc}</li>
153-
* <li>{@code docs/reference/esql/functions/signature/myfunction.svg}</li>
154-
* <li>{@code docs/reference/esql/functions/types/myfunction.asciidoc}</li>
155-
* <li>{@code docs/reference/esql/functions/kibana/definition/myfunction.json}</li>
156-
* <li>{@code docs/reference/esql/functions/kibana/docs/myfunction.asciidoc}</li>
156+
* <li>{@code docs/reference/query-languages/esql/_snippets/functions/description/myfunction.md}</li>
157+
* <li>{@code docs/reference/query-languages/esql/_snippets/functions/examples/myfunction.md}</li>
158+
* <li>{@code docs/reference/query-languages/esql/_snippets/functions/layout/myfunction.md}</li>
159+
* <li>{@code docs/reference/query-languages/esql/_snippets/functions/parameters/myfunction.md}</li>
160+
* <li>{@code docs/reference/query-languages/esql/_snippets/functions/types/myfunction.md}</li>
161+
* <li>{@code docs/reference/query-languages/esql/kibana/definition/functions/myfunction.json}</li>
162+
* <li>{@code docs/reference/query-languages/esql/kibana/docs/functions/myfunction.md}</li>
157163
* </ul>
158164
*
159165
* Make sure to commit them. Add a reference to the
160-
* {@code docs/reference/esql/functions/layout/myfunction.asciidoc} in the function list
166+
* {@code docs/reference/query-languages/esql/_snippets/functions/layout/myfunction.md} in the function list
161167
* docs. There are plenty of examples on how
162168
* to reference those files e.g. if you are writing a Math function, you will want to
163-
* list it in {@code docs/reference/esql/functions/math-functions.asciidoc}.
169+
* list it in {@code docs/reference/query-languages/esql/functions-operators/math-functions.md}.
164170
* <p>
165171
* You can generate the docs for just your function by running
166172
* {@code ./gradlew :x-pack:plugin:esql:test -Dtests.class='*SinTests'}. It’s just
167173
* running your new unit test. You should see something like:
168174
* </p>
169175
* <pre>{@code
170176
* > Task :x-pack:plugin:esql:test
171-
* ESQL Docs: Only files related to [sin.asciidoc], patching them into place
177+
* ESQL Docs: Only files related to [sin.md], patching them into place
172178
* }</pre>
173179
* </li>
174180
* <li>
175181
* Build the docs by cloning the <a href="https://github.com/elastic/docs">docs repo</a>
176182
* and running:
177183
* <pre>{@code
178-
* ../docs/build_docs --doc docs/reference/index.asciidoc --open --chunk 1
184+
* ../docs/build_docs --doc docs/reference/index.md --open --chunk 1
179185
* }</pre>
180186
* from the elasticsearch directory. The first time you run the docs build it does a bunch
181187
* of things with docker to get itself ready. Hopefully you can sit back and watch the show.

0 commit comments

Comments
 (0)