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

Explain one-sentence-per-line to user #315

Open
ahus1 opened this issue Aug 8, 2019 · 1 comment
Open

Explain one-sentence-per-line to user #315

ahus1 opened this issue Aug 8, 2019 · 1 comment

Comments

@ahus1
Copy link
Contributor

ahus1 commented Aug 8, 2019

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

  1. The method AsciiDocFormattingBlock.getSpacing() is the one responsible for one-sentence-per-line. When calling Spacing.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().

  2. 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.

@mojavelinux
Copy link
Member

I'd rather centralize this information for all of Asciidoctor. The more places we try to explain it, the more fuzzy the message will be. The current location is here: https://asciidoctor.org/docs/asciidoc-recommended-practices/#one-sentence-per-line. However, in the new docs site (which will be at docs.asciidoctor.org), it should get a dedicated page.

Of course, you can still summarize the high-level points on the wiki page. But it should then link to the main page to provide the official explanation.

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

No branches or pull requests

2 participants