Allow system plugins to customize stroke display #1658
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.
Summary of changes
System definitions/plugins can now define a function
display
, which is used to render outlines in the UI (suggestions, lookup, dictionary view, etc).For example, if I look up
Lynn
instead of seeing the suggestion4R*EU7B
I might want to see#HR*EUPB
or even#L*IN
. When adding or editing outlines, the underlying syntax is still used, so that this is a purely cosmetic change.Here is an example of a system plugin that defines
display
to restore letters from digits, as may please users of Lapwing theory, which uses#
for proper nouns.Note
This example shows that this isn't quite the right abstraction:
English Stenotype
andEnglish Stenotype (display lowercase)
are not really two different steno systems. But tying the display function to the system keeps things architecturally simple. This way, display functions can be distributed as system plugins (instead of having to invent some new plugin type just for this niche feature), and power users can just edit thedisplay
definition in theirenglish_stenotype.py
if they so desire.Pull Request Checklist