|
142 | 142 | * {@code ./gradlew -p x-pack/plugin/esql/ test}
|
143 | 143 | * </li>
|
144 | 144 | * <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> |
145 | 152 | * Now it’s time to generate some docs!
|
146 | 153 | * Actually, running the tests in the example above should have done it for you.
|
147 | 154 | * The generated files are
|
148 | 155 | * <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> |
157 | 163 | * </ul>
|
158 | 164 | *
|
159 | 165 | * 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 |
161 | 167 | * docs. There are plenty of examples on how
|
162 | 168 | * 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}. |
164 | 170 | * <p>
|
165 | 171 | * You can generate the docs for just your function by running
|
166 | 172 | * {@code ./gradlew :x-pack:plugin:esql:test -Dtests.class='*SinTests'}. It’s just
|
167 | 173 | * running your new unit test. You should see something like:
|
168 | 174 | * </p>
|
169 | 175 | * <pre>{@code
|
170 | 176 | * > 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 |
172 | 178 | * }</pre>
|
173 | 179 | * </li>
|
174 | 180 | * <li>
|
175 | 181 | * Build the docs by cloning the <a href="https://github.com/elastic/docs">docs repo</a>
|
176 | 182 | * and running:
|
177 | 183 | * <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 |
179 | 185 | * }</pre>
|
180 | 186 | * from the elasticsearch directory. The first time you run the docs build it does a bunch
|
181 | 187 | * of things with docker to get itself ready. Hopefully you can sit back and watch the show.
|
|
0 commit comments