I have two markdown files: a parent.md
and a child.md
.
So parent.md
:
# Main section
## sub-section
I'd like to make reference to ## sub-section
from child.md
.
Any ideas?
In MarkDown
, reference is possible using hyperlink :
# Main section
## [sub-section](./child.md#sub-section)
## [sub-section](/child.md#sub-section)
## [sub-section](child.md#sub-section)
Unfortunately the direct embedding of another Markdown file is not possible
An alternative is the use of an incision from a capture of the other file:
# Main section
## sub-section

What worked for me is in parent.md:
[link](./file.md#section-name) // note the dash!
In child.md:
## ...
## section name
I tested this on my local via JetBrains IDE.
The snippets macro gets quite close to that function I've asked to add support to importing particular lines from files on manually setting anchors on one files and then injecting the anchor section in another file