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:: [[ wisdom]], [[ questions]]]
-
["] “Organized religion is a defense against having the religious experience.” [author::Carl Jung], [source::Unknown], [topics::[[ paradox]], [[ 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
wisdom, questions
❝ “Organized religion is a defense against having the religious experience.” ], ]]
~ Carl Jung, Unknown
paradox, 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