ScratchAddons / website-v2

The website for Scratch Addons. (version 2)
https://scratchaddons.com
GNU General Public License v3.0
51 stars 39 forks source link

Expand userscripts docs #292

Closed WorldLanguages closed 1 year ago

WorldLanguages commented 1 year ago

The goal is to write down usual best practices that most contributors know, but aren't explicitly written down anywhere.

In the future, we should also do this with userstyles, and get rid of the "addon types" group. Both the "userscripts" and "userstyles" sections will be directly below the "developing" section.

Would appreciate if other contributors help by commenting what best practices should be added. You don't have to write the section yourself, just remind me of something I could have forgotten.

WorldLanguages commented 1 year ago

cc @mxmou have a quick look and possibly write a list of userscripts best practices I didn't add yet

We may also start thinking about userstyle best practices, such as:

WorldLanguages commented 1 year ago

@mxmou I rephrased the paragraph to clarify that ALL scratch-www pages allow the user to login without a reload.

I've also added additional best practices, and resolved all TODOs.

WorldLanguages commented 1 year ago

@DNin01 Could you take a look? You can just read the md files if you don't want to download Hugo.

DNin01 commented 1 year ago

@DNin01 Could you take a look? You can just read the md files if you don't want to download Hugo.

What should I be doing? Is there anything in particular you want me to check?

DNin01 commented 1 year ago

Anyway, I’m not very familiar with JavaScript, but I don’t have anything to point out right now.

WorldLanguages commented 1 year ago

There might be some spelling mistakes, I haven't checked for those

WorldLanguages commented 1 year ago

Thanks, I forgot to do that

Hans5958 commented 1 year ago

By the way, it is fine if you have something to write on the _index.md file, instead of separating it to the about-userscript.md file, or do you have any reasons other than technicality?

WorldLanguages commented 1 year ago

@Hans5958 Hmm, most _index.md pages on the docs don't have really have content. I wouldn't find it intuitive to need to click on a collapsible category name to read an important article.

WorldLanguages commented 1 year ago

Could we mention we prefer camelCase

Sure

using two spaces for tabs

Doesn't Prettier take care of that?

Samq64 commented 1 year ago

Doesn't Prettier take care of that?

Yeah, it's probably not necessary, I just thought it would be nice if prettier didn't have to run on every PR since new contributors have to approve the workflow.

WorldLanguages commented 1 year ago

This looks ready to merge. After this is merged, we should open a similar PR for userstyles.

Hans5958 commented 1 year ago

Hmm, most _index.md pages on the docs don't have really have content. I wouldn't find it intuitive to need to click on a collapsible category name to read an important article.

It is a misconception. Any page is a page that ideally should be filled with something. I also prefer to keep the contents to be consistent with the neighbour page Userstyles, which lies in the same level, even if it is moved one level above.

See also:

  1. https://scratchaddons.com/docs/reference/addon-api/addon.tab/ has three subpages.
  2. https://scratchaddons.com/docs/localization/ has also two subpages, though there should me more pages later.
WorldLanguages commented 1 year ago

@Hans5958 Any pending concerns here?

Hans5958 commented 1 year ago

Well, I took the matters into my own hands, so that's it for me.

PS. Probably I will take a second look on the heading levels, but it is fine for now.

WorldLanguages commented 1 year ago

Merging.