Transclusion/Embedding for Searches

Making searches transcludable within a page, e.g. using !{{search operators}}, would probably enhance several workflows in Obsidian.

(Without !, that’d be a link to a search.)

49 Likes

What does ‘transcludable’ mean? :slight_smile: I’m not a native English speaker, and Googling ‘meaning transcludable’ doesn’t return useful results.

1 Like

I don’t know either if this word exists, if not, yay, I invented a word :wink:

It stems from Transclusion, which is a concept Obsidian also uses to include other files (or sections from other files) within a file, e.g. you could type ![[Transclusion]] to actually embed that file instead of linking to it. (Or ![[Transclusion#Definition]] if there was a section called that.)

Hope that clears things up!

7 Likes

Thanks for the clarification! This is a cool idea. :slight_smile:

1 Like

Hey @BENWF - Interesting idea, I’m thinking of how I could use this…

Did you have a specific example / use-case in mind for how you would use this? Which workflows?

If so, it will very much help others understand why you want this, and make the case for your feature request much stronger.

1 Like

This is an interesting idea. It could be used to dynamically slurp all links to dailies for the month of November or for a whole year. Or you could use it to build a MOC by searching for a particular tag. For this to be really useful dynamically there would need to be some kind of sort attached to it.

8 Likes

As @kbrede wrote, and so much more.

With some RegEx you could e.g. have all undone or undelegated todos shown (so you can actually create a project management system with todos across pages), or only articles that are also tagged drafts but not anything else (so you’d have an instant document management system).

This would pretty much enabled sophisticated quasi saved searches to be embedded within a page.

I’d consider this usage advanced, but highly useful for those who use Obsidian as their primary workspace.

Regarding use cases, this would solve e.g.:

7 Likes

I like these. And how your examples naturally focus on two diff categories:

  • @kbrede’s are knowledge-management oriented
  • @BENWF’s are task-management oriented

In either case, the benefits are clear.

6 Likes

It would help a lot with making a dashboard! I would love this feature!

3 Likes

This would be awesome. This would solve so many problems. Finding all of your todos across all your documents. Filtering out any Todo that are incomplete. Summarizing all of your stuff for the week with a single search. Yeah this would be awesome

2 Likes

Something like this is on our radar.

24 Likes

This is quite similar to the function of queries over on Roam. It would in fact be quite awesome. In fact for me it’s one of the last missing pieces toward Obsidian being everything I was looking for in a knowledge management app. End of a search that stretches back to the late 1980’s (ok once we have this plus plugins, sync and publish the search will be over) so thrilled at what the developers are doing here.

8 Likes

I have a similar idea:

We can define a special code block element like this:

```obsidian-search
date:<2020-01-30
in-text:Hello World
tag:abc
```

This idea inspired by search engine commands. Because we have a multi-line editable block, using a DSL is available:

  1. use newline to separate keywords
  2. provide AND, OR as logical operator, and use AND as default one.
  3. provide xxx: prefix-command as search commands to search special domain content such as date:, tag:, stared: and so on (in-text: is the default).

We can specify a unique identifier for our search commands, such as obsidian-search or shorter, and re-write the rendering process of markdown’s code block.

And then, for programming performance, We can keep a cache for searching, such as save a list of search results in a file named ${search patterns} | hash, and provide automatic or manual refresh functions.

In addition, which features we needed are all able to classify into three parts:

  1. UI (display style, interaction etc.)
  2. Organization (how can we manage notes, attachments etc.)
  3. Content (formal language, DSL, special patterns etc.)

In my opinion, good classification brings pretty conversions.

3 Likes

quite nice idea. This is like automating internal links in our working file which updates in the real time.

1 Like

exactly! developers of obsidian are doing something that I always wondered why no one is doing. And they are doing a great job doing this!

1 Like

I am currently using obsidian to organize my leetcode codes. I add tag for each problem like #stack, #array and so on. I would like to display them in group of tags.

In Notion, this could be easily achieved through filter of database. In Obsidian, this could be achieve by search, but it’s inconvenient. So I think it would be great if I can embed search result. The form of embedding could be showing list of filename reference.

for example:

![[<search #leetcode #array.>]]

and then embed


  • [[leetcode001]]
  • [[leetcode101]]

This would also be useful for task management like embedding file containing #todo or "- [ ]" so that we doesn’t need to manually search them every time.

1 Like

Merge from my post “embed search result”. I have search about this in the forum before I made my post… never think about the word “transcludable”… I think a more understandable title would be great~

This person uses roam as a personal tracker … example, I type how I feel on a day, and then I can search all days where I feel “tired” and see what that is connected to.

Having the ability to specify what comes back in searches could be super useful:

  • Only the current bullet
  • The current bullet and children bullets
  • The current bullet, children bullets and the parent
  • Current bullet, children, parents, & peers
  • Other paragraphs
  • Everything under the current heading
    etc.

Then I could say, for example, “Search my daily notes, for the link [[energized]] and return everything in the current parent (bullet or heading or whatever)”

Best
David

2 Likes

I don’t know how difficult this may be, but I am curious about your thoughts on a potential accessing of search capabilities by storing search terms in the form of some internal link.

Potential use case

In Obsidian there’s potential to have a lot of tag crossover as you cultivate your Instead of typing in something like "#tagone" "#tagtwo" everytime you want to get a more defined search, perhaps a method can be considered to encapsulate those searches and called upon in a single click. Idk how exactly that can be carried out, but maybe something of a cross between the wiki link ability and it outputs a tagged format link. Or, perhaps we can just call the obsidian search ability and access that via the wiki or markdown links.

Something like [text](search:"#tagone" "#tagtwo"). And in the html/css, this kind of link can have its own property, like .search-link instead of .internal-link or .external-link so that we can color it differently, making it standout as a search link.

2 Likes

I have wanted this feature in almost every text based tool I have ever used, and only ever got something like it to work properly in emacs org-mode in a limited fashion. Sometimes, even for those apps where “pre-defined filters” or “stored searches” can be created, there just isn’t enough room in the interface and it gets messy real quick.

Placing a search as a link in a text file itself would be awesome, and puts the power back in the hands of the end user again.