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

Provide better documentation for suggested-blocks #1625

Closed
maribethb opened this issue Mar 15, 2023 · 8 comments · Fixed by #1958
Closed

Provide better documentation for suggested-blocks #1625

maribethb opened this issue Mar 15, 2023 · 8 comments · Fixed by #1958
Assignees
Labels
documentation Improvements or additions to documentation ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ good first issue Good for newcomers size: small type: feature request New feature or request

Comments

@maribethb
Copy link
Contributor

maribethb commented Mar 15, 2023

🚧⚠️🚧 This issue is being saved for Grace Hopper Open Source Day. 🚧⚠️🚧 An event we're running to help girls and non-binary technologists make their first contributions to open source! Please see our list of help wanted issues if you'd like to contribute!


Category

  • Plugins

Component

suggested-blocks

Is your feature request related to a problem? Please describe.

The README example is slicing into a toolbox XML string. That is not a good idea. There's a comment saying it's not a good idea, but still, we shouldn't model this for people. Also, we should use JSON.

Describe the solution you'd like

Replace the existing usage documentation with the following:

import * as Blockly from 'blockly';
import * as SuggestedBlocks from '@blockly/suggested-blocks';

const toolbox = {
  "kind": "categoryToolbox",
  "contents": [
    {
      "kind": "category",
      "name": "My Category",
      "contents": [ /* your category contents */ ]
    },
    {
      'kind': 'category',
      'name': 'Frequently Used',
      'custom': 'MOST_USED',
      'categorystyle': 'frequently_used_category',
    },
    {
      'kind': 'category',
      'name': 'Recently Used',
      'custom': 'RECENTLY_USED',
      'categorystyle': 'recently_used_category',
    },
  ]
};

// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
  toolbox: toolbox,
});

// Initialize the plugin
SuggestedBlocks.init(workspace);

Describe alternatives you've considered

N/A

Additional context

https://google.github.io/blockly-samples/plugins/suggested-blocks/README

@maribethb maribethb added type: feature request New feature or request triage good first issue Good for newcomers labels Mar 15, 2023
@martinyis
Copy link

Hey, I have a solution that might be helpful. Could you assign it to me?

@maribethb
Copy link
Contributor Author

Thanks, @martinyis, all yours!

@maribethb maribethb added the documentation Improvements or additions to documentation label Mar 15, 2023
@saymedgm
Copy link

saymedgm commented Sep 2, 2023

@maribethb can you explain me this issue little bit would love to contribute in this

@BeksOmega BeksOmega added ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ size: small labels Sep 5, 2023
@BeksOmega
Copy link
Contributor

@maribethb can you explain me this issue little bit would love to contribute in this

Same reply as here!

@divziv
Copy link
Contributor

divziv commented Sep 22, 2023

Would love to know more and contribute!

@BeksOmega
Copy link
Contributor

Sweet @divziv ! Do you have any specific questions?

@divziv
Copy link
Contributor

divziv commented Sep 22, 2023

I am a beginner, 0 experience in TypeScript- what is it that I could do in order to begin?

@SYJONES16
Copy link

I am a beginner, but would love to watch what you are doing? is that okay for me to join?

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 ghc-osd Reserved for open source day: https://anitab-org.github.io/open-source-day/ good first issue Good for newcomers size: small type: feature request New feature or request
Projects
No open projects
Status: Done Testing
7 participants