Toggle embedded note content

I’m working on my PhD thesis, and I’m using the “thesis map” idea (1 sentence => 1 paragraph). I’m finding Obsidian a fantastic tool for this, as I keep the paragraphs in separate notes, with the title being the sentence.

I’m using the clean-embeds css snippet, which is fantastic for viewing the whole document, but I’d love a way to toggle on/off the contents of the notes, just leaving the title.

I’ve not done any css before, and I’ve played around with the Developer mode and been able to remove from view the contents of specific notes when in edit mode, but I couldn’t figure out how to do it for all the embedded notes in one go. Given a thesis is a long document, I don’t want to be going through and removing each one individually every time I open Obsidian!

I would be happy with using another plug-in, or to change my clean-embeds code (I’d make a new copy and point to that, keeping the original unchanged), or to have a quick and simple method to remove the content from view each time using the Developer mode.

Here’s a picture of what I’m going for. Left is the thesis map in editor mode where I’ve gone through the developer and deleted the view of content for each note, leaving just the descriptive titles. Centre is the same map in reading view where (thanks to clean-embeds) just the content of the notes is displayed and it all looks like one document, though you can see the note I’m hovering over is slightly highlighted with a link to the note. Right is the note where I would be doing the actual editing most of the time.

The only topic I’ve found that discusses wanting to see the title and not the content is for the canvas, which I’m not wanting to use.

PS. This might be in the wrong topic? I’m not sure. Ideally, I’d like to change the clean-embeds css snippet so that the view is different between the edit and reading mode, but just for those notes I put it in the properties

If I’ve understood correctly, you could start with something like this using a cssclass of no-content. For Live Preview only →

.markdown-source-view.no-content .inline-embed .markdown-embed-content {
    display: none;
}

Live Preview | Reading view

Obsidian_kJgvvi9Ykm

For Live Preview and Reading view →

.view-content .no-content :is(.inline-embed .markdown-embed-content) {
    display: none;
}

Live Preview | Reading view

Obsidian_9jg5KQfjHf

Another option, with no cssclass, is to put

.view-content :is(.inline-embed .markdown-embed-content) {
    display: none;
}

in a snippet.css file on its own and use https://github.com/deathau/snippet-commands-obsidian and set a hotkey to enable and disable the snippet. That might be fun.


There are a lot of versions and flavors of “clean-embeds” floating around and I’d guess that would need some slight adjustment to work with the above. Probably involving the .markdown-embed .markdown-embed-title but can’t say for sure.

Anyway, it’s a start, and hopefully what you were going for. :grinning:

Thanks! I’ll give it a go. It looks like what I was after so far :smiley: