vkbo / novelWriter

novelWriter is an open source plain text editor designed for writing novels. It supports a minimal markdown-like syntax for formatting text. It is written with Python 3 (3.9+) and Qt 5 (5.15) for cross-platform support.
https://novelwriter.io
GNU General Public License v3.0
2.05k stars 106 forks source link

Tags and references auto-completion #823

Closed vkbo closed 11 months ago

vkbo commented 3 years ago

There are probably several improvements that can be made to the system of tags and references, but I have a few in mind from using them myself on my own projects.

Feature

The remaining feature for the original ticket:

It should also be possible to either have an auto-complete menu appear when setting tags after a keyword, or have a way to open a simple dialog box where the user can select between defined tags. The former is probably more in line with the way tags work.

jyhelle commented 3 years ago

These are all useful adds (and I especially agree with the second and third).

vkbo commented 3 years ago

Yes, I agree those are the main two improvements. I'm going to play around with an auto-complete menu feature to see if it is a viable option.

Ellipsine commented 3 years ago

I would appreciate any of this, especialy the auto-complet and the "expand" tool. I would suggest the possility of typing a ref directly on the global view screen if it is possible ?

Capture d’écran 2021-09-12 204238

vkbo commented 3 years ago

That would involve editing the user's document without it being open in the editor, and I am reluctant to do that. I prefer to leave that entirely under the user's control. As it is now, the only time novelWriter is allowed to change the content of a document is when it is open in the editor.

My proposal is to instead make it easier to set tags and reference when the document is open. Either by the aid of auto-completion, or a pop-up box with options.

Ellipsine commented 3 years ago

That would involve editing the user's document without it being open in the editor, and I am reluctant to do that. I prefer to leave that entirely under the user's control. As it is now, the only time novelWriter is allowed to change the content of a document is when it is open in the editor.

My proposal is to instead make it easier to set tags and reference when the document is open. Either by the aid of auto-completion, or a pop-up box with options.

Understood ! As i wrote earlier : your proposals suit me as well :)

vkbo commented 2 years ago

Since the release 1.6 is rather full, and needs to be finished, I'm moving this to a future release.

anantone commented 1 year ago

Hi, I'm discovering novelWriter and currently figuring out the tags system (not completely intuitive, even reading the manual).

I'm wondering if a useful feature could be that when you create a Character note (for example), the title of that note is automatically defined as also being the tag? Typically, that would be the character's name.

Just thought I would drop that here if you are still thinking about this. Will continue my learning process ;) Thanks!

vkbo commented 1 year ago

Hi, and thanks for the feedback.

Yes, I am aware that it is a bit difficult to figure out that you must specify the tags. I mostly recommend that new users generate a sample project from the new project wizard to have a look. It shows how to do it.

I am planning to update the tags and reference system for the 2.2 release. Which is a bit away still. I'm almost done with 2.0. I am thinking about adding an optional mini-wizard (basically just a fill-out form) for adding new notes. It will do things correctly for you. Then you can choose to do it manually when you want to customise further.

anantone commented 1 year ago

Thanks, that's a great idea (mini-wizard).

I did generate a sample project and that helped with the main tags. It still took me a while to figure out how to reference project notes, and that these are different from novel documents. So if I'm not mistaken, it's not currently possible to reference a novel document (say, to reference a related scene directly in another scene)?

I'm also quite interested in the discussions about the timeline feature, as this is an important aspect to keep track of and visualize well globally. Ideally, I would like to be able to mark inline all the time references (dates, "last week", etc.) and link them to a timeline note with details and the possibility to check for coherence. I realize that this involves a lot of moving parts on the back end, though.

So that you know where I'm coming from, I have been using Trilium Notes for a while, which is great for organizing notes hierarchically and cross-referencing between them, but I was needing some novel specific features (to manage timeline and characters, for instance), which can be achieved in Trilium with some customization, but I was glad to find a project that is directly concerned with this particular practice of writing fiction (and not too prescriptive as to how this is done, which I have found problematic in other available tools). So keep up the good work! I'll see if I can come up with more suggestions after learning more fully the existing features. :)

