I am attempting to include short comments on the outer side margin of a book that highlight text content on that page. I would like this to happen automatically if possible so that as I edit the book the comment moves appropriately. For example if the main text contains the date 1775, I would like the side comment to automatically add from a csv file I have created - 1775: The American Revolution commences. I am quite familiar in using InDesign in creating conventional books but this is well outside my experience and for all I know may not be possible!
I have a blueprint for a fairly large series of books that would be produced in two forms: trimmed to standard page size, or with fairly large outer margins to contain notes and commentary. The commentary is a separate text flow from the main content. This sounds similar to what you're trying to accomplish.
The only solution I have found is to use the baseline grid and use it and various text spacing methods to hold the commentary text in alignment with the body text. Nothing too elegant about it, but it works and I have several prototype chapters.
It's possible a script could pull associated notes and place them in the commentary frame, but this sounds a bit like you are leaning towards an almost AI-like automatic annotation. Maybe there's a combination of tools that can get there, but (at a minimum) manual/intelligent placement of the commentary links would be orders of magnitude simpler.
If that doesn't quite address your question, feel free to expand!
I'm not sure how you can add the .csv content automatically (perhaps through scripting, but that's not my area), but it sounds like you will need to put the comment in an anchored frame in the margin, so that it follows the text that it references as you edit the document. InDesign does not support side heads, which is what I think you're really asking for.
I'm not sure side heads (as I've ever seen them implemented) would be a solution. As paragraphs, they'd interrupt the flow of the text. This (and my example that I discussed) are more like... side footnotes.
Can't think of any good way to anchor them to the text, though, and never did for my project. Two aligned text frames was the best solution I found; it will be interesting to see if the crowd here comes up with a better solution.
@James Gifford—NitroPress FrameMaker—Adobe's other page layout application—supports sideheads. You can designate a paragraph as a sidehead and it moves from its natural position above the paragraph it modifies, to the side. It does not disrupt the text flow in any way. But as I said, this is not a feature that is available in InDesign.
Your use of the words "side footnotes" just jogged my memory. Fellow ACP @Peter Kahrel has a script that will convert footnotes to "sidenotes" or "margin notes": https://creativepro.com/files/kahrel/indesign/sidenotes.html.
I'm familiar with FM; published three books using it a while back. (And wish it was part of Creative Suite, although I understand the product partioning).
Side heads don't necessarily interrupt the visual flow (if designed without any spacing above, for example) but unless FM has changed since I last used it, they are still part of the text flow and thus put a structural break at that point, which would be hard to integrate as "a note." They can't simply be hung off to one side of a line—as far as I know—but would be a heading paragraph in between two body paragraphs. Maybe there's enough layout flexibility to make it work.
I'll have to look at that script, though. Thanks.