Display examples interleaved within reference docs #675
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.
I made some updates to p5 here processing/p5.js#7466 and tested this with
npm run custom:dev https://github.com/processing/p5.js.git#interleaved-examples
on this branch.\op
So the idea is to allow examples to be put in between other sections of the docs so they can stay more contextual.
In the reference, you can add the
example
tag to a code block like this:In processing/p5.js#7466, I tried pulling an example for
image()
up in between other stuff, and it looks like this:Notes
<pre><code class="example">
blocks out of the description rather than using a different JSON structure because that would invalidate the existing structure in the reference section of the site@example
at the end in the reference in the p5 codebase. Both can be used in one reference without issue at least