Repository navigation
Description
Prerequisites
- I have searched existing issues to ensure this feature hasn't already been requested
- I have tested using the latest version of docs-builder
What problem are you trying to solve?
In the ES|QL docs, the examples have a query followed by the expected output. In the 8.x docs the output table is nicely formatted monospace, and clearly attached to the query, while in the new docs the table is not using a monospace font, and is visibly separated from the query. I read the docs on tables at https://elastic.github.io/docs-builder/syntax/tables/, and there does not appear to be any formatting option support like we used in asciidoc for this.
This is an example from 8.x:
And this is an example from main (using docs-builder built locally on the 11th March):
In 8.x we achieved this formatting in asciidoc with:
To count the number of rows, use `COUNT()` or `COUNT(*)`
[source.merge.styled,esql]
----
include::{esql-specs}/docs.csv-spec[tag=countAll]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/docs.csv-spec[tag=countAll-result]
|===
For main, we cannot use include like this, but we have written our own include feature as part of the docs generating process, so the markdown looks like:
To count the number of rows, use `COUNT()` or `COUNT(*)`
\```esql
FROM employees
| STATS count = COUNT(*) BY languages
| SORT languages DESC
\```
| count:long | languages:integer |
| --- | --- |
| 10 | null |
| 21 | 5 |
| 18 | 4 |
| 17 | 3 |
| 19 | 2 |
| 15 | 1 |
Proposed Solution
The missing piece is something similar to the line [%header.monospaced.styled,format=dsv,separator=|] from the asciidoc table. We don't need that exact set of arguments, but something that would allow us to achieve:
- Monospaced font
- Visible attachment of the table to the query:
- remove separation
- perhaps add a border so it is clear they are attached
Making it looks identical to the older docs is not required, but making it look like a results table, not a generic text table, is required.
Perhaps something like:
::::{table} font=monospaced padding=0 border=1
| count:long | languages:integer |
| --- | --- |
| 10 | null |
| 21 | 5 |
| 18 | 4 |
| 17 | 3 |
| 19 | 2 |
| 15 | 1 |
::::
Activity
cotti commentedon Jun 3, 2026
AI triage
Automated investigation against the current codebase. A human still needs to confirm before any code change.
Original concern
ES|QL examples render their result tables as plain, sans-serif Markdown tables that float free of the preceding query, instead of the monospaced, visually-attached "result" tables AsciiDoc produced via
[%header.monospaced.styled,...]; the request is a way to mark a table as an ES|QL result table.Findings
src/Elastic.Markdown/Myst/CodeBlocks/SupportedLanguages.cs:L50andsrc/Elastic.Documentation.Site/Assets/hljs.ts:L2,L54—esqlexists only as a syntax-highlighting language for the query code block. There is no notion of an attached "result" payload, so the output table is just an ordinary pipe table sitting after the code fence.src/Elastic.Documentation.Site/Assets/markdown/table.css:L17-L39— every Markdown/{csv-include}table is styled the same: bordered, sans-serif header (font-sans, L27), no monospace path anywhere. The onlyfont-monorules in the asset tree are for callout badges, inline code,kbd, and footnotes — none reach data tables.src/Elastic.Documentation.Site/Assets/markdown/table.css:L2-L3— the table wrapper carries its ownmy-4vertical margin, which (stacked on the code block's own margin) produces exactly the "visibly separated from the query" gap the issue describes.src/Elastic.Markdown/Myst/Directives/Table/TableDirectiveBlock.cs:L16-L50— a{table}directive now exists, but it reads onlyProp("widths")(a 12-unit column-width grid). It has nofont/border/padding/class/ "result" option — i.e. it does not implement the styling axes this issue asks for. Added in PR #2852 (commit05f168a5, 2026-03-13), after this issue was filed.src/Elastic.Markdown/Myst/Directives/CsvInclude/CsvIncludeBlock.cs+docs/syntax/csv-include.md:L3—{csv-include}also renders through the sametable.css, so it is not a monospace/result-table escape hatch either.Verdict
Needs stakeholder input
The requested capability does not exist: there is no monospaced, query-attached "result table" style, and the
{table}directive only controls column widths. Closing the gap is not a mechanical fix — it changes reader-visible rendering (monospace font, removed separation, attaching border) and introduces new author-facing markup (the issue itself proposes::::{table} font=monospaced padding=0 border=1). Both the visual treatment and the authoring surface are design decisions, so this needs UX + writer sign-off before implementation.Proposal
Open questions to resolve before coding:
my-4top margin so it abuts the query, and a connecting border/background? Should it visually read as one unit with the code block above it (shared corner radius / no gap), and does it need a dark-mode variant?{table}directive with a style/variant option (e.g.:class: esql-resultor:style: result) rather than the issue'skey=valuesyntax, which{table}does not use; (b) a dedicated{esql-result}(or{result-table}) directive; or (c) auto-detect a table immediately following anesqlblock. Each has a different migration cost for the generated ES|QL docs.Prop+ a CSS class intable.css); if it's auto-attachment to the preceding code block, it needs parser-level coordination between the code block and the following table.Related issues
Part of a broader tables cluster, all open unless noted: #112 ([Discuss] Tables), #508 (list support in table cells), #3449 (footnotes/callouts in tables), and #534 (column-padding bug, closed). #718 is distinct (a result-table style variant, not a duplicate), but a maintainer may want to plan a coherent table-styling roadmap across these. #816 (closed) covered ES|QL query highlighting, not the output table, so it's adjacent rather than overlapping.
Notes
docs-builderrendering. The ES|QL examples themselves are generated upstream, but the formatting ask is entirely about how docs-builder renders the resulting Markdown table — no cross-repo change required.tablescluster label (already on List support in table cells #508/Table formatting issue with column padding #534/[Feature Request]: Support for Footnotes or Fancy Callouts in Tables #3449) would group this issue with the rest.Add version index client for remote OpenAPI spec resolution (#719)
Add strict api: schema with product, repository, and children (#3804)
Add version index client for remote OpenAPI spec resolution (#3805)