Closed brianespinosa closed 1 year ago
Missing code shouldn't throw an error anymore since v0.7.0-next.2
.When a step doesn't have code it shows the code from the previous step.
But that's probably not what you are suggesting. Can you provide a small example to see if I understand?
The fix in 0.7.0 RC2 is what I need. Thanks! I'll keep an eye out for the next minor release.
Admittedly... this was a bug report with a hidden feature request attached to it. I must have put on my product manager hat last night.
I saw 0.7.0 was released and updated locally and I am still seeing the issue, though I suspect it may be because I am using next-mdx-remote
in my implementation. Let me dig a bit more today and I should be able to also share some working examples of what I am seeing with a public repo.
Thanks for all your work on codehike btw. Great stuff.
Maybe try to reproduce it in the playground: https://play.codehike.org/
@pomber Yes, I was able to reproduce and turns out I guess that this is expected, at least in the first slide as the error message "The first step should have some code" is in steps.tsx
Yes, that's intended, if a step doesn't have code it uses the code from the previous step.
I'll close this one. If that error still blocks your use case, feel free to create a new issue.
It would make more sense if we could just render whatever the MDX is for the slide instead of the code hike code/example in the north pane in any scenario where there is no code block. This might give the option for others to create slides in between a code walkthrough.
I think the challenge might be that we are parsing the contents of a slide and anything outside of a code block is being interpreted as a slide note. My suggestion above might only be possible if we made a change to how the slide notes were parsed. One possibility would be having a CH.SlideNotes component to contain them in a slide, or possibly by adding frontmatter support per slide.