When I embed a note, I want options of how they get embedded. There should especially be the option to embed notes stealthily. Stealth embed.
Proposed solution
There are three categories of embed that I can think of:
Normal embed. This is the current state. Embedded notes have indent and title visible.
Stealth embed. Notes or topics are hidden. No title of the note is seen, and if a heading is embedded (using #) then the heading is not seen either; child headings will be seen though. But if there are no child headings, then the note should merge seamlessly with a line or paragraph. The naked-embed css solutions don’t quite cut it. Users in read-mode should not know that a note is embedded into a line.
Hybrid embed. Here users will know that it is an embed but not see the title of the note or heading.
Current workaround (optional)
I tried various versions of naked-embed solutions, but none of them worked.
Ok that didn’t work. But I used chatgpt and got this far:
/* Remove the visual separator and indent from embedded content */
.markdown-embed-content {
border: none !important; /* Removes borders */
padding: 0 !important; /* Removes padding */
margin: 0 !important; /* Removes margin */
}
/* Attempt to make embedded content display inline */
.markdown-embed {
display: inline !important; /* Changes embeds to inline display */
margin: 0 !important; /* Removes margin around embeds */
}
/* Hide all headings within embedded notes */
.markdown-embed h1, .markdown-embed h2, .markdown-embed h3,
.markdown-embed h4, .markdown-embed h5, .markdown-embed h6 {
display: none !important;
}
/* Additional styling to attempt to force inline behavior */
.markdown-embed-link, .internal-embed {
display: inline-block !important; /* Makes the embed link and container inline-block */
margin: 0 !important; /* Removes margin */
padding: 0 !important; /* Removes padding */
}
/* Remove specific styling that may cause separation */
.markdown-preview-view .markdown-embed, .markdown-preview-section .internal-embed {
border: none !important; /* Ensures no border is applied */
box-shadow: none !important; /* Removes box shadow if any */
}
But I still see the purple line and the embed goes to the next line even though I gave no line break. I want it to blend seamlessly with the sentence that I put the embed in.
Is that possible?
I tried ITS, with and without the chatgpt script, but i’m stuck at the same place
/* Hide all headings within embedded notes */
.markdown-embed h0, .markdown-embed h1, .markdown-embed h2, .markdown-embed h3,
.markdown-embed h4, .markdown-embed h5, .markdown-embed h6 {
display: none !important;
}
/* Additional styling to attempt to force inline behavior */
.markdown-embed-link, .internal-embed {
display: inline-block !important; /* Makes the embed link and container inline-block */
margin: 0 !important; /* Removes margin */
padding: 0 !important; /* Removes padding */
}
/* Remove purple line */
body {
--embed-border-left: unset;
}
But this doesn’t hide the title.
I’ve noticed it hides the title only when there’s a “#”. For example "![[note-embed#heading]] hides the heading and the title, but "![[note-embed]] on its doesn’t hide the title.
or “Here is some text, here's the embed, and here’s some more text.”
but you don’t know it’s an embed? If so, I’ve seen those called inline block references. There was some very complicated CSS a while ago that could handle those, but it broke along the way, unfortunately.
You could look into Dataview’s inline JS queries, but that’s entirely different animal and workflow.
This is great! I’m still trying to get out the empty space under the embed.
You could also play around with adding this code, which was written by @zamsyt#4459 on discord.
But it makes bullets and indents disappear. I don’t understand enough to modify it.
I’m sure Zam has a use case for it, but the bullets and indents disappearing are from the margin: 0 here. It’s removing top-right-bottom-left margins and compressing all p, ul, li elements.