What most closely resembles what you are looking for is called statistical cookies. They are described at the end of this page in the manual . At first intended for lists, but it is also possible to count headings. Just put [/] at the end of your header, for example:
* Main header [/] ** sub-header 1 ** sub-header 2 ** sub-header 3
And click Cc Cc in the cookie to update it (update its quantity). What you need to add to what you call your use case is the TODO keywords for your headers, because what cookies will count is how many of them are made. Therefore, I suggest you mark everything as DONE , for example:
* Main header [3/3] ** DONE sub-header 1 ** DONE sub-header 2 ** DONE sub-header 3
Then the counter will show you what you want.
Perhaps you could adjust the code for these cookies to meet your specific needs.
source share