Explain one-sentence-per-line to user
#315 opened on Aug 8, 2019
Repository metrics
- Stars
- (392 stars)
- PR merge metrics
- (PR metrics pending)
Description
Situation
When a user re-formats the AsciiDoc source for the first time, she/he might be surprised by the on-sentence-per-line wrapping.
Suggestion
An editor notification like EditorNotificationPanel for "JCEF could be enabled" (JCEFCouldBeEnabledNotificationProvider) or could show the moment a user first triggers a re-format that performs a reformat of one-sentence-per-line.
It could link to the plugin's documentation site explaining why this might be a good thing and where to disable it.
(this issue was created after a user's feedback in #314)
Good First Issue
This issue is labeled "good first issue", and maintainers are willing to help. Please comment in this ticket to exchange ideas how this could be implemented. Feel free to pair up with a maintainer to help when you don't know where to start if when you're stuck.
Find out more about how to contribute at "Contribute as a coder" in the Contributor's guide.
Implementation Idea
-
The method
AsciiDocFormattingBlock.getSpacing()is the one responsible for one-sentence-per-line. When callingSpacing.createSpacing()to define the spaces that should be used, it can check at the same time the current spaces being present via((AsciiDocFormattingBlock) child1).getNode().getTreeNext(). -
To communicate this to the NotificationProvider, the simplest way would be to call a (static) method on the notification provider. See
AsciiDocDownloadNotificationProvider.showNotification()for an example.