vkbo commented 1 year ago

Feel free to participate in the treads related to the timeline feature. A primary reason why these are so old and not been implemented is that it is difficult to figure out what would be a good implementation. The whole development stalled after the Outline was added.

Keep in mind that novelWriter is written in Python, which limits the ability to generate complicated graphical displays. It's simply too slow to update. Various table views have been considered, but honestly I find them too clunky. My thinking has been to either generate web-like content that is either launched in your browser or an internal browser embedded in a separate view. With web content it is easier (and pretty fast) to generate visualisations. The implementation would then be more like generating a report of the project structure. That could be a quite powerful tool as people could contribute code to generate such reports. It is the one area where I would consider implementing a plugin-like framework.

I plan to revisit this soon. I too would like some of these features for my own projects.

As for referencing scenes from other scenes, it's also something I've considered. Feel free to make a feature request on it. I don't think there is one at the moment. You can now reference notes from notes. I do that quite frequently myself, especially in plot notes. Being able to cross-reference scenes makes sense, but the original intention was to define plot and subplot tags which were referenced in the connected scenes.

anantone commented 1 year ago

Thank you for your reply. If I'm understanding correctly, your workflow is referencing plot notes across one another, then each plot note to the corresponding scene? That would make sense, in terms of having two parallel sets of documents, one for the novel itself, one for the notes (text/metatext). I like visualizing some of the "meta" information in the novel text itself, so for me it would make sense to be able to link directly to a scene also. I guess this is the difficulty with a novel writing software, that there are so many ways to organize one's work, and no perfect format to match them all.

I'm not a developer, rather a writer who likes learning how his tools work, so you may have to bear with basic questions... Such as: is it difficult to have inline tags with Python? I wouldn't be looking for a complex graphical display at all, rather a way to mark time references in the text (but inline, not just section level), and link them to a list. That's already useful to check that you're not forgetting any of them. Then let's say that this list is in the order that terms appear in the text, and there could be another column next to it, it would be pretty easy to add in that column (manually) what the terms refer to on a timeline (presumably, corresponding to a calendar; multiple timelines in quantic universes would need their own format...) I guess, reading this paragraph, I'm pretty much asking for the existing timeline feature, just with inline tags to have more granularity.

vkbo commented 1 year ago

Thank you for your reply. If I'm understanding correctly, your workflow is referencing plot notes across one another, then each plot note to the corresponding scene? That would make sense, in terms of having two parallel sets of documents, one for the novel itself, one for the notes (text/metatext).

Not quite what I meant, if I understood correctly. You can set a tag under each section also within a note (not just a tag per note) so I have separate tags for the plot breakdown. For my main plot outline, which is one big note file, I have a tag called @tag: Main at the top, and then within it a tag for each plot component, like @tag: MainHook and @tag: MainTurningPoint. In the key scene files, I may reference @plot: Main, MainHook for instance. This makes it visually easy to see where the key points in my story are in the Outline.

I do something less elaborate for subplots, but scenes that advance a subplot will have a reference to that plot.

I like visualizing some of the "meta" information in the novel text itself, so for me it would make sense to be able to link directly to a scene also. I guess this is the difficulty with a novel writing software, that there are so many ways to organize one's work, and no perfect format to match them all.

The idea is to allow setting @tag: SceneOne for scenes, and then be able to cross-reference with @story: SceneOne. This would mainly just be useful within the text, but there's nothing hindering the Outline view to also show these cross references.

I'm not a developer, rather a writer who likes learning how his tools work, so you may have to bear with basic questions... Such as: is it difficult to have inline tags with Python? I wouldn't be looking for a complex graphical display at all, rather a way to mark time references in the text (but inline, not just section level), and link them to a list. That's already useful to check that you're not forgetting any of them. Then let's say that this list is in the order that terms appear in the text, and there could be another column next to it, it would be pretty easy to add in that column (manually) what the terms refer to on a timeline (presumably, corresponding to a calendar; multiple timelines in quantic universes would need their own format...) I guess, reading this paragraph, I'm pretty much asking for the existing timeline feature, just with inline tags to have more granularity.

