processing / p5.js-website

New p5.js website!
http://p5js.org
MIT License
18 stars 92 forks source link

Fix Empty examples are shown on several reference pages #560

Closed shibomb closed 1 month ago

shibomb commented 2 months ago

resolves #559

Changes

Corrected separator strings in some reference page examples.

davepagurek commented 2 months ago

Thanks for making these changes! The ones in the en/ folder get automatically generated when we run npm run build:reference, which pulls in the contents from the p5.js repo. If we want the changes to stick around, I think we'll have to do them automatically in the build script. Maybe we can edit that to automatically apply the formatting changes here?

The conversion from the JSON data to the mdx file happens here, I believe: https://github.com/processing/p5.js-website/blob/df3d65019dafc24e54e8cb429cc9e38b1618c230/src/scripts/builders/reference.ts#L237

shibomb commented 2 months ago

@davepagurek Thank you for letting us know that the English version will be converted and about the generator.

I have re-examined it: The blank line at the end of the example in the function document in the p5.js source code seems to cause this problem. e.g. line function's example https://github.com/processing/p5.js/blob/main/src/core/shape/2d_primitives.js line:702 empty row

 * </div>
 *
 */

This problem can be solved by removing the blank line in the p5.js source code. However, even if we fix it, there is a possibility that these blank lines will reappear in the future.

So, I thought of a way to remove the last blank line in the website-side generator that you advised. I will create PR.

shibomb commented 1 month ago

If #561 is merged, this pull request is unnecessary and I have withdrawn it. see: https://github.com/processing/p5.js-website/pull/561#issuecomment-2400174513