-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support \example
in codegen
#3378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame to loose the example titles, but otherwise LGTM.
Nice to get that whitespace correct!
let example = example.trim(); | ||
let path = base_path.join(format!("{example}.{extension}")); | ||
let contents = std::fs::read_to_string(&path) | ||
.with_context(|| format!("couldn't open code example {path:?}"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In wonder if we should really require that all languages has all examples. Some examples only makes sense in some languages, e.g. an example of how to convert a python PIL image to a Rerun image, or similar.
I think it makes sense to require that each language has at least one example per archetype though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to add stricter checks (check that each archetype has an \example
), but decided to hold off for now. I think this would be good to discuss during standup
Co-authored-by: Emil Ernerfeldt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super!
What
\example
tag which replaces existing dance around examples included via\py
,\rs
, and\cpp
rerun/rerun_cpp/src/rerun/archetypes/points3d.hpp
Lines 29 to 42 in b2f7f19
#[doc="..."]
tokens to/// ...
Context
, which means we can now collect errors instead of failing immediately on the first one..rs
code examples:Checklist