Obsidian auto heading size for embeds/transclusion


I user Obsidian and prefer to make my notes as short as possible to reuse them in different contexts. Thus I heavily rely on embedding/transcluding notes inside other notes which then are embedded in other notes and so on.

The Problem


A) I would like to use the Title of the embedded note as a heading. But I need an option to change the size of that heading (e.g. if I embed underneath a “## heading 2” I would like to make the title of the embed the size of “### heading 3”

B) Headings inside of the embed are the same size no matter of the context. So a “# heading 1” in the embed stays like this, even though I embedded it beneath a e.g. “### heading 3”.

My goals

  1. Be able to set the size of the title of the embed like “![note name|h1]” to make it look like “# note name” and so on.
  2. Adjust appearance of all headings inside the embed automatically according to the setting described in 1… So if I say “![note name|h2]”, then a “# heading” will appear as a “### heading”.
  3. make the same as 2.1 with all titles of embeds inside the embed.

Thank you

In advance. Would be grateful for all ideas on how to make this, cause I’m quite new to obsidian, CSS, and so on and have no clue how to do it.