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

Add Checkbox and Radio Group fields to Micron #62

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

RFnexus
Copy link
Contributor

@RFnexus RFnexus commented Nov 25, 2024

This PR adds two new input field types to the Micron markdown format. The two fields use either a ^ (radio) or ? (checkbox) after the < in the field markup.

Checkboxes

Checkboxes allow users to make a single selection or multiple selections. They are rendered using the Urwid CheckBox widget.

Example:

`<?|field_name|value`>`b Label Text`
  • field_name: The name of the field. Multiple checkboxes can share the same field_name
  • value: The value submitted when the checkbox is checked. If their are multiple checkboxes with the same field name, but different values it will concatenate all checked values with a comma.

Radio select

Radio selects allow users to choose one option from a list. They are rendered using the Urwid RadioButton widget.

Unlike checkboxes radio buttons with the same field name are mutually exclusive.

Example:

`B900`<^|color|Red`>`b  Red

`B090`<^|color|Green`>`b Green

`B009`<^|color|Blue`>`b Blue

In this example, when the data is submitted field_color will be set to whichever value from the list was selected.

Screenshot from 2024-11-25 18-40-18

Both checkboxes and radio groups can be pre-checked by appending a |* after the field value

Additionally, for LXMF clients like Liam Cottle's MeshChat that are browser-based, these can be mirrored using the native HTML radio select and checkboxes.

@RFnexus RFnexus changed the title Add Checkbox and Radio Group fields to Micron format Add Checkbox and Radio Group fields to Micron Nov 25, 2024
@markqvist
Copy link
Owner

Great work! Thanks so much for this PR! If you feel it's ready for it, I'll merge it now for upcoming releae.

@RFnexus
Copy link
Contributor Author

RFnexus commented Nov 27, 2024

Great work! Thanks so much for this PR! If you feel it's ready for it, I'll merge it now for upcoming releae.

Should be good to go

@markqvist markqvist merged commit c2fc703 into markqvist:master Nov 27, 2024
@markqvist
Copy link
Owner

Very nice! Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants