Extract Note / Refactor

Oh, no worries, I hope I didn’t come off as accusatory. I don’t care who gets credit for the idea, I’d just love to see it implemented!

Merged, hope you guys don’t mind @BlueSun @GBC.

2 Likes

Would also love to see this. My imported notes are a vast mess and I’d like to make them more manageable/navigable

This would be a really cool feature that I would love.

For my most common use case, it would be handy to have the option to be able to replace the extracted text with a transclusion/embed ![[ ]] instead of a link [[ ]]… this could either be with two separate hotkeys/right-click options, or just a single ‘extract into new note’ option whose function can be modified in settings.

1 Like

This is such a crucial feature for me that I switched to using the VS Code extensions Foam and Markdown Memo for refactoring my notes. I made a somewhat clunky macro to Extract Note, but it works well enough. You can work off of the same Obsidian vault folder (generally) without any issues.

You can see the details here: https://github.com/nixsee/NewNoteFromSelection-VSCode

Given the local graph feature that was just implemented in Obsidian, once I get my notes refactored, I’ll be moving my workflow back to Obsidian until Foam is able to make progress (it’s still in very alpha stages) and I’ll reassess then. Clearly this shows how important plain Markdown notes are!

2 Likes

I agree this would be useful, right now I just do it manually albeit with some string replacement for quickly formatting the new page. It would be nice to just be able to select text and press a hotkey that creates a new page with the selected text and embeds/links it in the original page. The good thing is that even if it doesn’t get implemented, it won’t be difficult to do with the api.

1 Like

Adding my +1 to this feature.

I do this often with my daily notes:

  • I have a thought/idea that comes up.
  • I create a title “###### Name of Idea”, and I start writing my idea underneath this title.
  • Quickly enough, I realize this idea has different components/is related to different concept and deserves it’s own note.
  • So I change the paragraph beneath the title to ![[Name of the idea]], click on it to create a new file, and then just paste my text there.
    (I also do the opposite sometimes: create a note and embed with the title from my daily note like this: ![[2020-08-14#Name of the idea]] )

A hotkey after selection that implements what has been discussed in this thread would be a nice Quality of Life improvement.

However, I do think this will be much easier to implement or become natural once a WYSIWYG editor is implemented, which will spare us switching from edit to preview mode.

1 Like

+1 This sounds great.

One usecase I’ve always had in mind with this was just taking a section (everything under a heading and its subheadings) and simply refactoring that out.

This way you could trivially refactor all links pointing to that section or one of its subsections. If a note is structured enough, but too long overall, it would simplify things.

2 Likes

Another +1 to this feature. I’m a student and when I’m taking notes while watching lectures or reading I don’t want to worry about note structure, so I usually just make big note sections and organize them into discrete notes later. A feature like this would really improve this experience.

2 Likes

My main aim to refactor note is to preserve links.

So if I have a bigger note with more concepts in it, and finally extract those to their own file, I’d like to have all the links remain valid.

1 Like

As usual, here a code snippet which will add this feature while it doesn’t exist inside of Obsidian. Highly experimental, be careful.

1 Like

I think a lot of map of content users might like this feature, since maps/workspace notes often start as large dumps of thoughts that hopefully ‘bud’ off into their own notes.

Bonus: leave behind an [[untitled]] link in the existing note so that it automatically updates when I rename the new note (stop my mouth is watering)

Edit: thank you to the mod that moved my other thread here. I did not know this was called “refactoring” Would love to see this feature

1 Like

There is now a community plugin that does all of this!

1 Like

I have finally determined why I am not writing in Obsidian as much as I like. And an added feature to the note refactor ext may be all that’s needed!

Do to issues with working memory and processing speed I see the ability to automatically create backlinks absoluty neccessariy in reducing cognative load. This is where the note-refractor plugin can help.

If I was able to refactor the selected text to a new note while keeping while keeping the original note in its place, this is what would help greatly. So that I can see the note in it’s original context.

1 Like

Use case or problem

While it is wise to not create notes automatically through backlinks, there are various cases where this is suboptimal behaviour.

For instance, while writing cross-referenced wikis. In these cases, users will have to copy-paste text to the new note manually; this gets cumbersome.

Proposed solution

It is not a good idea to automatically create notes for each backlink. However, when a backlink is referenced in a header, like
## [[Backlink]]

The content of the document from that point until the next header of the same level can be copied to a new note, and this note can be automatically created.

Current workaround (optional)

None that I can think of.

Related feature requests (optional)

Create this feature as a toggle, so that users who don’t want this behaviour can keep using Obsidian like they now do.

1 Like

Have you looked at Note Refactor plug-in? It is doing that and is totally awesome. You should just select what you want to be moved, whether it is just one heading or more.

3 Likes

hi, with the note refactor plugin

what code should i use if i want the new note name will be the - original note name + the first line of the part i cut?

thank you

2 Likes

It would be nice to add file name suffixes:
{{title}} {{new_note_title}} or {{title}} {{date}}

It could be implemented also to create relative paths
{{title}}/{{title}} {new_note_title}}.md

:+1:

This will be implemented in 0.12.6

5 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.