Ok, I think I understand what you’re after. I believe you will need the top-level list to be the category and then use a nested list to show the posts in that category.
Then, to create the dynamic anchor link ID, you will have to follow this:
I haven’t tested this to know for sure but this is where I’d start.