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

Support custom amounts of quoting levels #1770

Closed
Tracked by #1773
tmarplatt opened this issue Mar 22, 2024 · 5 comments · Fixed by #1864
Closed
Tracked by #1773

Support custom amounts of quoting levels #1770

tmarplatt opened this issue Mar 22, 2024 · 5 comments · Fixed by #1864
Labels
discussion Meta: Feature discussions editor Component: Editor enhancement Request: New feature or improvement next release Note: Features planned for next release

Comments

@tmarplatt
Copy link
Contributor

tmarplatt commented Mar 22, 2024

The problem

Several written languages use multiple symbol pairs to enclose nested quotes. For example, in Spanish we anticipate three nested levels using these quote pairs: « “ ‘ ’ ” ». Additionally, the em dash is used as a single symbol to open dialogue paragraphs. Similarly we use the right-hand guillemet » to open a dialogue paragraph where the speaker is the same as in the previous paragraph (this is called a continuation quote); which is closed with another » at the final continuation paragraph. In total, that's a set of five symbols/symbol pairs in use.

novelWriter already supports open-ended quote sections, so it's already possible to type dialogue paragraphs with the em dash as an opening symbol. But that just leaves one more configuration. Three of five will be left unsupported in your entire quote configuration.

To illustrate, using Spanish punctuation:

—Harry, yer a wizard.
—I'm a what?
«Oh, a wizard», Harry thought to himself, «yeah, I knew that already...
»But this fellow, “Hagrid the ‘Keeper of Keys’” or what ever? I do not know him at all.

novelWriter should recognise every dialogue section in this example, but to do so it would need more than two quoting levels. Since it doesn't, it currently results in inconsistent and incomplete quoting behaviour for languages other than English.

The solution

  • Allow users to configure multiple quoting levels.
  • Allow users to add and remove levels as they see fit.
  • Possibly rearrange option groups in the Preferences window so that “Text Highlighting” is next to “Quotation Style”, as the latter influences colour coding as allowed by the former.
  • Possibly rename the quoting options to avoid mentioning “single quote” and “double quote”; change the wording to “quoting levels” or something of similar effect. The current wording doesn't necessarily map to quotation styles in other languages. This will prevent and avoid any confusion for users (and translators 😀).
@vkbo
Copy link
Owner

vkbo commented Mar 22, 2024

The reason why they are called "single" and "double" is because they correspond to single and double quote keys on the keyboard, not that they assume the single and double style of the target symbols. Some languages flip these. The current option lets you map them the opposite way if you wish. Like ' to » and " to .

In any case. Using en or em dash to open dialogue is common enough in Norwegian too as an alternative style, although not the official style which is «». I've considered supporting it. Since the dash is always the first character of a line, I could add a rule to highlight any line starting with a given symbol as a dialogue line.

Would that also work for your » use case?

@vkbo
Copy link
Owner

vkbo commented Mar 22, 2024

Possibly rearrange option groups in the Preferences window so that “Text Highlighting” is next to “Quotation Style”, as the latter influences colour coding as allowed by the former.

Quotation style isn't a highlight feature, but an auto-replace feature. Hence they're located with that section. The primary purpose of these settings is to define what to insert into the text in place of ' and " key presses.

The highlighting is a secondary feature, and is optional. The intention is to make it easier to see dialogue. That means it doesn't have to support multiple levels. I added two because that's the minimum in most (if not all) languages.

The assumption is also that you have a single way of expressing dialogue. That isn't always true. Even aside from language standards, some authors invent their own syntax for specific purposes. For instance, John Scalzi uses :: to wrap dialogue when it is non-audible dialogue passed between character's brain implants in his Old Man's War series.

I've considered making it possible to customise dialogue highlighting in Project Settings instead (or perhaps in addition to default app rules). It could be a set of options that would allow for various dialogue styles, which may vary between the user's projects. For instance, YA novels in Norwegian when I grew up often used the symbol for dialog, while «» is the standard in other texts.

@vkbo
Copy link
Owner

vkbo commented Mar 22, 2024

After having given this some more thought, I may look into separating the auto-replacement feature for the ' and " keys and the dialogue highlighting feature.

Currently, the highlighting just matches the quote styles in different colours. However, it may be better to reduce dialog highlighting to a single colour and extend it to a set of rules that can accommodate the various language rules, and make it possible to optionally override these on individual projects. The latter is especially useful in cases where different projects may need different rules either because they are in different languages, or because they apply different styles within a language.

@vkbo vkbo added editor Component: Editor discussion Meta: Feature discussions labels Mar 22, 2024
@tmarplatt
Copy link
Contributor Author

Since the dash is always the first character of a line, I could add a rule to highlight any line starting with a given symbol as a dialogue line.

Would that also work for your » use case?

As long as it's possible to configure multiple possible first-character dialogue symbols, then yes.

However, it may be better to reduce dialog highlighting to a single colour

Simplification is fine.

and extend it to a set of rules that can accommodate the various language rules

Extend what exactly? Highlighting? There is another way to do this for “nested” levels: colour coding as a colour gradient between two colours, those of top and bottom levels. It's a little convoluted, and perhaps not worth the trouble. Though it may look swell and stylish when quotes are actually nested in the editor. Also I like the visual cues, it makes mistakes hard to happen.

@vkbo
Copy link
Owner

vkbo commented Mar 22, 2024

Extend what exactly? Highlighting?

We need multiple rules for what is and isn't a dialogue. There are multiple options described here that require different implementations. The things we need to be able to set are:

  • As currently exists: A set of open and close quote symbols.
  • As currently exists: Allow the close quote to be missing at the end of the paragraph.
  • New: Allow certain special characters to designate the whole paragraph as dialogue if it is the very first character ("—" and "»" in your example).
  • New: Allow certain symbols to indicate a narrator break.

These all need to be set as separate options.

@vkbo vkbo added the next release Note: Features planned for next release label Apr 29, 2024
@vkbo vkbo added this to the Release 2.5 Beta 1 milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Meta: Feature discussions editor Component: Editor enhancement Request: New feature or improvement next release Note: Features planned for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants