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.03k stars 102 forks source link

Add facilities to support story structure analysis and developmental edits #1784

Open instancezero opened 6 months ago

instancezero commented 6 months ago

This idea comes as a result of the discussion at https://github.com/vkbo/novelWriter/discussions/1769

Add a new "Story" construct of the form %Story[.<term>: <text> to NovelWriter, where auto-complete can suggest any of a set of predefined or user-defined values for <term>, and where <text> is nominally free-form but MAY provide some validation rules.

Collate the story structure metadata in the preview view, giving users the ability to show/hide the data.

Integrate this with existing NovelWriter metadata commands to provide a facility for exporting scene-level summaries of the story structure in formats that are accessible to a wide range of users and applications (CSV for spreadsheets and databases, JSON for general use, and possibly ODS).

vkbo commented 6 months ago

Thanks for writing this up and for the discussion. A few implementation notes for future reference:

Also:

Index example:

The "headings" and "references" sections already exist, and currently "synopsis" is a key under each TXXXX section under "headings". T0001 corresponds to the document's first heading, T0002 the second, etc.

"88706ddc78b1b": {
  "headings": {
    "T0001": {"level": "H2", "title": "Where has John Gone?", "line": 1, "tag": "", "cCount": 20, "wCount": 4, "pCount": 0},
    "T0002": {"level": "H3", "title": "Jane Cannot Find John", "line": 8, "tag": "", "cCount": 119, "wCount": 24, "pCount": 1}
  },
  "references": {
    "T0001": {"jane": "@pov", "space": "@location"},
    "T0002": {"jane": "@pov", "john": "@focus", "space": "@location"}
  },
  "comments": {
    "T0001": {
      "synopsis": "text",
      "story.term": "text",
    }
  }
}
xahodo commented 4 months ago

This would be really helpful to me. I'm currently in the process of abusing %Synopsis: for this.

For me it would be helpful to put some data points right in the chapter/scene, which I could later reference in an external program.

Some things I could use this for:

Yes, these might be satisfied by the @plot tag reference, but I like to have them right in the scene (for when I'm actually writing).

Writing this down in a format like %Story: <Conflict>John has to choose between his fiancé and his mistress. Why the angled brackets? They are more discernible.

If NW would have an interface to view these nicely organized in one screen it would make this feature even more fantastic. Things would become awesome if you could filter based on which terms to display (in case of there being several).

vkbo commented 4 months ago

The syntax is already locked down and implemented in the code as it is used for footnotes for the 2.5 release. So it will be:

### Scene

%Story.Conflict: John has to choose between his fiancé and his mistress.

Bla bla bla.

Anyway, I've scheduled this for inclusion in 2.6 as the 2.5 release is already very full and I don't want to add too much new notation in one release. The footnotes were just higher on the list.

Adding this feature will include an update to the Outline View in some form yet to be decided. I think it needs a little trial and error, so I would be happy to have some back and forth with some of the people interested in this feature to sort out the details. @instancezero has made a POC implementation in a branch.