Transclusion questions

I have been using transclusions more and more, and find the feature very helpful.
BUT, 3 questions that I haven’t been able to figure out (warning: I’m very rudimentary with CSS so didn’t even look. But not sure it’s there at all).

  1. “Box” size: when I transclude a longer piece of writing (let’s say longer than the height of my monitor, but not sure of the exact size), the preview ends up having a double scrollbar: one for the main window, and a separate one for the given transclusion itself. So it is behaving as if the transclusion were allotted a certain height, and if it surpasses that, you have to scroll. So the question: is there a way to set this size somewhere? Or to turn it off? My ideal setup would be to show the whole transcluded text (with no double scroll bar) no matter how long it is. Things get worse when I transclude a file that also contains a transclusion – scroll bars upon scroll bars!
    (I feel like this is a CSS-kind-of thing, but again, hopeless on that front :confused: )

  2. Titles: Is it possible somehow to include the file-name of the trascluded file in the trasclusion itself? Right now, if I trasclude ![[a]] and ![[b]], then the contents will display but their names won’t. It would be very helpful sometimes if their names also showed. (I feel like maybe there is a way to do it with some regex, but that would be a last resort.)

  3. (this is +1, the original post was for the above 2), pdf embeds: images are displaying in my transcluded files fine. But pdfs don’t (i.e., if I “embed” (which is also transclusion) a pdf in file X and then transclude X in Y, then the pdf is showing in X but not in Y). Is that intended behavior? Can it be changed?

Would be grateful for any suggestions about any of these!


Well, just in case anyone else is wondering about these.

(2) seems to be theme-dependent. When I have more time, I’ll look into the CSS to try to figure out what makes it insert the filename.

(3) somehow fixed itself. Not sure what happened, I did exactly nothing, and now the pdfs appear.

I still don’t have an answer to (1) which was the most important question…

I use transclusions extensively too, and tried out quite a few themes before settling on one, but none ever included the filename in the transclusion. So, your point #2 does not seem to be theme-dependent, in my experience.

I don’t know how common this is. But I like trying out themes and tested the CyberGlow one yesterday on my “test vault”, and it does include filenames in the transclusion. So, it is doable, I just haven’t had the time to try looking into how.

I was surprised there still isn’t a feature request for question one. I thought I had created one, but it turns out I had only created a help topic: Is there a way to preview entire embedded markdown files without scrollbar?

It looks like another post here I had created with the intention of being a feature request is also resolved help: Embedded .md files in entirety (without scrollbar)

I will create a feature request for sure this time. Here it is: Embeds without scrollbar


1 Like

@I-d-as, @atiz: if you go to the Github link in the post at the top of this page, then go to the section Embeds, header Transclusions, scroll down a bit and you’ll find code to eliminate the scrollbar in an embed.


Thanks @I-d-as, I tried to search for topics but didn’t find these. Definitely a +1 for the feature request, although looks like @Klaas’s solution may work!

1 Like

It does work – thank you, @Klaas, (1) solved!
(I do know of the CSS tweaks github page, just somehow did not think I would find this there. Thanks!)

Thanks @Klaas! Very much appreciated.

Glad to hear it @atiz. Not sure why I was intimidated by this in the past. I think it was before snippets were as easy to deal with as they are now.

It’s a good day.

1 Like

wow! This is a game changer for long form writing. Thanks not only for the CSS snippet, but also for pointing out how to find the one that enables full-view of transcluded note. I would not have guessed to look under Embed (although it makes sense in retrospect).

1 Like

@midas0441 : you’re welcome.