Block reference

I thought exactly the same! The plaintext structure of Obsidian gives it some more freedom, instead Roam is “blocked” in blocks. It could happen that you have a quite long block of text, but you want to reference only a small part of it. With the “snippet” way you said, you could do it. I also made two pics explaining how it could be.
Basically you start writing inside the two brackets and a windowed search tool appear (I screened the left bar search tool), showing you all the pages containing what you wrote and a little preview of it
Imgur

When you find your “block”, you start highlight it and the window lets you easily (but how easily is questionable, for sure not so easily for long sentences) highlight all the text of that page
Imgur

When you have finished highlighting, you could press Enter and the “snip reference” is created. How? This is a programmer question, and I am not. I think that it is possible to use the ID way that Roam uses. The program could put some unique symbols around the referenced text. For example: ^^^IDSTRING|text^^^. The program would know that everything inside | and ^^^ would be the text, and everything inside ^^^ and | would be the ID of the reference. And if you move to another note taking tool in the future, you can clean your markdown files from these tags simply by deleting everything that is inside ^^^ and | (it should be like a Regex command, right? I’m not a developer).
One problem is that this would be not easy to implement in a WYSIWYG editor

1 Like

I can imagine this will hard to do as long as .md files are “the database”. Roam surely is storing text very differently in its Datomic database.

From my experience with Roam what would I like to see “as a compromise” in Obsidian?

Linking to headlines is working. Headlines are parsed from the .md text and taken as anchors. That makes sense. (If the filename changes, links are updates. If the linked to headline changes, links are not updated, though. Quite understandable with .md files being the “database”.)

Headlines stick out with their # xyz at the beginning of a line.

How else could a paragraph (Roam “block”) be identified in a text file? By its line number - which is very volatile. Not good. Or by its first characters. Roam does identification with an internal block id; but Obsidian could rely on the user like it does for headlines.

If headlines can be presented during linking after the # so could any paragraph in an .md file. And if I continue typing I can narrow down the relevant paragraphs. Maybe I start parapgraphs I want to link to with a tag? Or I start them with a special § title of my own?

Gospel of Mathew

Chapter 1

The Birth of Jesus

§18 Now the birth of Jesus Christ took place in this way. When his mother Mary had been betrothed to Joseph, before they came together she was found to be with child of the Holy Spirit;
§19 and her husband Joseph, being a just man and unwilling to put her to shame, resolved to divorce her quietly.
§20 But as he considered this, behold, an angel of the Lord appeared to him in a dream, saying,…

