kevboh / longform

A plugin for Obsidian that helps you write and edit novels, screenplays, and other long projects.
Other
610 stars 30 forks source link

Feature request: scrivenings mode #131

Open pdworkman opened 1 year ago

pdworkman commented 1 year ago

Scrivener has a mode they call "scrivenings" where you can see all of the scenes in a folder as one continuous document, with a horizontal line between each scene, that is in editable format. So I could read through my entire draft 3 of ABC novel without having to click on each individual scene, and could make edits as I went along, without having to link/jump to the scene folder.

Make.md seems to have a function similar to this that they call "Flow view", which says that it is built on code from Hover editor. I couldn't get it to work for me, so I can't say it has exactly the functionality that I am looking for, but it appears to.

radioactive-penguin commented 1 year ago

I would like to see this as well. It is one feature that I find missing from Scrivener that keeps me bouncing back and forth.

kevboh commented 1 year ago

Yes, I have long wanted to do this. There's no obvious way to do it in Obsidian, at least to me: it's possible (even likely) I don't fully understand the editor APIs, but the need to presentationally join the notes but fan edits out to individual files is a weird one. If someone is reading this and has a clear idea of how to go about implementing it, please let me know!

anon3792737 commented 1 year ago

I have no idea how to do this either, but it looks like the MAKE.MD plugin can do something like this with the Flow Editor?

YouTube Video

kevboh commented 1 year ago

I took a peek at make.md. It's impressive work, and quite a lot of code: while I want to implement this feature, I want to do it right, and doing so will require a lot of time that I just don't have right now. I will keep this issue open, however. Thanks.

anon3792737 commented 1 year ago

Awesome; thanks for all your good work!

mattmccray commented 1 year ago

While I know that having the "scrivenings" editable is the goal. I was wondering if, as a stopgap, the Index could be used as a way to read the whole work at once (without requiring a compilation).

Currently, longform manages the YAML frontmatter of the project's Index.md... My suggestion would be to take the same list of scenes and update the content with embed links as well.

Like this:

Index.md

---
longform:
  format: scenes
  title: Zombie Mart
  workflow: Default Workflow
  sceneFolder: /
  scenes:
    - It Rises
    - Flashpoint
    - Dick for Brains
    - Rescuers Not Required
    - Hoe Down
    - Twerk It, Boys
    - Shamble, Shamble, Revolution
    - Foyer Fracas
    - Let There Be Light
    - Battle at Fort Zombie
  ignoredFiles: []
---

![[It Rises]]

![[Flashpoint]]

![[Dick for Brains]]

![[Rescuers Not Required]]

![[Hoe Down]]

![[Twerk It, Boys]]

![[Shamble, Shamble, Revolution]]

![[Foyer Fracas]]

![[Let There Be Light]]

![[Battle at Fort Zombie]]

I haven't dug into the internals of the plugin yet, so sorry if there's an obvious reason not to do this that I'm missing.

pdworkman commented 1 year ago

That might be a good starting point. And people could use it along with Hover Editor to allow editing of the file currently on the screen (though you have to scroll down on Hover Editor, it would not be scroll-synced with the embed.) It's a stop-gap solution, anyway.

wc8 commented 1 year ago

I think this is a related request.

Lulullia commented 1 year ago

Hi! It's quite funny that I just finished writing a Templater script that, in conjunction with Buttons, does exactly this:

Currently, longform manages the YAML frontmatter of the project's Index.md... My suggestion would be to take the same list of scenes and update the content with embed links as well.

Here's the script, it's a little specific to my needs (embed all scenes under a particular chapter instead of the whole project; it also filters out some stuff since I use other kinds of notes in my scene list) but with a bit of tweaking it should do just what you need it to!

With this you can generate embed links from a Longform scene list; you can filter them to only show the scenes you want; and you can run the template anywhere, not just in the Index file, provided the script knows which Index file to reference. It also lists all scenes in a single line, so it's easily replaced by a Button for refreshing. You'll need to have Dataview enabled.

<%* 
const dv = app.plugins.plugins.dataview.api;
const lf = app.plugins.plugins.longform.api;

let current = dv.page(tp.file.path(true));
let fm = null;

try { await app.fileManager.processFrontMatter(
    app.vault.getAbstractFileByPath(dv.page(current.vol).file.path),
    // you'll need to change this to make it link to an Index file, or simply use current.file.path if you're running the script inside an Index file already
    (_fm) => { fm = _fm;});
} catch (error) {
    console.error("[TemplaterScript] error manually loading frontmatter:", error);
};
let scnData = lf.scenesWithNumberings(
    lf.nestedArraysToIndentedScenes(fm.longform.scenes)
);

// remove from here
let beatID = scnData.filter(b => b.title == tp.file.title)[0].numbering;
scnData = scnData.filter(s =>
    s.numbering[0] == beatID && s.indent == 1 && s.title.includes("scn.")
); // to here if you don't need to filter the scenes and just want to link them all; otherwise adjust to your needs

for (let scn of scnData) {
    tR += dv.fileLink(current.file.folder + "/" + scn.title, true);
        // if the folder of the file where you run this script isn't the same as the one with the scenes, be sure to adjust this path
};
%>

You could insert the template manually, or use a Button to do it in one click and also automatically replace the links (adjust line number and template name accordingly):

name Refresh Scene List
type append template
action template-name-here
replace [10, 10]

I'd be happy to help if anyone needs help setting this up :)

GamerGirlandCo commented 1 year ago

Yes, I have long wanted to do this. There's no obvious way to do it in Obsidian, at least to me: it's possible (even likely) I don't fully understand the editor APIs, but the need to presentationally join the notes but fan edits out to individual files is a weird one. If someone is reading this and has a clear idea of how to go about implementing it, please let me know!

i might start working on this, since i know a bit about the codemirror API. no promises, definitely no ETA, but i'll try my best :>

siainbuletin commented 2 months ago

If @kevboh is not already aware of this new plugin, https://github.com/gasparschott/obsidian-continuous-mode allows for editing across notes within a specified folder. This would be the perfect plugin, if only it would take into account the order of scenes specified in the YAML property.

kevboh commented 2 months ago

I don't really use tab groups, but it seems like the integration with this is that Longform should be able to open up all scenes/a set of scenes as an ordered tab group?

It does seem like the plugin allows for reordering manually, too.

siainbuletin commented 2 months ago

The reordering being manual would certainly mean a lot more work the longer the project gets, so it's not quite ideal. Would be great if the integration would Longform would be easy through the tab group, though I have to say it's also quite a bother on the eyes.

kerim commented 1 month ago

Would very much like to have something like this. And would especially like to be able to see within a tree. For instance if I have:

1 Introduction 1.1 Introduction part 1 1.2 Introduction part 2 2 First chapter

It would be great to just zoom in on the introduction sections and see those as a single document.

hamishlow commented 6 days ago

https://github.com/gasparschott/obsidian-continuous-mode basically achieves this, and can be applied within the Longform folder.

mariomui commented 2 days ago

https://github.com/gasparschott/obsidian-continuous-mode basically achieves this, and can be applied within the Longform folder.

It's a good stop gap, but i've found the use of longform and continuous mode to have bugs, both ui wise and functionally. One such ui bug is the line gaps in between. while i'm sure I could code the ui to get rid of it, it's less than optimal. (and i think i've tried)

There's a functional bug where the scrolling down jumps the file to different locations. It also causes some memory issues, and lags it when paired with google drive for backup.

With the number of bugs involved, i think it makes more sense for a scrivenings mode to be built into longform. Or a brand new plugin that's specifically compatible with longform.