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

[ES|QL] Automate part of doc generation via annotations #104247

Open
dej611 opened this issue Jan 11, 2024 · 7 comments
Open

[ES|QL] Automate part of doc generation via annotations #104247

dej611 opened this issue Jan 11, 2024 · 7 comments
Assignees
Labels
:Analytics/ES|QL AKA ESQL >enhancement ES|QL-ui Impacts ES|QL UI Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@dej611
Copy link
Contributor

dej611 commented Jan 11, 2024

Description

After #103686 I think part of the doc could be automated via scripting, at least for the following fields:

  • signature
  • parameters (and their description)
  • description
  • examples?
@dej611 dej611 added >enhancement Team:Docs Meta label for docs team needs:triage Requires assignment of a team area label :Analytics/ES|QL AKA ESQL ES|QL-ui Impacts ES|QL UI labels Jan 11, 2024
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed Team:Docs Meta label for docs team needs:triage Requires assignment of a team area label labels Jan 11, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@nik9000
Copy link
Member

nik9000 commented Jan 11, 2024

We already automate the parameter types and the railroad diagrams. But we could probably generate even more of this stuff. I'm not sure we'd want to generate all of, but a lot more.

@dej611
Copy link
Contributor Author

dej611 commented Jan 11, 2024

I do not think generate all of it makes sense, but at least the structured part as described in the issue content.
We already do that in Kibana and want to leverage the new SHOW FUNCTIONS to use ES as source of truth for it.

@nik9000
Copy link
Member

nik9000 commented Jan 11, 2024

Right now we generate two files and manually make another "main" file with the description and the name and description and an example. But I'll bet we could generate that "main" file and have it include hand written asciidoc files. That'd be pretty simple.

nik9000 added a commit to nik9000/elasticsearch that referenced this issue 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 elastic#104247
nik9000 added a commit that referenced this issue Mar 19, 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
@nik9000
Copy link
Member

nik9000 commented Mar 25, 2024

I've automated the generation of the signature, examples, and parameters. And a file that links them all together. Basically all of this. A human being has to manually merge the data in the docs and annotations and replace the hand maintained docs with the generated ones. I'm going to make a list to track them.

@nik9000
Copy link
Member

nik9000 commented Mar 25, 2024

nik9000 added a commit to nik9000/elasticsearch that referenced this issue Mar 26, 2024
This takes a stab at generating the markdown files that Kibana uses for
its inline help. It doesn't include all of the examples because the
`@Example` annotation is not filled in - we're tracking that in
elastic#104247 (comment)

There are some links in the output and they are in markdown syntax. We
should figure out how to make them work for kibana.
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Mar 26, 2024
This takes a stab at generating the markdown files that Kibana uses for
its inline help. It doesn't include all of the examples because the
`@Example` annotation is not filled in - we're tracking that in
elastic#104247 (comment)

There are some links in the output and they are in markdown syntax. We
should figure out how to make them work for kibana.
elasticsearchmachine pushed a commit that referenced this issue Apr 9, 2024
This takes a stab at generating the markdown files that Kibana uses for
its inline help. It doesn't include all of the examples because the
`@Example` annotation is not filled in - we're tracking that in
#104247 (comment)

There are some links in the output and they are in markdown syntax. We
should figure out how to make them work for kibana.
@elasticsearchmachine
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement ES|QL-ui Impacts ES|QL UI Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

4 participants