PTPL 204 · How to Hide Obsidian Queries in a Folding Callout
Nesting queries inside collapsible callouts, plus custom colours and icons
It’s true that plain text can be beautiful when it is boring in all the right ways, but that doesn’t mean we can’t have a little fun. Let’s take a look at an unashamedly Obsidian-only tweak I’ve been playing around with for the task lists that live in my plain text planner.
Super niche, I know, but you can use the same principles with your own queries (or just text) in Obsidian. (If you’re new to app-agnostic text-based task management, this is how I handle my todos in plain text.)
Here is a basic Obsidian-flavoured query that will show a list of all the lines in the file named todo-txt.md, that contain the strings (A) or (B):
```query
file:todo-txt.md line:("(A) OR (B)")
```
It renders like this in preview mode:
It shows me the tasks I need to focus on today, as well as those I want to find time for sometime this week, but this is where the fun begins!
I want to see that task list under today’s date in my yearly plain text planner (you might want to see it in your daily note), but I want it hidden until I’m ready for it.
There are four main ways to hide queries (and other things) in Obsidian.
- Fold them under a header (Settings > Editor > Display > Fold heading)
- Place them in a comment (
<!-- like this -->,%% or this %%) - Embedding (or transcluding) the query from another file, then removing the
!(e.g.[[FileName#like-this]]instead of![[FileName#like-this]]) - Place them in an automatically folded callout
All the above do the work of hiding what you want hidden, and allow you to click or edit part of the line to reveal it again. Number 4, the callout, is what I’ve chosen to go with for my task list as it is the most convenient and the nicest looking.
Here is that same query, in simple callouts:
> [!todo]+ Today
> ```query
> file:todo-txt.md line:"(A)"
> ```
> [!todo] This Week
> ```query
> file:todo-txt.md line:"(B)"
> ```
And here they are nested in a single callout, with the Today list expanded and the This Week list hidden by default (see the + and - after each respective callout box identifier):
> [!today]+ TASKS
>> [!list-1]+ Today
>> ```query
>> file:todo-txt.md line:"(A)"
>> ```
>
>> [!today]- This Week
>> ```query
>> file:todo-txt.md line:"(B)"
>> ```
You can also create your own custom callout text, symbols, and colours. Huge thanks to obsidianstats for their starter CSS snippets.
Copy the following code into a plain text document in an app like Text Edit, then change up the colours, your-label, and clock (to another icon). Rename the file extension from .txt to .css, and place the document into snippets in the hidden .obsidian folder inside your vault. Reveal this folder on a Mac by pressing ⌘⇧. (Command+Shift+period).
.callout[data-callout='your-label'] {
--callout-color: 153, 27, 27;
--callout-icon: lucide-clock;
}
Have fun choosing icons and colours for your custom callouts in Obsidian! When choosing colours, keep in mind that the way they render will depend on your Obsidian theme. You’ll need some more detailed CSS to override the defaults.
Here’s what today looks like in my plain text planner:
Post Script(s)
After last week’s post on What I Write With - 3 Cheap fountain pens, and a pencil from the 1970s, I put up a poll on Mastodon asking if young people of today find my handwriting hard to read. Check out the conversation here.
An interesting point: kids in the tech era might not be taught to write in cursive the way older generations were, but they are used to reading all sorts of decorative fonts, so cursive isn’t usually a problem.
Thank you to everyone who has offered suggestions for apps to replace those I’ve been using in Setapp. I’ll be taking my time going through them and will report back later.
Looking into whether Mole will be a good replacement for CleanMyMac, or if there could be serious security concerns with giving an open source app access to the brain of my computer.
💬 I love to hear from readers! email hello at ellanew dot com or message me on Mastodon or Bluesky. Follow my RSS feed, or sign up to receive a weekly plain text themed email.
If you’ve found value here, I invite you to share this post with someone you think will appreciate it or make a contribution to my support jar.
Discussion in the ATmosphere