How to insert only the title of the note and the first paragraph when pasting a file into another file

I would do this with Templater js.
A thread on achieving something similar: