Linking text within a draft

I have a draft with roughly 100 entries. So, for example a couple of my sample entries are:

1. One has to be able to think clearly and act in panic market.
2. When the volatility expands dramatically, the opportunities for profit in arbitrage are greatly enhanced.

So, point number 1 above is related to ‘Psychology’, I want to tag it as Psychology
Point number 2 is related to ‘Opportunity’ and I want to tag it as Opportunity.

I know this wasn’t possible in the Drafts app. But, can I use the ‘Custom Syntax’ features to basically link text within a draft. So, now I go to the draft called ‘Psychology’ and I get all my notes on that, I go to my draft called ‘Opportunity’, and I get all the notes tagged with ‘Opportunity’ - so on and so forth.

It sounds like you want to trigger a link to a draft on each line. You have been able to add inter-draft links for some time, do that is certainly possible.

The difference may be that you want to tag in some way. A custom syntax may be able to support this, but it depends on the details.

  1. How do you envisage tagging each draft entry?
  2. Will each entry in a draft be one line and always in a numerical list?
  3. Do you want to mark the link able text in some way, or is it to be derived somehow from the structure?

You may just be able to use standard functionality if you were willing to just use “[[Psychology]]” as the"tag" at the end of the line and have that as the linked element. But if you want something extra, the answers to the points above will hopefully help clarify that.

I honestly don’t think that, even with syntaxes, you can do exactly what you want. Syntaxes really only work with one Draft at a time, so I don’t think they’d help a lot.

What I’d probably do in your situation, is tag each line with the tag you want, say #opportunity or even [[opportunity]], if you like, then use the block level filter action to search for what you want, say #opportunity.

The result isn’t a Draft, but you should be able to see the whole bullet point, and if you select one you’ll get jumped to that line in the Draft.

1 Like

This is exactly what I want. And that Block level action works for me. Is there any way to get this into another draft? Maybe, @mattgemmell might be able to chime in on this? Thanks a ton.

Actually, in the documentation

There is a subsection titled ‘Advanced HTML Previews - Drafts User Guide’ - I don’t know how to code. But the skill set on this forum is top class, maybe someone has figured out a way that they can share.

Suppose I have a paragraph that I have tagged as [[trading strategy]] and another paragraph with [[psychology]]. I also go ahead and create these as separate drafts. I want the full paragraph to be visible when I open the ‘psychology’ draft and also all the paragraphs that are tagged as [[psychology]]. Similarly for the [[trading strategy]] draft.

When you select those links, Drafts would navigate you to those other named/titled drafts.

Well, to get content to be referenced into those drafts, you would have to put the content into those drafts. Even in tools like Roam Research, you have to populate he content. Tools like Data View in Obsidian can help you display dynamic content, which is what it sounds like you might be after, but even then I think that is generally geared around atomic notes (one note, one idea/piece of information - ref. Zettelkasten), rather than what I guess would be a molecular note (one made up of several inter-related ideas or pieces of information); more aligned to block rather than note level personal knowledge management approaches.

Rather than referencing drafts then, this swings back to @yvonnezed’s suggestion of using @jsamlarose’s action which will search for drafts and display the results in a single line of context. So not in a draft, and not necessarily the whole block if your block does so happen to be multi-line.

You note that you want to " to get this into another draft". There are always ways to do things like that, but you haven’t said what you want to add in. All matches or one match? Then comes the natural questions of what is it you are looking to achieve by doing this? Is it okay that this data could then fall out of sync with the original, and that by duplicating the content like this, you will inevitably add more noise/matching results, to your searching?

1 Like

As is so often the case: yes to what @sylumer said.

If I’m correctly understanding what you’re aiming for @yashodhankhare, it’s one of the use cases I was thinking about when working on the block level reference filter. The action is a bit of a “best of both worlds” effort, reducing the need to decide between block level and note level ways of working. As noted, the filter (HTML menu) serves as the data view, rather than a draft in itself.

I did give some thought to having the list show paragraphs indented underneath any paragraphs containing the inline tag or wiki-link being searched for, but that got a bit more complicated than I needed it to be (I was thinking about making any such paragraphs collapsible/foldable).

Not sure if this helps, but the filter action currently supports inline tags. I’ve tweaked my syntax to take advantage of this— turning inline tags into active links that trigger the filter, and thus facilitating a search for any other blocks that contain that tag. That might be useful as you refine your workflow here?

I want all matches into ONE draft

The idea is to filter by content. So, as part of my business requirements, I have to read a fair bit. And, I prefer to contextualise things, rather than by author. This process of contextualising content that I consume takes time, and for this content to be useful to me, I then convert some of it into Anki cards, and then some of it has a direct application of stock market advisory services. The rest is useful at some point in the future. The point is to generate a ‘latticework of mental models’ (Munger). I am aware of Roam Research, but if one just keeps dumping things into the Roam database, it is useless. One has to process and understand the context and for that the starting point is taking notes in drafts. It is indeed ‘where text starts’, pun intended!

Could you elaborate? I use tags as in [[abc]] or #abc and filter on these, I get what I want. Did you mean any other method? I can take a screenshot of the output that the filter action produces, was wondering if there was a use case for any other route. Thanks

Is it okay that this data could then fall out of sync with the original, and that by duplicating the content like this, you will inevitably add more noise/matching results, to your searching?

Given your additional detail and context, it sounds like a scenario where you would need the data to dynamically update so that it is current. If so, you would need to automate some trigger; potentially outside of Drafts to maintain this - e.g. a schedule. It wouldn’t be possible to keep data in a draft dynamically updated via a custom syntax. You would probably be best served by scripting a solution.

I don’t need dynamically updated systems for the drafts application. Just one will do, because all the dynamic updating happens in the next stage of the ‘process’.

Okay, it sounds then like you are happy to manually maintain the content of the ‘psychology’ and ‘trading strategy’ drafts rather than automating it as was noting above.

In that case, the standard wiki-style cross-linking would jump you to the right content. If you use headings to split up the content, you can even jump to those locations in the other draft using the standard feature.

I can jump, but it doesn’t go to the exact text, can you exactly explain what you meant by ‘wiki style linking’?

Someone just posted this: Mediawiki WikiSyntax

Is there some way we can use this?

It’s all standard stuff in the documentation on creating links.

  1. Wiki-Style Cross-Linking Drafts
  2. Linking to Markers Within a Draft

The key to jumping to a section is to have that block of text set up as a section. Hence my reference to using headings. These become navigation markers for Markdown that you can then reference in your cross link.

Yes, you can certainly use it, but I don’t think there’s anything to help you do what you want beyond the options discussed so far; and I’m including all discussions above, not just with me.

The [[]] syntax is the same as the standard markup Greg introduced - hence the “wiki-style” cross-linking. So that is something you already have access to, but do note the markers referenced above that will allow you to link to navigation markers in a draft - such as Markdown headings.

The << autocompletion is for some ‘common’ HTML, so that won’t enable anything for you.

List markers seem handy potentially, but not relevant to your linking use case.

I got the gist of it, and sorry for being rather dumb. So, I have a draft with say 100 entries. This is all on the Mac,

  1. The first entry I use a heading such as # Panic and I also put [[trading strategies]] at the end.
  2. The first entry I use a heading such as # Volatility and I also put [[opportunities]] at the end.
  3. The third entry I use a heading such as # Panic (again) and I also put [[trading strategies]] at the end.

And so on and so forth.

Now if I use the cursor in the top right, I can see Panic and Volatility, so I just click on these subheadings and navigate, is that what you’re saying? That doesn’t work exactly as I want, though I have made some progress for sure. If I navigate to Panic, it should show me ONLY Panic. Am I clear?

Here is how I understood your scenario along with what I suggested. I may be wrong on some of this, but, as I say, this is my understanding taken from the answers above.

Let’s say you have a draft with three (or 100+ in reality) bits of information in it:

# My big long list of stuff
1. My first bit of useful information about strategies in trading [[Trading Strategies/foo]]
2. My only bit of useful information about psychology [[Psychology/quz]]
3. My second bit of useful information about strategies in trading [[Trading Strategies/bar]]

Let’s say you happen to have another list too; in another draft. The principle is the same.

# My other very short list of stuff
1. Turns out I did have something else about psychology [[Psychology/qux]]

In the posts above there are a couple of strands of discussion about having searches or dealing with content within a specific draft. You have a requirement for the latter over the former - i.e., you have an explicit need to have text consolidated and existing in a draft that is linked to.

I had suggested considering an automated way to populate such drafts, but you have opted to manually maintain them. Therefore, I would expect you to create two drafts something like this.

One for trading strategies.

# Trading Strategies

## foo
My first bit of useful information about strategies in trading

## bar
My second bit of useful information about strategies in trading

And one for psychology.

# Psychology

## quz
My only bit of useful information about psychology

## qux
Turns out I did have something else about psychology

When you follow one of the wiki-style links in the “My big long list of stuff” or “My other very short list of stuff” draft, you would be taken to the respective other drafts, and in fact to the corresponding heading for the link.

You can use the navigation list (“the cursor in the top right”) to navigate to other headings within the “Trading Strategies” and “Psychology” drafts when you are in them, but the wiki-style links are cross-links, and enable you to navigate between drafts and even down to specific sections/navigation markers within a draft.

Hopefully, this all matches what you described, what I described, and at least something along the lines of what you have had in mind.

I understand exactly. But this will create multiple drafts. I’ll just show you what I’ve done, and then just tell me how to improve it. It’s basically what you were hinting at earlier. Just took me a bit longer to understand. Thanks for being so patient, but I think the screenshots below will clinch this.

I’ll explain what I’ve done. My draft with 100 entries is called ‘Trading Strategies’. I have made section headings like you suggested. So, one type of section heading is with # and the second type is with ## and the third type is with ###.

The second screenshot shows those notes that have been prefixed with # and I can use the notch on the top right to ‘navigate’. I think this is he way it’s supposed to work and what you were hinting at earlier. Is that correct?

Assuming, I’ve got this right, feel free to suggest improvements or changes.

Yes. From what you described/I understood, there was a duplication of data across multiple drafts and this was bring done on purpose and cross-referenced.

It didn’t really make sense to me, and that’s why I included this caveat in my previous post:

Here is how I understood your scenario along with what I suggested. I may be wrong on some of this, but, as I say, this is my understanding taken from the answers above.

I can try, but I can’t promise. I may still not get exactly what you are trying to do, and sometimes trying to explain thing on a forum thread can be quite difficult … but it just means that sometimes it takes a bit longer to find the right solution.

No problem.

You have two level one Markdown headings ("#") and one level three Markdown heading ("###") in your “Trading Strategies” draft. I would imagine that the title you might want to keep as level one, and all sections beneath that as level two ("##") unless you purposefully want subsections - but that hasn’t come up anywhere earlier. Otherwise, I can’t tell from your screenshot and description what you are doing with your heading levels.

Your “Strategy” draft would then be able to use [[Trading Strategies/Panic]] to link to the section containing point 1 in your “Trading Strategies” draft, and [[Trading Strategies/Volatility]] to link to the section containing point 2 in your “Trading Strategies” draft.

If the “Strategy” only contains links to the “Trading Strategies” draft, it looks very much like you are building something like a table of contents that links through to specific points in the “Trading Strategies” draft. If so, and you wanted to include all sections, in order, it would be straight forward to create an action that builds that into a draft, or even a pop-up prompt that allows you to jump to a specific section.