I have a question with regards to dynamic documents written with Stata 15. I am using the dyndoc command, you can see how it works with examples here.
Since in some of my reports there is plenty of content, I would like to include a table of content at the beginning of each file. I am not sure, but it seems to me that there is no support for anything similar with dyndoc. However, the command structure allows embedding html snippets with dd_include, including a reference to a css style sheet (see here). Therefore, I thought I could include a java or php script in a header.txt (see the previous link) and go down that path.
In the markdown language every title generated with a series of ### becomes an <h> element in the html after the dyndoc conversion. Therefore, I thought I need a script which identifies these <h> elements and creates the table. I have tried several options with java from here and with php from here. However, none of this works, and I am not even sure I am on the right path.
Is there anyone with some more experience with similar issues? I'd appreciate any help!