Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESQL: Generate more docs #106367

Merged
merged 7 commits into from
Mar 19, 2024
Merged

ESQL: Generate more docs #106367

merged 7 commits into from
Mar 19, 2024

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 14, 2024

This modifies the ESQL test infrastructure to generate more of the documentation for functions. It generates the Description section, the Examples section, and the Parameters section as separate files so we can use them as needed. It also generates a layout file that's just a guess as to how to render the whole thing. In some cases it'll work and we can use that instead of hand maintaining a "top level" description file for the function.

Most newly generated files are unused. We have to chose to pick them up by replacing the sections we were manually maintaining with an include of the generated section. Or by replacing the entire hand maintained file with the generated top level file.

Relates to #104247

This modifies the ESQL test infrastructure to generate more of the
documentation for functions. It generates the *Description* section, the
*Examples* section, and the *Parameters* section as separate files so we
can use them as needed. It also generates a `layout` file that's just
a guess as to how to render the whole thing. In some cases it'll work
and we can use that instead of hand maintaining a "top level"
description file for the function.

Most newly generated files are unused. We have to chose to pick them up
by replacing the sections we were manually maintaining with an include
of the generated section. Or by replacing the entire hand maintained
file with the generated top level file.

Relates to elastic#104247
@nik9000 nik9000 added >docs General docs changes :Analytics/ES|QL AKA ESQL v8.14.0 labels Mar 14, 2024
@nik9000 nik9000 requested review from dej611 and leemthompo March 14, 2024 15:17
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine added Team:Docs Meta label for docs team Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Mar 14, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

renderParametersList(description.argNames(), description.argDescriptions());
renderDescription(description.description());
boolean hasExamples = renderExamples(EsqlFunctionRegistry.functionInfo(definition));
renderFullLayout(name, hasExamples);
return;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally only plugged this into the functions because I wanted to be able to think about operators in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I wrote all the functions so we can use them for operators if we want. Just plug them in the same was as we do above.

@nik9000
Copy link
Member Author

nik9000 commented Mar 14, 2024

My expectation is that this will change no or very few docs. Most of the generated files haven't been included in the docs build yet. We want to eyeball each one as we pull it in.

@nik9000
Copy link
Member Author

nik9000 commented Mar 14, 2024

There were a few accidental diffs. I'm working on it. Here's a diff of the generated docs: elastic/built-docs@master...elasticsearch_bk_106367

@nik9000
Copy link
Member Author

nik9000 commented Mar 14, 2024

Ok. This change minimizes the docs changes - it's now just standardizing.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nik9000 nik9000 merged commit 1541da5 into elastic:main Mar 19, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants