Skip to content

Group example queries into sections via a section frontmatter key - #168

Open
hannahbast wants to merge 1 commit into
mainfrom
example-sections
Open

hannahbast wants to merge 1 commit into
mainfrom
example-sections

Conversation

@hannahbast

Copy link
Copy Markdown
Contributor

With many example queries for an endpoint, the flat list in the examples panel gets hard to scan. This change adds an optional section key to the frontmatter of an example, next to title and order. Examples with the same section are listed together under a header with that name, sorted by order within the section. The order of the sections is set by the new example_sections option of the endpoint. Sections not listed there follow alphabetically, and examples without a section come last under "Other". Without any section, the list looks as before.

Dragging an example below another header moves it to that section, and createExample and updateExample take the section as an optional second parameter. For that, PUT /endpoints/{slug}/examples/order now also accepts objects with name and section.

So far, the whole leading #+ block of an example file was stripped before the query was served, so a result-plot configuration never reached the editor. Now only title, section and order are stripped, and all other keys are part of the query.

An example can now carry a `section` key in its frontmatter. Examples of the same section are listed together under a header, in the order given by the new `example_sections` option of the endpoint. Examples without a section come last under "Other", and without any section the list looks as before.

Along the way, only the keys `title`, `section` and `order` are stripped from the frontmatter of an example. Other keys like `result-plot` are part of the query and now reach the editor.
Copilot AI balanced review requested due to automatic review settings November 29, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants