Need Help Managing Quotes as Tasks

What I’m trying to do

I’m fairly new to Obsidian and completely new to any kind of coding. I’ve been trying to find an elegant and efficient way to handle all the quotes I have in my vault that’s also easy enough for my very limited coding skills. It’s been a challenge.

Things I have tried

I’ve spent countless hours trying different things I’ve read on this forum as well as several other places.

The best method I’ve come up with is to format them as tasks. I’m capturing the quote after the “checkbox” (that I’ve turned into a quote emoji) and adding author, source, and topic-links as inline data fields following the quote. Then I have a Master Quote Note for collecting all the quotes where I’m trying to use a Dataview query to list all the tasks (aka quotes).

With the help of ChatGPT and some brilliant coding bits I picked up from “holroy” (a member of this forum) in the following thread, I’ve managed to ALMOST get something I’m satisfied with:

But I can’t figure out how to make the regex function work properly.

I capture like this:

  • ["] “Problems that remain persistently insoluble should always be suspected as questions asked in the wrong way.” [author::Alan Watts], [source::The Book on the Taboo Against Knowing Who You Are], [topics:: [[:label: wisdom]], [[:label: questions]]]

  • ["] “Organized religion is a defense against having the religious experience.” [author::Carl Jung], [source::Unknown], [topics::[[:label: paradox]], [[:label: buddhism]]]

My Dataview query is this:

```dataview

TASK

WHERE status = "\""

FLATTEN regexreplace(text, "[\[][^\]]+[\]][, ]*", "") + "<br> _~ " + author + ", " + source + "_ <br>" + topics as visual

My output is this:

❝ ”Problems that remain persistently insoluble should always be suspected as questions asked in the wrong way." ], ]]
~ Alan Watts, The Book on the Taboo Against Knowing Who You Are
:label: wisdom, :label: questions

❝ “Organized religion is a defense against having the religious experience.” ], ]]
~ Carl Jung, Unknown
:label: paradox, :label: buddhism

As you can see, I can’t figure out how to make the regex function get rid of the trailing brackets that come with the topic-links. The bit of code that I picked up from this forum was literally the first time I ever saw a regex function, so I’m pretty limited in my troubleshooting, and ChatGPT has quite honestly sucked at it, too. So I’m waiving the white flag and seeing if anyone here can do it.

I’ve also experimented with moving the topic tag-links to a subtask of the main task. This solves my extra brackets issue, and if I don’t get a simple solution here, that’s probably the way I’ll go. I don’t know enough to know which method is best in the long run, as I’d love to be able to sort quotes by author or by topic-link eventually. I also want to minimize any coding troubleshooting I’ll have to do, as I really want to use Obsidian for my notes and my writing and NOT have to spend a lot of time on the backend of it. The many quotes I have are an important part of what I’m writing though, so this seems something I’d like to get right up front. Open to suggestions and insight on that decision, as well.

And if anybody has a more elegant and efficient way to manage quotes that a non-coder like me can handle, please share!

Thanks so much,
Dena

I would use the example below to make the quote easier to read in the original note and in any queries.

## quotes

- ["] “Problems that remain persistently insoluble should always be suspected as questions asked in the wrong way.” 
	- author:: [[Alan Watts]]
	- source:: [[The Book on the Taboo Against Knowing Who You Are]]
	- topics:: [[🏷️  wisdom]] [[🏷️  questions]]
- ["] “Organized religion is a defense against having the religious experience.” 
	- author:: [[Carl Jung]]
	- source:: [[Unknown]]
	- topics:: [[🏷️ paradox]] [[🏷️ buddhism]]

## query

```dataview
TASK
WHERE status = "\""
```

Thanks for that! It does look more clean, but how would I sort (or search) by author, source, or topics?

1 Like

The version below works in a test vault. Any closer to what you want?

## quotes

- ["] “Problems that remain persistently insoluble should always be suspected as questions asked in the wrong way.” [author:: [[Alan Watts]]] [source:: [[The Book on the Taboo Against Knowing Who You Are]]] [topics:: [[🏷️ wisdom]] [[🏷️ questions]] [[🏷️ testtopic]]]
- ["] “Organized religion is a defense against having the religious experience.” [author:: [[Carl Jung]]] [source:: [[Unknown]]] [topics:: [[🏷️ paradox]] [[🏷️ buddhism]] [[🏷️ testtopic]]]

## all quotes

```dataview
TASK
WHERE status = "\""
FLATTEN regexreplace(text, "[\[][^\]]+[\]]*", "") + "<br> " + author + ", _" + source + "_<br>" + topics as visual
```

## author

```dataview
TASK
WHERE status = "\""
AND author = [[Alan Watts]]
FLATTEN regexreplace(text, "[\[][^\]]+[\]]*", "") + "<br> " + author + ", _" + source + "_<br>" + topics as visual
```

## source

```dataview
TASK
WHERE status = "\""
AND source = [[Unknown]]
FLATTEN regexreplace(text, "[\[][^\]]+[\]]*", "") + "<br> " + author + ", _" + source + "_<br>" + topics as visual
```

## topics – paradox

```dataview
TASK
WHERE status = "\""
AND contains(topics, "🏷️ paradox")
FLATTEN regexreplace(text, "[\[][^\]]+[\]]*", "") + "<br> " + author + ", _" + source + "_<br>" + topics as visual
```

## topics – testtopic

```dataview
TASK
WHERE status = "\""
AND contains(topics, "🏷️ testtopic")
FLATTEN regexreplace(text, "[\[][^\]]+[\]]*", "") + "<br> " + author + ", _" + source + "_<br>" + topics as visual
```



Well…I think so? Apologies that my coding skills are so rudimentary that I’m struggling to even be able to answer that question simply! :confounded:

First off, I notice in the second version, you’ve changed the original quotes to have all the fields in the main task (as opposed to how, in the first version, they were bullets below the task/quote.). Is this because that’s the only way that Dataview can search or sort by the author, source, or topic-link?

And, by the way, in the first version, would those bullet points be considered “sub-tasks” of the main task/quote (and thus stay linked to it)? Or are they essentially “disconnected” from the main task/quote once there is a line break? Perhaps this is why it’s better to put everything in the one line?

It does seem to be working as it should, but I’m going to add a few more quotes to further test it out.

I’m so grateful for your suggestions and ideas! Can’t thank you enough! :pray::pray::pray: