Export Outline of Notes in a Linked Format

I am trying to make a Table of Content for every book i read and summarize every chapter and heading in it (and add some of my headings to it). The problem i have right now is lack of enough automation. If i could export headings of each chapter (that i keep in a separate note) in bullet point format (and each chapter properly linked meaning: [[notename#heading name|heading name]]) would be awesome. Even better would be a plugin to does that automatically in a note, meaning a code that parses a note and adds the outline of every note below each link.