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

chore: update colour readme to include more information about field customization #2319

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

rachel-fenichel
Copy link
Collaborator

The basics

The details

Resolves

Fixes #2216
Fixes google/blockly#7878

Proposed Changes

Combines documentation from deviste and existing README.

Reason for Changes

This field will no longer be documented on devsite.

Test Coverage

Documentation

This is documentation! But also, devsite should probably have a pointer to the fields on gh-pages in addition to the individual pages for built-in fields.

Additional Information

I can't tell if the section links with #section_name will work in GitHub markdown.

@rachel-fenichel rachel-fenichel requested a review from a team as a code owner April 8, 2024 22:23
@rachel-fenichel rachel-fenichel requested review from maribethb and removed request for a team April 8, 2024 22:23
@rachel-fenichel rachel-fenichel changed the title Colour readme chore: update colour readme to include more information about field customization Apr 8, 2024

#### Colour field on collapsed block

![](https://github.com/google/blockly-samples/raw/master/plugins/field-colour/readme-media/collapsed.png)

If you want to use only the field, you must register it with Blockly. You can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph is now under the "Colour field on collapsed block" heading, which is awkward. I would move it directly under the ## Usage headline.

Also, I have suggestions for the paragraph itself:

  • the word "only" is confusing here because we haven't introduced any context that would explain what the alternative is (i.e. if not "only" then what else?).
  • say the name of the field in that part of the explanation.
  • add a link to the install blocks section

So I would change this paragraph to say:

If you want to use this field in a block definition, you must install it by calling `registerFieldColour` before instantiating your blocks. If another field is registered under the same name (`field_colour`), this field will overwrite it.

If you [install the blocks](#blocks) in this package, the field will automatically be installed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

The colour constructor takes in the following:

- an optional `value`
- an optional [validator](#creating_a_colour_validator)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this (and other links) should use - instead of _

if you click "view file" in the ... menu in this PR you can preview the rendered file and see thin links

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.


### Editor options

The setColours
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add backticks around setColours

plugins/field-colour/README.md Show resolved Hide resolved
@rachel-fenichel rachel-fenichel merged commit 39e87e9 into google:master Apr 10, 2024
7 checks passed
@rachel-fenichel rachel-fenichel deleted the colour_readme branch April 10, 2024 17:52
gonfunko pushed a commit to gonfunko/blockly-samples that referenced this pull request Apr 15, 2024
…ustomization (google#2319)

* chore: update field-colour readme to include information from devsite

* chore: line length

* chore: show colourOptions in colour field sample code

* chore: format

* chore: respond to review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants