Better example tooling #4517
Closed
Arithmomaniac
started this conversation in
Ideas
Replies: 2 comments 6 replies
-
we talked about that when doing example, we do have a gap in the language to be able to represent that, decided to hold on it for now but I do agree this would be really nice. |
Beta Was this translation helpful? Give feedback.
6 replies
-
At this point, about everything actionable has an issue created for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many API developer portals (such as readme.com) make heavy use of examples, and it's a huge boon to have compile-type checking on them. But writing them is a bit hard.
I can think of two main places examples can come from:
In this case, the migration from e.g.
{"my array": []}
to#{`my array`: #[]}
makes this super tedious in bulk (see Value blocks for simplifying defining nested values #3931). It would be a huge help if there was a CLI command that could take arbitrary JSON and spit out equivalent "value"s.example
decorator, so while there is realtime method validation, intellisense gives you no help (asides from general string matching) in defining the example:It would be great if the type of
@example : example
could be an inferredT
instead of justunknown
.And even after you have examples, the differing tooltip and error messages between different ways of specifying an example is really confusing and sometimes incredibly verbose [Playground]. So much so, I'm not sure I have a concrete "ask" (except #4544 and #4545).
These thoughts are based on the work migrating the Sefaria spec; they have hundreds of examples which (see #3866) were manually migrated.
Beta Was this translation helpful? Give feedback.
All reactions