Inline reference embeds

The current block references stand out as big alien chunks in any document. It’d be better if they felt as if they were part of the document, or at least to have the option to achieve that. If I have inline embeds, then a synthesis of different ideas can be put together without forcing a shape like current embeds do.

This request can be better placed in context by looking at this comment in a different thread.

27 Likes

+1 this request for users that create very atomic notes. This may end up as a plugin though.

2 Likes

this is possible via css right now, I think under naked embeds

I have taken a dig at this. Check this out :slight_smile:

1 Like

I, also, would like to see this feature added, perhaps as a formatting toggle (current form v. minimal form).

3 Likes

I need this feature.
I have to link my todo item when scheduling today’s task list.
the block embedding totally destroy my list and hard to preview.

Now this feature can be achieved with Murf’s css

/* INLINE BLOCK REFS */
:root {
    --block-ref-color: yellow;
    --block-ref-link-color: transparent;
}
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed {
    border-top: none;
    border-bottom-color: var(--block-ref-color);
    border-bottom-style: dashed;
    padding: 0px;
    margin: 0px;
}

.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed),
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer > div,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer > div > p,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer > div > div {
    display: inline;
    padding: 0px !important;
    margin: 0px !important;
}

/* Convert bullet list block refs inline (remove the bullet) */
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer ul,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer li,
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer li > div {
    display: inline;
}
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed > div.markdown-embed-content > div.markdown-preview-view > div.markdown-preview-section ul {
    padding: 0px !important;
    margin: 0px !important;
}

/* Hide the block ref link unless hovered */
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed > div.markdown-embed-link {
    display: none;
    color: var(--block-ref-link-color);
    top: 0px;
    left: 20px;
}
/* Show the block ref link on hover */
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed:hover > div.markdown-embed-link {
    display: block;
}
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed:hover {
    border-bottom-style: solid;
}

.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed > div.markdown-embed-content > div.markdown-preview-view > div.markdown-preview-section {
    min-height: 0px !important;
}
/* Remove line breaks on multi-line block refs */
.markdown-preview-view span[src*="^"].internal-embed > .markdown-embed > .markdown-embed-content > .markdown-preview-view > .markdown-preview-sizer br {
    /*display: none;*/
}
1 Like

Was going to suggest exactly this. Yes, this would be great. I currently use the notes refactor plugin a lot, and the result tends to be quite ugly when I chop a larger note into smaller ones. That is especially the case when an embedded note renders at its maximum size, with the text within becoming scrollable.

To avoid this problem, I create copies of the sub-headings as separate notes instead of embedding them. I would have preferred to be able to embed them in-line as OP suggested.