Open adamchalmers opened 1 week ago
I think this is a @jgomez720 or @JordanNoone question i personally like the images
For history sake and context we did have a no image thing before and Josh worked to make all the samples good and I removed it
Hmm OK interesting. Maybe the images would be more useful if we added annotations e.g. labels on each side showing the KCL tags for that side.
I like Adam's point of them being annotated. I am a big fan of the visuals but it is sometimes hard to tell what feature is which. This would be helpful for onboarding to KCL.
I'm not a huge fan of using assert
just because we are making the assumption that the user understands what assert
is. To be fair, I've never seen assert in coding before I saw it in KCL. But I'm a definite +1 to annotations. @franknoirot and I talked a while ago about highlighting the line of code in the code sample to denote how to use the function, but I wasn't sure how to do it, and didn't start.
Some KCL stdlib functions, like
sin()
, are best documented withasserts
rather than images.E.g. this is the current documentation for
sin()
:I believe the docs would be simpler and easier to understand if instead they just said
with no image.
Proposed solution
KCL stdlib definitions currently require a KCL code block, and always render it as a PNG. The codeblock should optionally start with
//no-png
to signal its PNG shouldn't be rendered.