Add Checkbox and Radio Group fields to Micron #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
: The name of the field. Multiple checkboxes can share the samefield_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:
In this example, when the data is submitted field_color will be set to whichever value from the list was selected.
Both checkboxes and radio groups can be pre-checked by appending a
|*
after the field valueAdditionally, for LXMF clients like Liam Cottle's MeshChat that are browser-based, these can be mirrored using the native HTML radio select and checkboxes.