By inline tags, you want to basically make references within the text paragraphs I assume?

There's nothing technically problematic with this, except that it somewhat crashes with the current syntax. I made an early choice to make meta data a per-section feature. That's why I added the additional level below a scene so it was possible to make such breaks without splitting the scene itself, if you really need to divide up parts of a scene in the Outline.

As an alternative, it is quite possible to add references above the paragraph where you want them. The indexer will just aggregate all references within a section, but visually you'd be able to see them in your text in the correct place. I've seen other people do this for exactly this reason. They still need to be on a separate line than the text, but that's the only limitation.

The discussion about adding a calendar like feature where you can plug in some sort of time unit is useful, and it would probably make sense to implement it as a different feature than the current tag and reference system. This is particularly useful for a story that jumps in time both backward and forward. But it would be best to continue that part of the discussion in the actual timeline issue as it would otherwise be lost here.

anantone commented 1 year ago

Thank you for clarifying your method with plot components. I'm not sure I get the point of the @main tag, if, as in your example, you include the word "main" in each component tag (@mainhook)?

Hm, if that was a structuring choice initially to have meta data per section only, then yes, what I'm looking for doesn't quite fit that. I'm not sure I can explain why exactly, I feel the need to tag or highlight directly the words in the paragraph that fulfill a specific function, and have that link to the meta note. Maybe because I don't think of a section as fulfilling a function, and then you can "fill it up" with anything; if everything has to be meaningful, then you need the granularity in structuring.

To reformulate my earlier comment, I guess the problem with writing software is that each writer would need to make their own, to fit exactly how they think and write...

vkbo commented 1 year ago

First, please keep in mind that when you use @ in the comments here on GitHub you often end up actually tagging users on GitHub.

Anyway, i usually tag the main plot as @tag: Main and reference it as @plot: Main, yes. The hook of the main plot has tag MainHook. I'm just used to namespacing things so you don't get crashes as each tag can only be used once.

The problem with allowing @ references within the text is that then the @ character suddenly has two meanings. It can also no loner be used in text as a character without triggering some additional functionality. That is the primary reason why I haven't embedded any syntax within the text other than the bold/italic/strikethrough ones.

tmarplatt commented 1 year ago

Sometimes I find the need to update a tag/reference name. Not just the reference itself, but its uses all over the project. There is no current way to do that other than via Search and Replace, correct?

Not sure if such a thing warrants a feature though. Perhaps a user that doesn't do much replacing (or thinks in terms of automation) does not make the connection. It would be useful, even if it's nothing more than a dialog proxy for full project search and replace.

vkbo commented 1 year ago

Yeah, I use the search and replace feature for this when I have to do it. Alternatively, you can use the back reference panel under the viewer.

I won't make any features that edit content in files, so an edit that propagates to the documents will not be added. But I am planning to make a global search feature that will help with this. I can keep this particular use case in mind when making that.

It should be possible to make the search tool only look in lines starting with @ for instance.

attilaoroszdev commented 1 year ago

Hey,

I recently rediscovered this project (been a while since I needed to write anything), found my way here while searching for tag autocomplete feature or feature request. Glad to know it's coming.

One thing I was also looking for, is to be able to filter for certain tags/references, maybe in the outline view. E.g., if I only want to see the scenes that are tagged with a certain character/timeline/location. Not sure if it makes much sense for anyone else, but I used to do this a lot with Scrivener to check for consistency, or just to quickly look up what each character was up to at a certain point.

Great work, BTW, looking forward to 2.2 (with autocomplete for refs, of course). :)

vkbo commented 1 year ago

It may not be 2.2 as I've decided to not do two large minor releases after all. Mostly because it will take too long in between with the amount of time I have available to work on novelWriter. I will roll out smaller feature releases instead. But the position in the queue of features will be roughly the same, so it won't really matter.

vkbo commented 11 months ago

The auto-complete feature for tags and references has been added. The other two main original features have been moved to #1580.