Whatever is as the beginning of a paragraph can be used as a links - until it’s unique. [[Gospel of Mathew#§18]] would be sufficient in this case.

But in this case:

Humpty Dumpty sat on a wall.
Humpty Dumpty had a great fall.

more than just the first word would need to be included in a link, e.g. [[Poem#Humpty Dumpty h]] to reference the second paragraph. (Note that there was not special character needed at the beginning of the paragraphs. They were used in the prev example just to make selection of “linkable paragraphs” easier.)

Another option is to limit all your notes to the one paragraph/block. A new keyboard shortcut to add a sequential note, and a display set so that the notes appeared sequentially on screen in separate panes.

Unfortunately that requires users to adjust to a different concept of what they are writing. Some people organise their writing in a similar way in Scrivener which displays the separate sections with a feint line between them.

2 Likes

I always thought the most natural block is a separate file, but that’s just silly me.

4 Likes

I wasn’t going to because I’m not an active user of Obsidian and it just felt too fresh.

I think it’s worth a shot nonetheless, just to see what the devs think.

Done: Inline reference embeds

2 Likes

Another option is to limit all your notes to the one paragraph/block. A new keyboard shortcut to add a sequential note, and a display set so that the notes appeared sequentially on screen in separate panes.

This is one reason why I suggested “document spanning” be added as a feature. If multiple short documents could be treated as one when editing (like Ulysses and Scrivener do) then the documents could be much shorter… (It would also allow the file manager to work as an outliner).

8 Likes

Yes I agree with that feature request.
Though I’d preferred it not to be part of a file browser relationship, because I would prefer to retain that for other uses and would prefer to keep the mind free of that permanent reminder. Only some notes in a folder would be so linked.
It also allows Luhmann like child notes if that were wanted.

For me, it is because, instead of just a line with text around the [[topic]], a block of text retains more meaningful information. Therefore, you won’t need to go back to the original back an fourth to capture that information. So everything you need is within one page for you to review.

Another way is to let user manually control how many words (or sentences) around the [[topic]] can be shown. I remember the original idea of the system mentioned that the “card board” should contains around 3 sentences. I think it make sense. I don’t need a whole paragraph, but a few concise sentences would be sufficient to convey a meaningful information.

2 Likes

For me, it’s not so much wanting block references, but instead just wanting the paragraph/ bullet point that the backlink refers to in the backlink sidebar. Seeing what everyone has said so far, I guess it’s not as easy as detecting a where a paragraph/ bullet point starts and ends for the backlink. Being able to edit it in the backlink itself in the sidebar is secondary to me.

3 Likes

it is not necessary to link to a line, paragraph/bullet is just enough.

I have a simple solution and I have already implemented it in Python. By this implement, you could refer any paragraph of all existed document in all vault in the time complexity of O(1). but I don’t know if you could port the python version code to obsidian.md .

1 Like

O(1) is certainly good. Mind sharing the code?

So markdown already has a block feature, but it’s currently only used for code. But what if it didn’t have to be. I think you can totally use a code block for block references without breaking markdown.

You do it by decorating the start and end tags for the code block like this.

```text
This is some very fancy text I want to quote elsewhere
```[fancy_quote_link]

In code blocks, the header token decorator usually tells the linter what language is in the code block, but what if it could be used for more than that. In this example, I just called it text, but Obsidian could create it’s own tag just for block references. With plugins, you have one for quotes and one for bible verses, both handled (and displayed) differently in the Markdown engine.

At the other end, the bottom of a code block is a wasted line with the footer token. Why not use that line to demarcate the name of the block. This could be a GUID that’s generated by Obsidian, or some memorable text created by you.

From there, you toss around [fancy_quote_link], and Obsidian handles the block reference in the background.

15 Likes

I will gladly second this feature request and emphasize a use case scenario that utilizes block references in a way that I am not sure how to duplicate in obsidian at present (if anyone has suggestions though please let me know!)

When I am taking notes from a mathematical text, there are many definitions that one has to keep track of when attempting to write proofs. For example the following definitions are in my page corresponding to notes from a math text:

image

Some way down through the notes, there is another entry which refers to a theorem and linked note page containing the proof.

image

On the page which contains the actual proof, I use block references which pull in relevant definitions or theorems that are required for actually proving the theorem.

In roam this has the added benefit of allowing me to also see all the places where I have used the block reference, and hence give me knowledge context as to how the theorem or definition is used in practice (e.g. this definition is used in these proofs or problems…)

image

8 Likes

I think the area formed by ### H123·· can be used to replace the block, but the premise is that these H1, H2, H3 can be searched out by (()), instead of finding the page first and then looking for these titles

2 Likes

fantastic idea.

I use reverse index which is the basic principle of elasticsearch to reindex the file name, title and the paragraph. It is a terminal program based on Python, when you type the keywords on it, it will show suggestions while you are typing. you could use keyboards to select the correct one and then this one will be copied to your pasteboard automaticlly. then, just paste the copied content at obsidian.

2 Likes

I strongly agree with you. Limited by the system structure based on markdown files, it is easier to make a little upgrade on searching mechanism in (()).

fantastic!!
only if with an upgrade of searching mechanism to enable quick searching for blocks.

Can you share that python code this thread ? Thank you. Indeed nice work around.

Agreed, this is a great workaround – would love to utilize the code if available and willing to share @kingname