Note extractor

This is something that I’ve seen discussed in discord but I don’t think it’s gotten a request card yet so I figured I’d put it up for official discussion over here.
The idea is that in order to relieve the inability to link directly to blocks, while still facilitating quick note taking without careful formatting of headings and such, you can easily ‘pull out’ any chunk of text to its own note so you can easily link to it, replacing it with an embed in the original.
That is, if I write a paragraph that I think I will want to link to or reuse, I can select it, click ‘extract’, enter a name for the new note, and Obsidian will a) create a new note with that title, b) copy the selected text into that note, and c) delete the text from the original note, replacing it with a ![[new note]] embed.

This helps alleviate one of the big issues for people used to outliners, namely that lines aren’t first-class entities, while allowing you to write naturally without thinking about note structure as you go - ideas can be easily pulled out into their own atomic notes as needed, so you don’t have to decide as you go whether it needs its own file or not

22 Likes

This is a nice idea, but one thing I really like about Roam is the way linked blocks retain the context of where they were created. I worry that extracting a note block would lose this context?

2 Likes

So the function you’re describing is to highlight “this text” in [[Note A]], type ![[, copy/pate “this text” on first line in the new note [[this text]]?

I may be wrong, but I’m not sure the goal you’re looking for is achieved with this method. This is what that does:

Perhaps if embedding UI was contained to just show that first line it’d get close to the goal, but if you change the text on the first line, the title of your note will no long match which can loose desired functions.

Maybe if a plugin keeps it up to date. ie it senses that if a file’s title is the same/matches file’s first line, then makes sure to always update title to match if there’s changes to the line.

Seems like it could be a sketchy work around though, because you can risk undesired outcomes.

1 Like

Curious also, will this encourage undesired habits? ie extracting lines into it’s own file can become unruly and bog your system down? Stress tests are 10k, but with lines as files that seems like it could get eaten up quickly.

I don’t know. Just spitballing possible outcomes.

Would there be instances where you want to extract a line and come to find out there’s already a file with that name?

Just default to embed link in that instance?

What if there’s matching lines but that mean entirely different things?

This is why I feel like ZK UIDs in the file names could be crucial with this method (render to be hidden ideally) in order to make sure every file you’re linking/referencing is unique.

But again, having single line files could get crazy. Maybe if there could be a subtle format (like headers) that would allow lines embedding then you alleviate the crazy file creation.

I do like the idea of commands/actions performed on highlighted text though.

What do you mean by context? The entire line of text that the backlink is on? Or the parent/children bullets?

Lines as files could definitely get unruly, although I imagine it would be used more for paragraphs than individual lines. The key thing is that ideas should be the base unit you’re working with. An outliner makes that easy, by having atomic lines, but I’m still unsure what the best way for a document-based system like Obsidian to do that is. The obvious way is that each idea should be it’s own document - think index cards rather than notebook pages - which this would be intended to facilitate. I don’t know whether that’s the best way, I think there’s definitely merit to the UID idea.

That’s why I imagine it would give you the option to name the note - in that case, the collision issue is no different than for any other note. Namespace features may help but that’s its own topic.

1 Like

Yeah, index cards are a perfect way to think of them, especially as they’re the origin of the ZK method.

When I say line, I’m referring to my understanding of a line in markdown (ie text until you use a line brake) which for me tend to be a single thought.

But yeah, everything you highlighted to “extract”.

So if you’re changing the title of the note from the text that will be pasted in (the text you’re wanting to embed), how will you be able to confidently search for them later if they don’t match? Also currently you can’'t change the display text of an embed.

Eg: ![ [changed title | the text that is on the first line] ]
doesn’t work

Sorry if I didn’t communicate it clearly. The way I imagine it goes something like this: I’m reading through some notes I just wrote and I see a section or paragraph (or individual line or word I suppose, although that’s not how I’d use it) that I think is important or reusable enough to get its own ‘card’. I highlight that section, hit the ‘embed’ button, and the program pops up a text box to enter the name for the new note. I enter ‘My new note’ or whatever and hit enter. Obsidian copies the text I’ve selected from my current note to My new note.md, and replaces it in the source with ![[My new note]]
Because it’s embedded, the preview looks almost the same, but now anywhere else in my vault I can easily reference or embed that idea. I’m not sure what you mean about changing the display text of the embed - it’s embedded, so what displays is the full content of the note.

We don’t just name the note as the source text for a couple reasons:

  1. If the section you select is longer than a few words, the note titles become very difficult to parse or work with,
  2. It doesn’t matter all that much what the note title is. My inclination is that it’s better to have short easily parsable note titles that don’t give much information, since the actual good stuff is in the file itself. All the title has to be able to do is direct me back to the note - it should be the name of the idea, not the idea itself. Especially if we have a good full-text search, where I can easily find something that’s in the text of the file if the name isn’t helping me. I think of the titles more like a subject line of an email, rather than the whole body - if I’m skimming the list of files, I get get an idea what I’ll see if I open the note, and I don’t really need any more than that.
  3. It doesn’t matter whether the title matches the text because I’m not going to remember the text later. If I have an idea about something, and I want to reference it later, I’m not going to want to, or likely be able to, memorize all my thoughts and reasoning I’ve written down. All I need to be able to do is remember what the idea was about, and I can probably find it, so for me at least, it’s better to call the note ‘ideas about x’ or ‘why x is y’ and make it something easily findable, rather than writing out my whole thought process in the title.

Note titles should be as compressed as possible - I’m not going to be reading through my file explorer to understand my notes, all the title has to be able to do is direct me to the file, and doesn’t really need to be able to convey any information beyond what’s in side - it should be a subject line, not the actual body. I titled this post Note Extractor because that’s enough that you can a) get some idea what it is without opening it and b) if you’re looking for similar ideas, it will come up. I didn’t feel the need to title it

This is something that I’ve seen discussed in discord but I don’t think it’s gotten a request card yet so figured I’d put it up for official discussion over here. The idea is that in order to relieve the inability to link directly to blocks, while still facilitating quick note taking without careful formatting of headings and such, you can easily ‘pull out’ any chunk of text to its own note so you can easily link to it, replacing it with an embed in the original. That is, if I write a paragraph that I think I will want to link to or reuse, I can select it, click ‘extract’, enter a name for the new note, and Obsidian will a) create a new note with that title, b) copy the selected text into that note, and c) delete the text from the original note, replacing it with a ![[new note]] embed. This helps alleviate one of the big issues for people used to outliners, namely that lines aren’t first-class entities, while allowing you to write naturally without thinking about note structure as you go - ideas can be easily pulled out into their own atomic notes as needed, so you don’t have to decide as you go whether it needs its own file or not

because you can’t even read it just scrolling by and it’s not really necessary - the title is for organization, the body is for information

1 Like

I see. Perhaps I’m thinking about the title being associated to the note because 1) emending displays the title currently 2) it requires mental processing to properly title it and you may not know what to call it

Perhaps the text is pasted in the note as a header and it’s a header embed? This would display just the text you copied.

I like the idea. Personally I’d definitely want an option to have UIDs automatically be generated in the title to help keep the notes unique & baked context/info in it regardless of what I name it.

If Obsidian could have a toggle to filter out the UIDs in the file explorer it could keep things legible.

That’s what the existing ZK UID plugin does, isn’t it? I don’t use it but I think it’s the same idea- put an id in the title of every note to guarantee uniqueness

Currently it’s manual, when you press the button it just makes (and opens) a blank note with a ZK UID as the title. If I could have an option to have all new notes automatically have a UID be added (to the begging or after “my text”) that’d solve it.

这个问题我在处理中。用Quicker软件就可以轻松解决。

I already do this by paragraph, not necessarily line thought, that seems a bit excessive. ( :sweat_smile: those are all lines, lol. I swear I have paragraphs too!)

An example of another program that does this is TiddlyWiki.

Those top 3 embeds on the page on the right all look like paragraph embeds without a header. What’s your method for that?

.markdown-embed h3, .markdown-embed h2, .markdown-embed h1 {
display:none !important;
}

If I want a title to display in my embed, then i just use h4

I can see this feature being very useful for myself, although I think I would want a couple of variations of this; one where the selected text is just replaced with a link to the new note and one where the selected text remains in the original note AND a new note is created with the selected text (perhaps with the option of including a link).

As also mentioned it would be useful to be able to show where the selected text came from if this was desired.

1 Like

For me the typical workflow is, that I add consecutively informations to a topic in a md. File and organize them there.
When the file gets to big, or a subtopic stands out, I create for it its own file with an link pointing to it.
In this way the notes grow organically and new notes are created when necessary.

To make this workflow even faster, the plug-in would convert the selected section (beginning with a heading and the hierarchy being conserved) to its own md. And creates a link pointing to the file at the place of the previous heading.

3 Likes

oh, man, your first-time explanation makes me confused, in fact, you want make selected words a new file that you will name, and use the “quote” like “![[” to keep the contents of the original document unchanged in order to “quote” the selected words easier?

The thought is good , I think. may be useful.

请问你是如何解决的?处理情况如何了?