Repository navigation
Group example queries into sections via a section frontmatter key - #168
Open
hannahbast wants to merge 1 commit into
Open
hannahbast wants to merge 1 commit into
hannahbast wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With many example queries for an endpoint, the flat list in the examples panel gets hard to scan. This change adds an optional
sectionkey to the frontmatter of an example, next totitleandorder. Examples with the same section are listed together under a header with that name, sorted byorderwithin the section. The order of the sections is set by the newexample_sectionsoption 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
createExampleandupdateExampletake the section as an optional second parameter. For that,PUT /endpoints/{slug}/examples/ordernow also accepts objects withnameandsection.So far, the whole leading
#+block of an example file was stripped before the query was served, so aresult-plotconfiguration never reached the editor. Now onlytitle,sectionandorderare stripped, and all other keys are part of the query.