Skip to content
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

Should we add a message to reference mdx files saying they're auto-generated? #702

Open
davepagurek opened this issue Feb 15, 2025 · 9 comments
Assignees
Labels
Documentation Improvements or additions to documentation Good First Issue Good for newcomers

Comments

@davepagurek
Copy link
Collaborator

Topic

It's a very common mistake for newcomers to this repo to try to edit a reference mdx file -- editing them does work, but they will get overwritten in the next release because the p5.js repo is the source of truth for (English) reference items.

Maybe we could add a comment to the top of each mdx file saying that it's auto generated? Ideally also with a link to where in the p5 repo it came from, similar to the link we put at the bottom of reference pages? This should only exist in the English ones, since the translations do actually live in this repo.

@davepagurek davepagurek added Discussion Good First Issue Good for newcomers Help Wanted Extra attention is needed labels Feb 15, 2025
@davepagurek
Copy link
Collaborator Author

If we do want to do this, the conversion to mdx happens here

const convertDocsToMDX = async (
(and also in saveMdx() below.)

@ksen0
Copy link
Member

ksen0 commented Feb 18, 2025

@davepagurek I agree, this is a good idea.

Practically, would it mean appending a comment (eg /* This file is auto-generated; to update the reference or fix typos, please check the inline documentation in [LINK] */) to each .mdx file when they are generated (and therefore only affecting files in en?) Would it break the astro parsing to put such a comment at the top of the file where it's visible BEFORE the person starts editing?

What do you think about updating the phrasing of the text at the bottom of each reference page to explicitly state: that reference pages are auto-generated?

@davepagurek
Copy link
Collaborator Author

Everything between the two --- lines is yaml, which supports comments starting with a #, so it would get ignored if we put it in like:

---
# This file is auto-generated; to update the reference or fix typos, please check the inline documentation in [LINK]
title: abs
module: Math
submodule: Calculation
file: src/math/calculation.js
description: >
  <p>Calculates the absolute value of a number.</p>
line: 10
isConstructor: false
itemtype: method
class: p5
params:
  - name: 'n'
    description: |
      <p>number to compute.</p>
    type: Number
return:
  description: absolute value of given number.
  type: Number
chainable: false
---


# abs

What do you think about updating the phrasing of the text at the bottom of each reference page to explicitly state: that reference pages are auto-generated?

Sounds good to me, maybe: "This page is generated from the comments in [LINK]. Feel free to edit it and submit a pull request!"

@ksen0 ksen0 added Documentation Improvements or additions to documentation and removed Discussion labels Feb 19, 2025
@krishna4040
Copy link

@ksen0 I was planning to work on this issue, let me know otherwise

@davepagurek
Copy link
Collaborator Author

Thanks @krishna4040, I'll assign this to you!

Swapnil-6161 pushed a commit to Swapnil-6161/p5.js-website that referenced this issue Mar 29, 2025
@Swapnil-6161
Copy link

@davepagurek sir i have added the comment on the start of every mdx english files. kindly check my pr.

@ksen0
Copy link
Member

ksen0 commented Mar 29, 2025

Hi @Swapnil-6161 ! Looks like this issue has already been assigned to another contributor. Please note that in our contributor guidelines we ask that PRs are not made while someone is already working. Thanks for understanding!

@13DATA
Copy link

13DATA commented Mar 29, 2025

I would apologise for this @ksen0 ,im planning to contribute to processing this summer and take part in gsoc . I found this good first issue and since it was a small issue but no ammends were made for about a fortnight I thaught I could handle it.

@ksen0
Copy link
Member

ksen0 commented Mar 30, 2025

Hi @krishna4040 are you working on this? No worries if you need time, just checking in!

(@13DATA was that your PR from a different account? In any case, let's see if this is being worked on and if not then it will be possible to reassign. Thanks for your patience!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Good First Issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants