I have been working on a document that details the changes needed to migrate a system from Java 8 to OpenJDK 11. While writing documents I add notes to myself in-situ, eg "TODO: Buy bread and milk before the next nor'easter." As the document was getting longer and the TODOs were mounting an itch was developing. I wanted a "Table of TODOs."
I use Google Docs and so the itch was scratched using Google's App Script. The script collects the text of all the TODO paragraphs and organizes them under a Table of TODOs heading. The TODO is a normal-styled paragraph that starts with "TODO: ". The Table of TODOs is a heading-styled paragraph that contains only "Table of TODOs". The script organizes the TODO texts in to numbered list items under the heading. The script also adds a Bookmark to each TODO paragraph so that it can be referenced from the numbered list item. To see the example you will need a Google account and to make a copy before you can view the script (under Tools / Script editor). [Update: Placed the script in a gist.]