-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Highlighting a fragment #705
Comments
Yes, I agree this would be useful. There is already a suggestion for something similar #352. This one proposes to use the html tag |
I was playing around with some new code yesterday on this, and it got me thinking. I don't think I will implement the equivalent of html's In addition, highlighting text isn't really a core formatting feature for writing fiction. That said, highlighting can be a useful tool of the writing process as you say. It is in the spirit of allowing comments in the text as well. In-line AnnotationsThe feature could be added as an in-line syntax. Say, just as a first idea, to allow comments at the end of a paragraph. Since the If I add a context menu entry that allows for selecting text and clicking "Add Comment" or something, I could also capture the location of the highlight and auto-generate a The benefit of this approach is that it makes it extremely easy and light-weight to handle by the syntax highlighter because it doesn't involve heavy regex parsing. I only need to check for the existence of the Annotations as Meta DataThe other alternative is to not have such annotations being part of the novel text at all, but meta data associated with the document. A sort of editor tool for your own review process. I could add it to the context menu, with a keyboard shortcut, and allow the user to annotate any piece of text. The data would be saved in an adjacent file with each document, or in a central annotations file. In either case, the address of the comment, in terms of start and end position in the editor, would be harder to tokenize and export since the tokenizer doesn't preserve character location within a document. It would need some location accounting or mapping feature, which could be prone to mistakes. In general, the in-line approach is more fitting with the rest of the philosophy. But the latter is more sophisticated I guess. What do you think @johnblommers? |
I would definitely favor the inline model %%#[label] This one with a label ? |
For footnotes, I think it would be better to go with the kramdown syntax, which also allows for footnotes in the middle of a paragraph. The limitation of the proposed in-line syntax here is that each paragraph or line would only allow for one comment. |
a single comment per paragraph would be no problem for me as I merely see it as a reviewing tool, but it is important that we can decide to transfer them into the odt output file if the footnotes have a different syntax, it will mainly be a cut and paste operation to eventually transform a comment into a note |
Ah, I see. You wanted to be able to convert a comment to a note. Hence the expanded syntax. The benefit of the kramdown syntax for footnotes is that they can be collected in whatever file you want, if you want them out of the main text docs. They would work pretty much like the current tags do, just that you can insert them into the middle of the text. |
most of the comments I add when reviewing have to do with my writing, and they simply disappear after the text has been amended or clarified, but those that eventually remain most often become notes for the reader. |
While I haven't set these ideas aside, I am starting to think I may want to take the editor in a more rich text direction and away from Markdown. There are numerous limitations to keeping it as it is when people seem to want a different experience. This also includes myself. I have been experimenting with ways to make the editor handle a limited set of rich text formatting while still being able to save the content of the editor to a plain text file. The obvious solution is to use HTML, but HTML gets really verbose so I've actually worked on a simplified format that is more like the one Open Document uses, just with plain text codes instead of XML. The format I'm working on saves a paragraph as a single line with a set of paragraph formatting tags in square brackets ahead of the text, and any bold/italic/etc formatting in span tags around the relevant regions. This makes it possible to extend the format to allow for nearly any feature that the editor itself can handle. I'm working on all of this in a different repository, using C++ and Qt6. I may just make this an entirely different editor, or I may incorporate some of the features in novelWriter. The other project is named Collett. I'm experimenting with it as a way to test out some of the suggestions that have come up during the lifetime of novelWriter, for instance feature suggestion #102 by @johnblommers. |
Markdown-inspired syntax doesn't need to be abandoned for this, see these syntax possibilities, for example. Thus, wrapping a passage of text in square brackets Update: Upon yet further research, some claim that two equal signs from each side, like |
I'm making this a part of the Editor Shortcodes feature in #1541. |
With the shortcodes feature in place, I think it's time to propose a syntax for using them. Here's my current thinking, but feel free to add ideas. For default highlighting, I was thinking something like.
For alternative colours, I propose the option to define a standard set of named highlight colours in the different syntax themes. I definitely don't want to pull all the 140 named colours in browser, but perhaps the base colours at least. Then we could use the following syntax:
I can also allow a HTML/CSS colour code in there. I don't want to go completely overboard with options, so I propose to pick a set of sensible named colours. As mentioned, in the editor the syntax theme decides what they look like, and in the outputs, like HTML and ODT, I will define a standard set that works on white backgrounds based on the official CSS colours mentioned above. |
While I was re-reading something I wrote yesterday, I spotted some parts of the text that didn't please me while I couldn't yet find a better formulation.
In paper form I would have used my yellow highlighter to mark these parts for later correction. So I used the emphasis/italics, but I bet you'll guess my enhancement proposal : highlighting the text background to spot a given fragment.
Of course that brings other questions : one color or choice of several ? what to do at export time ?
It certainly isn't an urgent thing, more a wish than a request.
The text was updated successfully, but these errors were encountered: